From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 355453F9 for ; Wed, 10 Dec 2014 03:57:06 +0100 (CET) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBA2v5Rr005270 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 Dec 2014 21:57:05 -0500 Received: from dhcp-66-71-51.eng.nay.redhat.com (dhcp-66-71-51.eng.nay.redhat.com [10.66.71.51] (may be forged)) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBA2v37I010023; Tue, 9 Dec 2014 21:57:04 -0500 Message-ID: <5487B601.20305@redhat.com> Date: Wed, 10 Dec 2014 10:54:57 +0800 From: Jincheng Miao User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Helin Zhang , dev@dpdk.org References: <1418179099-4822-1-git-send-email-helin.zhang@intel.com> In-Reply-To: <1418179099-4822-1-git-send-email-helin.zhang@intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 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 02:57:06 -0000 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 > --- > 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)