Linux backports project
 help / color / mirror / Atom feed
From: Stefan Assmann <sassmann@kpanic.de>
To: Hauke Mehrtens <hauke@hauke-m.de>, mcgrof@kernel.org
Cc: backports@vger.kernel.org
Subject: Re: [PATCH RFC v2 02/11] backports: igb fixes for linux-3.9
Date: Thu, 19 Dec 2013 09:56:46 +0100	[thread overview]
Message-ID: <52B2B4CE.1080207@kpanic.de> (raw)
In-Reply-To: <52B2034D.3020100@hauke-m.de>

On 18.12.2013 21:19, Hauke Mehrtens wrote:
> On 12/18/2013 05:08 PM, Stefan Assmann wrote:
>> - add struct pci_sriov
>> - add pci_vfs_assigned()
>> - add PCI_SRIOV defines
>> - add patches/collateral-evolutions/network/82-ethernet/0001-igb_net_device_ops.patch
>>
>> Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
>> ---
>>  backport/backport-include/linux/pci.h              | 25 ++++++++++
>>  backport/backport-include/linux/pci_regs.h         |  8 ++++
>>  backport/compat/backport-3.10.c                    | 46 ++++++++++++++++++
>>  .../82-ethernet/0001-igb_net_device_ops.patch      | 56 ++++++++++++++++++++++
>>  4 files changed, 135 insertions(+)
>>  create mode 100644 patches/collateral-evolutions/network/82-ethernet/0001-igb_net_device_ops.patch
>>
>> diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h
>> index 3a1815a..b56761f 100644
>> --- a/backport/backport-include/linux/pci.h
>> +++ b/backport/backport-include/linux/pci.h
>> @@ -178,4 +178,29 @@ bool pci_pme_capable(struct pci_dev *dev, pci_power_t state);
>>  	.subvendor = (subvend), .subdevice = (subdev)
>>  #endif /* PCI_DEVICE_SUB */
>>  
>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
>> +/* Taken from drivers/pci/pci.h */
>> +struct pci_sriov {
>> +	int pos;		/* capability position */
>> +	int nres;		/* number of resources */
>> +	u32 cap;		/* SR-IOV Capabilities */
>> +	u16 ctrl;		/* SR-IOV Control */
>> +	u16 total_VFs;		/* total VFs associated with the PF */
>> +	u16 initial_VFs;	/* initial VFs associated with the PF */
>> +	u16 num_VFs;		/* number of VFs available */
>> +	u16 offset;		/* first VF Routing ID offset */
>> +	u16 stride;		/* following VF stride */
>> +	u32 pgsz;		/* page size for BAR alignment */
>> +	u8 link;		/* Function Dependency Link */
>> +	u16 driver_max_VFs;	/* max num VFs driver supports */
>> +	struct pci_dev *dev;	/* lowest numbered PF */
>> +	struct pci_dev *self;	/* this PF */
>> +	struct mutex lock;	/* lock for VF bus */
>> +	struct work_struct mtask; /* VF Migration task */
>> +	u8 __iomem *mstate;	/* VF Migration State Array */
>> +};
> 
> where is this struct used?

/dev/shm/next/compat/backport-3.10.c: In function €˜pci_vfs_assigned:
/dev/shm/next/compat/backport-3.10.c:156: error: dereferencing pointer to incomplete type
pci_read_config_word(dev, dev->sriov->pos + PCI_SRIOV_VF_DID, &dev_id);

> 
>> +extern int pci_vfs_assigned(struct pci_dev *dev);
> The extern is not needed.

Yes, my bad. Going to fix that.

> 
> If CONFIG_PCI_IOV is not set backports will not include the
> implementation of this function, you should add something like this in
> the header:
> 
> #ifdef CONFIG_PCI_IOV
> int pci_vfs_assigned(struct pci_dev *dev);
> #else
> static inline int pci_vfs_assigned(struct pci_dev *dev)
> {
> 	return 0;
> }
> #endif

Agreed.

  Stefan

  reply	other threads:[~2013-12-19  8:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18 16:08 [PATCH RFC v2 00/11] backports: add igb driver Stefan Assmann
2013-12-18 16:08 ` [PATCH RFC v2 01/11] backports: igb fixes for linux-3.12 Stefan Assmann
2013-12-18 16:08 ` [PATCH RFC v2 02/11] backports: igb fixes for linux-3.9 Stefan Assmann
2013-12-18 20:19   ` Hauke Mehrtens
2013-12-19  8:56     ` Stefan Assmann [this message]
2013-12-18 16:08 ` [PATCH RFC v2 03/11] backports: igb fixes for linux-3.8 Stefan Assmann
2013-12-18 16:08 ` [PATCH RFC v2 04/11] backports: igb fixes for linux-3.7 Stefan Assmann
2013-12-18 16:08 ` [PATCH RFC v2 05/11] backports: igb fixes for linux-3.6 Stefan Assmann
2013-12-18 20:27   ` Hauke Mehrtens
2013-12-19  9:50     ` Stefan Assmann
2013-12-18 16:08 ` [PATCH RFC v2 06/11] backports: igb fixes for linux-3.5 Stefan Assmann
2013-12-18 20:35   ` Hauke Mehrtens
2013-12-19  9:55     ` Stefan Assmann
2013-12-22 18:56       ` Hauke Mehrtens
2013-12-18 16:08 ` [PATCH RFC v2 07/11] backports: igb fixes for linux-3.4 Stefan Assmann
2013-12-18 22:28   ` Hauke Mehrtens
2013-12-19 10:37     ` Stefan Assmann
2013-12-23 13:58       ` Hauke Mehrtens
2013-12-24 11:19         ` Stefan Assmann
2013-12-18 16:08 ` [PATCH RFC v2 08/11] backports: igb fixes for linux-3.3 Stefan Assmann
2013-12-18 16:08 ` [PATCH RFC v2 09/11] backports: igb fixes for linux-3.2 Stefan Assmann
2013-12-18 16:08 ` [PATCH RFC v2 10/11] backports: igb fixes for linux-3.1 Stefan Assmann
2013-12-18 16:08 ` [PATCH RFC v2 11/11] backports: enable igb and add defconfig Stefan Assmann

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=52B2B4CE.1080207@kpanic.de \
    --to=sassmann@kpanic.de \
    --cc=backports@vger.kernel.org \
    --cc=hauke@hauke-m.de \
    --cc=mcgrof@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox