All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: linuxppc-dev@lists.ozlabs.org, Bjorn Helgaas <helgaas@kernel.org>,
	David Gibson <david@gibson.dropbear.id.au>,
	Alistair Popple <alistair@popple.id.au>,
	shan.gavin@gmail.com, Michael Ellerman <mpe@ellerman.id.au>,
	Paul Mackerras <paulus@samba.org>,
	Russell Currey <ruscur@russell.cc>
Subject: Re: [PATCH kernel] powerpc/powernv: Update comment about shifting IOV BAR
Date: Thu, 14 Sep 2017 13:39:45 +1000	[thread overview]
Message-ID: <1505360385.12628.187.camel@kernel.crashing.org> (raw)
In-Reply-To: <18f3462e-09ee-ce02-f9c6-eafad68cb9c6@ozlabs.ru>

On Thu, 2017-09-14 at 13:18 +1000, Alexey Kardashevskiy wrote:
> On 14/09/17 13:07, Benjamin Herrenschmidt wrote:
> > On Thu, 2017-09-14 at 12:45 +1000, Alexey Kardashevskiy wrote:
> > > On 31/08/17 13:34, Alexey Kardashevskiy wrote:
> > > > From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > > 
> > > Oops, this was not right :)
> > > 
> > > Anyway, Ben, please comment. Thanks.
> > 
> > This is incorrect, we can do hotplug behind switches afaik.
> 
> Do we have an actual system which allows this? 

Tuleta no ?

> Anyway, what we do now is
> wrong and it needs what? Reserve that hole? I'd like to update the comment
> for now, at least, and state what bad thing can happen and what we expect.

The hole should be reserved unless another SR-IOV device can use it ...

> 
> > > 
> > > > 
> > > > From: Alexey Kardashevskiy <aik@ozlabs.ru>
> > > > 
> > > > This updates the comment about creating a hole in /proc/iomem which
> > > > should not be normally happening but it does in the powernv platform
> > > > due the way MMIO M64 BARs are organised in the IODA2-capable hardware.
> > > > 
> > > > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > > > ---
> > > > 
> > > > It has been mentioned multiple times (last one -
> > > > https://www.spinics.net/lists/linux-pci/msg64084.html ) that the comment
> > > > is not informative enough for people not particularly familiar with
> > > > the POWER8 IO hardware.
> > > > 
> > > > This attempt aims to:
> > > > 1. explain why we shift the resource
> > > > 2. explain why nothing can use that hole as a resource while it is "free"
> > > > (I am not sure that this is the case actually)
> > > > 
> > > > Please comment, everyone, let's have this very well documented while
> > > > I remember these bits :) Thanks.
> > > > ---
> > > >  arch/powerpc/platforms/powernv/pci-ioda.c | 10 +++++++---
> > > >  1 file changed, 7 insertions(+), 3 deletions(-)
> > > > 
> > > > diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
> > > > index 48de308224d6..c4a36ae78c95 100644
> > > > --- a/arch/powerpc/platforms/powernv/pci-ioda.c
> > > > +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
> > > > @@ -1002,9 +1002,13 @@ static int pnv_pci_vf_resource_shift(struct pci_dev *dev, int offset)
> > > >  	}
> > > >  
> > > >  	/*
> > > > -	 * After doing so, there would be a "hole" in the /proc/iomem when
> > > > -	 * offset is a positive value. It looks like the device return some
> > > > -	 * mmio back to the system, which actually no one could use it.
> > > > +	 * Since M64 BAR shares segments among all possible 256 PEs,
> > > > +	 * we have to shift the beginning of PF IOV BAR to make it start from
> > > > +	 * the segment which belongs to the PE number assigned to the first VF.
> > > > +	 * This creates a "hole" in the /proc/iomem which could be used for
> > > > +	 * allocating other resources, however this is not expected to happen
> > > > +	 * on IODA as the only possibility would be a PCI hotplug and IODA
> > > > +	 * hardware only allows it on a slot with dedicated PHB.
> > > >  	 */
> > > >  	for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
> > > >  		res = &dev->resource[i + PCI_IOV_RESOURCES];
> > > > 
> > > 
> > > 
> 
> 

  reply	other threads:[~2017-09-14  3:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31  3:34 [PATCH kernel] powerpc/powernv: Update comment about shifting IOV BAR Alexey Kardashevskiy
2017-09-14  2:45 ` Alexey Kardashevskiy
2017-09-14  3:07   ` Benjamin Herrenschmidt
2017-09-14  3:18     ` Alexey Kardashevskiy
2017-09-14  3:39       ` Benjamin Herrenschmidt [this message]
2017-09-14  9:27         ` David Laight
2017-09-14 10:06           ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1505360385.12628.187.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=aik@ozlabs.ru \
    --cc=alistair@popple.id.au \
    --cc=david@gibson.dropbear.id.au \
    --cc=helgaas@kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=ruscur@russell.cc \
    --cc=shan.gavin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.