[dpdk-dev] [PATCH v3] igb_uio: bind error if pcie bridge

Ferruh Yigit ferruh.yigit at intel.com
Mon Apr 16 17:35:23 CEST 2018


On 3/29/2018 5:37 PM, Ajit Khaparde wrote:
> From: Darren Edamura <darren.edamura at broadcom.com>
> 
> Probe function should exit immediately if pcie bridge detected
> 
> Signed-off-by: Darren Edamura <darren.edamura at broadcom.com>
> Signed-off-by: Rahul Gupta <rahul.gupta at broadcom.com>
> Signed-off-by: Scott Branden <scott.branden at broadcom.com>
> Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
> ----
> v1->v2: add a log message if the condition is true.
> v2->v3: rebase against latest dpdk-next-net tree.
> ---
>  kernel/linux/igb_uio/igb_uio.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/kernel/linux/igb_uio/igb_uio.c b/kernel/linux/igb_uio/igb_uio.c
> index 4cae4dd27..cbc5ab63a 100644
> --- a/kernel/linux/igb_uio/igb_uio.c
> +++ b/kernel/linux/igb_uio/igb_uio.c
> @@ -473,6 +473,11 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  	void *map_addr;
>  	int err;
>  
> +	if (pci_is_bridge(dev)) {

Hi Ajit,

I acked this patch and it is already applied but there is a build issue for this
one.

Starting from Linux v3.16 pci_is_bridge() is in linux/pci.h, in previous
versions it is in drivers/pci/pci.h which is private header and using this API
causing a build error.

Can you please send a fix for this?

It is possible to define a macro in igb_uio/compat.h based on kernel version
check. And in igb_uio.c use that macro to enable/disable pci_is_bridge() check.
Please don't use version check directly in igb_uio.c

Thanks,
ferruh


> +		dev_warn(&dev->dev, "Ignoring PCI bridge device\n");
> +		return -ENODEV;
> +	}
> +
>  	udev = kzalloc(sizeof(struct rte_uio_pci_dev), GFP_KERNEL);
>  	if (!udev)
>  		return -ENOMEM;
> 



More information about the dev mailing list