From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 92F776A8B for ; Wed, 10 Dec 2014 04:01:28 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 09 Dec 2014 18:59:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="496404426" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by orsmga003.jf.intel.com with ESMTP; 09 Dec 2014 18:57:41 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by KMSMSX151.gar.corp.intel.com (172.21.73.86) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 10 Dec 2014 11:01:25 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.182]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.110]) with mapi id 14.03.0195.001; Wed, 10 Dec 2014 11:01:24 +0800 From: "Zhang, Helin" To: Jincheng Miao , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] igb_uio: kernel version check for using kstrtoul or strict_strtoul Thread-Index: AQHQFCURzow8KiCV1UGtXykwZEyUwpyIIlOA Date: Wed, 10 Dec 2014 03:01:23 +0000 Message-ID: References: <1418179099-4822-1-git-send-email-helin.zhang@intel.com> <5487B601.20305@redhat.com> In-Reply-To: <5487B601.20305@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] igb_uio: kernel version check for using kstrtoul or strict_strtoul X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2014 03:01:29 -0000 Hi Jincheng Did you attach anything? I can see the text only. Could you forward your patch mail to me directly? Thanks a lot! Regards, Helin > -----Original Message----- > From: Jincheng Miao [mailto:jmiao@redhat.com] > Sent: Wednesday, December 10, 2014 10:55 AM > To: Zhang, Helin; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] igb_uio: kernel version check for using k= strtoul > or strict_strtoul >=20 > Here is my patch for it, and it also resolves issue of pci_num_vf() defin= ition. >=20 > And I will send V3 for a while. >=20 >=20 > On 12/10/2014 10:38 AM, Helin Zhang wrote: > > strict_strtoul() was just a redefinition of kstrtoul() for a long > > time. From kernel version of 3.18, strict_strtoul() will not be > > defined at all. A compile time kernel version check is needed to > > decide which function or macro can be used for a specific version of > > kernel. > > > > Signed-off-by: Helin Zhang > > --- > > lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c > > b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c > > index d1ca26e..2fcc5f4 100644 > > --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c > > +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c > > @@ -83,7 +83,11 @@ store_max_vfs(struct device *dev, struct > device_attribute *attr, > > unsigned long max_vfs; > > struct pci_dev *pdev =3D container_of(dev, struct pci_dev, dev); > > > > +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) > > if (0 !=3D strict_strtoul(buf, 0, &max_vfs)) > > +#else > > + if (0 !=3D kstrtoul(buf, 0, &max_vfs)) #endif > > return -EINVAL; > > > > if (0 =3D=3D max_vfs)