From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: DPDK drivers should not use kernel version Date: Fri, 23 Jun 2017 10:55:22 -0700 Message-ID: <20170623105522.0cd95de1@xeon-e3> References: <20170621092843.72606c72@xeon-e3> <4376741f-cece-8086-eddb-c35ee9ef06a4@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Shahaf Shuler , Pascal Mazon , To: Hemant Agrawal Return-path: Received: from mail-pf0-f172.google.com (mail-pf0-f172.google.com [209.85.192.172]) by dpdk.org (Postfix) with ESMTP id 4597AF94 for ; Fri, 23 Jun 2017 19:55:25 +0200 (CEST) Received: by mail-pf0-f172.google.com with SMTP id c73so26609562pfk.2 for ; Fri, 23 Jun 2017 10:55:25 -0700 (PDT) In-Reply-To: <4376741f-cece-8086-eddb-c35ee9ef06a4@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 23 Jun 2017 13:03:55 +0530 Hemant Agrawal wrote: > On 6/21/2017 9:58 PM, Stephen Hemminger wrote: > > Looking at some other issues, I noticed that both the TAP and MLX5 device > > drivers are looking at kernel version through uname. Although this may > > seem like a good way to deal with kernel API changes, it is not reliable. > > > > Enterprise kernel distro vendors never change kernel version but do backport > > features from later kernels. Therefore the behavior expected may change > > even though kernel version doesn't change. Also kernel version does not > > dictate that the expected feature (like flower) is in the kernel configuration. > > > > I recommend this be looked for in all future submissions. Maybe even flagged > > as error in DPDK version of checkpatch. > > what is the alternative than? > > There are many legitimate cases, where userspace code need to make > decision on the basis underlying kernel version. > > In some cases, user space code can add error handling and fallback, but > it is not possible in all cases. Userspace code should test for the specific feature it wants. I.e is the flow qdisc available. Then report missing feature as error if necessary.