* [PATCH] igb_uio: kernel version check for using kstrtoul or strict_strtoul
@ 2014-12-10 2:38 Helin Zhang
[not found] ` <1418179099-4822-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Helin Zhang @ 2014-12-10 2:38 UTC (permalink / raw)
To: dev-VfR2kkLFssw
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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
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)
--
1.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <1418179099-4822-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] igb_uio: kernel version check for using kstrtoul or strict_strtoul [not found] ` <1418179099-4822-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> @ 2014-12-10 2:54 ` Jincheng Miao [not found] ` <5487B601.20305-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Jincheng Miao @ 2014-12-10 2:54 UTC (permalink / raw) To: Helin Zhang, dev-VfR2kkLFssw 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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > --- > 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) ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <5487B601.20305-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] igb_uio: kernel version check for using kstrtoul or strict_strtoul [not found] ` <5487B601.20305-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2014-12-10 3:01 ` Zhang, Helin 2014-12-10 3:37 ` Qiu, Michael 2014-12-10 4:00 ` Zhang, Helin 1 sibling, 1 reply; 5+ messages in thread From: Zhang, Helin @ 2014-12-10 3:01 UTC (permalink / raw) To: Jincheng Miao, dev-VfR2kkLFssw@public.gmane.org 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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org] > Sent: Wednesday, December 10, 2014 10:55 AM > To: Zhang, Helin; dev-VfR2kkLFssw@public.gmane.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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > --- > > 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) ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] igb_uio: kernel version check for using kstrtoul or strict_strtoul 2014-12-10 3:01 ` Zhang, Helin @ 2014-12-10 3:37 ` Qiu, Michael 0 siblings, 0 replies; 5+ messages in thread From: Qiu, Michael @ 2014-12-10 3:37 UTC (permalink / raw) To: Zhang, Helin, Jincheng Miao, dev-VfR2kkLFssw@public.gmane.org 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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org] >> Sent: Wednesday, December 10, 2014 10:55 AM >> To: Zhang, Helin; dev-VfR2kkLFssw@public.gmane.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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> >>> --- >>> 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) > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] igb_uio: kernel version check for using kstrtoul or strict_strtoul [not found] ` <5487B601.20305-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 2014-12-10 3:01 ` Zhang, Helin @ 2014-12-10 4:00 ` Zhang, Helin 1 sibling, 0 replies; 5+ messages in thread From: Zhang, Helin @ 2014-12-10 4:00 UTC (permalink / raw) To: Jincheng Miao, dev-VfR2kkLFssw@public.gmane.org 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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org] > Sent: Wednesday, December 10, 2014 10:55 AM > To: Zhang, Helin; dev-VfR2kkLFssw@public.gmane.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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > --- > > 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) ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-12-10 4:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-10 2:38 [PATCH] igb_uio: kernel version check for using kstrtoul or strict_strtoul Helin Zhang
[not found] ` <1418179099-4822-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-12-10 2:54 ` Jincheng Miao
[not found] ` <5487B601.20305-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-12-10 3:01 ` Zhang, Helin
2014-12-10 3:37 ` Qiu, Michael
2014-12-10 4:00 ` Zhang, Helin
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.