From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 87D1C8DED for ; Tue, 17 Apr 2018 14:58:24 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2018 05:58:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,463,1517904000"; d="scan'208";a="38057882" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by fmsmga002.fm.intel.com with ESMTP; 17 Apr 2018 05:58:22 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.155]) by IRSMSX106.ger.corp.intel.com ([169.254.8.37]) with mapi id 14.03.0319.002; Tue, 17 Apr 2018 13:58:21 +0100 From: "Iremonger, Bernard" To: Ajit Khaparde , "dev@dpdk.org" CC: Scott Branden Thread-Topic: [dpdk-dev] [PATCH] igb_uio: only check for pci bridge in supported by linux kernel Thread-Index: AQHT1cS23Yd46dR7YUS4rOTDWbA8PKQE6m3A Date: Tue, 17 Apr 2018 12:58:20 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C24E0AE8B7@IRSMSX108.ger.corp.intel.com> References: <20180416205110.1354-1-ajit.khaparde@broadcom.com> In-Reply-To: <20180416205110.1354-1-ajit.khaparde@broadcom.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2M5MjczMjctZjc4Yi00ZWM3LWEzZGItYmVlMWQzYzFkMjc4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJWSFwvS0FuQ3lXYVh1OCtKNmVIYVBsYVwvQnRaTUpGXC9cL1JZd0dqZU9ETGNTOXVSaFdlaHljWG1UczBGOXBrb25cL2QifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] igb_uio: only check for pci bridge in supported by linux kernel X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 12:58:25 -0000 Hi Scott, Ajit, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ajit Khaparde > Sent: Monday, April 16, 2018 9:51 PM > To: dev@dpdk.org > Cc: Scott Branden > Subject: [dpdk-dev] [PATCH] igb_uio: only check for pci bridge in support= ed by > linux kernel >=20 > From: Scott Branden >=20 > 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. >=20 > Fix build error when calling pci_is_bridge by not calling/supporting pci_= is_bridge > with kernel versions before 3.16. >=20 > Signed-off-by: Scott Branden > Reported-by: Ferruh Yigit > --- > kernel/linux/igb_uio/compat.h | 4 ++++ kernel/linux/igb_uio/igb_uio.c = | 2 ++ > 2 files changed, 6 insertions(+) >=20 > diff --git a/kernel/linux/igb_uio/compat.h b/kernel/linux/igb_uio/compat.= h > index ce456d4bb..b48c4cc91 100644 > --- a/kernel/linux/igb_uio/compat.h > +++ b/kernel/linux/igb_uio/compat.h > @@ -132,3 +132,7 @@ static bool pci_check_and_mask_intx(struct pci_dev > *pdev) #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 5, 0) #define > HAVE_PCI_MSI_MASK_IRQ 1 #endif > + > +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(3, 16, 0) #define > +HAVE_PCI_IS_BRIDGE_API 1 #endif > diff --git a/kernel/linux/igb_uio/igb_uio.c b/kernel/linux/igb_uio/igb_ui= o.c index > cbc5ab63a..cd9b7e721 100644 > --- a/kernel/linux/igb_uio/igb_uio.c > +++ b/kernel/linux/igb_uio/igb_uio.c > @@ -473,10 +473,12 @@ igbuio_pci_probe(struct pci_dev *dev, const struct > pci_device_id *id) > void *map_addr; > int err; >=20 > +#ifdef HAVE_PCI_IS_BRIDGE_API > if (pci_is_bridge(dev)) { > dev_warn(&dev->dev, "Ignoring PCI bridge device\n"); > return -ENODEV; > } > +#endif >=20 > udev =3D kzalloc(sizeof(struct rte_uio_pci_dev), GFP_KERNEL); > if (!udev) > -- > 2.15.1 (Apple Git-101) This patch fixes the compile error seen on the master branch. However there are the following checkpatch.pl warnings: WARNING: LINUX_VERSION_CODE should be avoided, code should be for the versi= on to which it is merged #40: FILE: kernel/linux/igb_uio/compat.h:136: +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(3, 16, 0) WARNING: Comparisons should place the constant on the right side of the tes= t #40: FILE: kernel/linux/igb_uio/compat.h:136: +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(3, 16, 0) total: 0 errors, 2 warnings, 19 lines checked Regards, Bernard. =20