Message ID | 1418179099-4822-1-git-send-email-helin.zhang@intel.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 52A547E7C; Wed, 10 Dec 2014 03:38:31 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D3EDA7E79 for <dev@dpdk.org>; Wed, 10 Dec 2014 03:38:26 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 09 Dec 2014 18:38:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,549,1413270000"; d="scan'208";a="621338344" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 09 Dec 2014 18:38:25 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id sBA2cMb7003164; Wed, 10 Dec 2014 10:38:22 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id sBA2cKbC004905; Wed, 10 Dec 2014 10:38:22 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id sBA2cKoq004901; Wed, 10 Dec 2014 10:38:20 +0800 From: Helin Zhang <helin.zhang@intel.com> To: dev@dpdk.org Date: Wed, 10 Dec 2014 10:38:19 +0800 Message-Id: <1418179099-4822-1-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [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 <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Zhang, Helin
Dec. 10, 2014, 2:38 a.m. UTC
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 <helin.zhang@intel.com>
---
lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 4 ++++
1 file changed, 4 insertions(+)
Comments
Here is my patch for it, and it also resolves issue of pci_num_vf() definition. And I will send V3 for a while. 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 <helin.zhang@intel.com> > --- > 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 = container_of(dev, struct pci_dev, dev); > > +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) > if (0 != strict_strtoul(buf, 0, &max_vfs)) > +#else > + if (0 != kstrtoul(buf, 0, &max_vfs)) > +#endif > return -EINVAL; > > if (0 == max_vfs)
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 kstrtoul > or strict_strtoul > > Here is my patch for it, and it also resolves issue of pci_num_vf() definition. > > And I will send V3 for a while. > > > 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 <helin.zhang@intel.com> > > --- > > 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 = container_of(dev, struct pci_dev, dev); > > > > +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) > > if (0 != strict_strtoul(buf, 0, &max_vfs)) > > +#else > > + if (0 != kstrtoul(buf, 0, &max_vfs)) #endif > > return -EINVAL; > > > > if (0 == max_vfs)
On 12/10/2014 11:02 AM, Zhang, Helin wrote: > Hi Jincheng > > Did you attach anything? I can see the text only. > Could you forward your patch mail to me directly? Thanks a lot! Hi Helin, I indeed ever saw one patch that was similar this one :) but not sure if it is post by Jincheng. You can go through patchwork to have a look. Thanks, Michael > 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 kstrtoul >> or strict_strtoul >> >> Here is my patch for it, and it also resolves issue of pci_num_vf() definition. >> >> And I will send V3 for a while. >> >> >> 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 <helin.zhang@intel.com> >>> --- >>> 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 = container_of(dev, struct pci_dev, dev); >>> >>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) >>> if (0 != strict_strtoul(buf, 0, &max_vfs)) >>> +#else >>> + if (0 != kstrtoul(buf, 0, &max_vfs)) #endif >>> return -EINVAL; >>> >>> if (0 == max_vfs) >
Hi Jincheng I have seen your v3 patch, and ack-ed it. I just dropped my patch for the same issue. Thank you so much! 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 kstrtoul > or strict_strtoul > > Here is my patch for it, and it also resolves issue of pci_num_vf() definition. > > And I will send V3 for a while. > > > 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 <helin.zhang@intel.com> > > --- > > 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 = container_of(dev, struct pci_dev, dev); > > > > +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) > > if (0 != strict_strtoul(buf, 0, &max_vfs)) > > +#else > > + if (0 != kstrtoul(buf, 0, &max_vfs)) #endif > > return -EINVAL; > > > > if (0 == max_vfs)
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 = container_of(dev, struct pci_dev, dev); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) if (0 != strict_strtoul(buf, 0, &max_vfs)) +#else + if (0 != kstrtoul(buf, 0, &max_vfs)) +#endif return -EINVAL; if (0 == max_vfs)