From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 05C122BDF for ; Tue, 27 Feb 2018 07:17:53 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2018 22:17:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,398,1515484800"; d="scan'208";a="30932494" Received: from jguo15x-mobl3.ccr.corp.intel.com (HELO [10.67.68.71]) ([10.67.68.71]) by orsmga003.jf.intel.com with ESMTP; 26 Feb 2018 22:17:51 -0800 To: Ferruh Yigit , Thomas Monjalon References: <1517306475-2153-1-git-send-email-jia.guo@intel.com> <10497764.pzdNBqvViL@xps> <899b1116-cf19-249e-cc55-8993ef7729e6@intel.com> <9fe2f93c-16e5-a119-a455-fc21ed80bf87@intel.com> Cc: dev@dpdk.org, jingjing.wu@intel.com, jianfeng.tan@intel.com From: "Guo, Jia" Message-ID: Date: Tue, 27 Feb 2018 14:17:50 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <9fe2f93c-16e5-a119-a455-fc21ed80bf87@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] igb_uio: fix uevent montior issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 06:17:54 -0000 On 2/13/2018 5:32 PM, Ferruh Yigit wrote: > On 2/12/2018 8:28 AM, Guo, Jia wrote: >> >> On 2/9/2018 6:01 AM, Thomas Monjalon wrote: >>> 30/01/2018 11:01, Jeff Guo: >>>> udev could not detect remove and add event of device when hotplug in >>>> and out devices, that related with the fix about using pointer of >>>> rte_uio_pci_dev as dev_id instead of uio_device for irq device handler, >>>> that would result igb uio irq failure when kernel version after than 3.17. >>>> so this patch correct it by use kernel version check before handle the >>>> pci interrupt. >>>> >>>> Fixes: 6b9ed026a870 ("igb_uio: fix build with kernel <= 3.17") >>>> Signed-off-by: Jeff Guo >>>> --- >>>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) >>>> struct rte_uio_pci_dev *udev = (struct rte_uio_pci_dev *)dev_id; >>>> struct uio_info *info = &udev->info; >>>> - >>>> +#else >>>> + struct uio_device *idev = (struct uio_device *)dev_id; >>>> + struct uio_info *info = idev->info; >>>> + struct rte_uio_pci_dev *udev = info->priv; >>>> +#endif >>> Can we avoid checking Linux version number? >>> This method won't work with kernel backports. >> i don't think that is a bug rather than a kernel feature parameter >> change , so i am not sure if it will definitely a chance exist for the >> kernel backport fix for that. > Hi Jeff, > > What we tend to do is add version check to compat.h and define a feature based > on that check and use feature define in .c . This makes .c file more readable > and if in the future we need to add more check because of backported kernels > (mostly we need to do) that checks all goes into compat.h and .c file remains clean. > > Thanks, > ferruh make sense, let me check the compat.h file and use it in this case.