From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 45432DE0 for ; Wed, 10 Dec 2014 04:39:14 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 09 Dec 2014 19:39:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="496415859" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by orsmga003.jf.intel.com with ESMTP; 09 Dec 2014 19:35:26 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by pgsmsx106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 10 Dec 2014 11:37:43 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.182]) with mapi id 14.03.0195.001; Wed, 10 Dec 2014 11:37:42 +0800 From: "Qiu, Michael" To: "Zhang, Helin" , Jincheng Miao , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] igb_uio: kernel version check for using kstrtoul or strict_strtoul Thread-Index: AQHQFCUvgOTVyXWgp0uFNc9WrZtbyA== Date: Wed, 10 Dec 2014 03:37:41 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286C9E50B@SHSMSX101.ccr.corp.intel.com> References: <1418179099-4822-1-git-send-email-helin.zhang@intel.com> <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:39:14 -0000 On 12/10/2014 11:02 AM, Zhang, Helin wrote:=0A= > Hi Jincheng=0A= >=0A= > Did you attach anything? I can see the text only.=0A= > Could you forward your patch mail to me directly? Thanks a lot!=0A= =0A= Hi Helin,=0A= =0A= I indeed ever saw one patch that was similar this one :) but not sure if=0A= it is post by Jincheng.=0A= =0A= You can go through patchwork to have a look.=0A= =0A= Thanks,=0A= Michael=0A= > Regards,=0A= > Helin=0A= >=0A= >> -----Original Message-----=0A= >> From: Jincheng Miao [mailto:jmiao@redhat.com]=0A= >> Sent: Wednesday, December 10, 2014 10:55 AM=0A= >> To: Zhang, Helin; dev@dpdk.org=0A= >> Subject: Re: [dpdk-dev] [PATCH] igb_uio: kernel version check for using = kstrtoul=0A= >> or strict_strtoul=0A= >>=0A= >> Here is my patch for it, and it also resolves issue of pci_num_vf() defi= nition.=0A= >>=0A= >> And I will send V3 for a while.=0A= >>=0A= >>=0A= >> On 12/10/2014 10:38 AM, Helin Zhang wrote:=0A= >>> strict_strtoul() was just a redefinition of kstrtoul() for a long=0A= >>> time. From kernel version of 3.18, strict_strtoul() will not be=0A= >>> defined at all. A compile time kernel version check is needed to=0A= >>> decide which function or macro can be used for a specific version of=0A= >>> kernel.=0A= >>>=0A= >>> Signed-off-by: Helin Zhang =0A= >>> ---=0A= >>> lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 4 ++++=0A= >>> 1 file changed, 4 insertions(+)=0A= >>>=0A= >>> diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c=0A= >>> b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c=0A= >>> index d1ca26e..2fcc5f4 100644=0A= >>> --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c=0A= >>> +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c=0A= >>> @@ -83,7 +83,11 @@ store_max_vfs(struct device *dev, struct=0A= >> device_attribute *attr,=0A= >>> unsigned long max_vfs;=0A= >>> struct pci_dev *pdev =3D container_of(dev, struct pci_dev, dev);=0A= >>>=0A= >>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)=0A= >>> if (0 !=3D strict_strtoul(buf, 0, &max_vfs))=0A= >>> +#else=0A= >>> + if (0 !=3D kstrtoul(buf, 0, &max_vfs)) #endif=0A= >>> return -EINVAL;=0A= >>>=0A= >>> if (0 =3D=3D max_vfs)=0A= >=0A= =0A=