From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 1/3] kcp: add kernel control path kernel module Date: Mon, 29 Feb 2016 12:11:58 -0800 Message-ID: <20160229121158.3ff29ff8@xeon-e3> References: <1453911849-16562-1-git-send-email-ferruh.yigit@intel.com> <1453911849-16562-2-git-send-email-ferruh.yigit@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Ferruh Yigit Return-path: Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by dpdk.org (Postfix) with ESMTP id EDEF07F50 for ; Mon, 29 Feb 2016 21:11:46 +0100 (CET) Received: by mail-pa0-f50.google.com with SMTP id yy13so97442709pab.3 for ; Mon, 29 Feb 2016 12:11:46 -0800 (PST) In-Reply-To: <1453911849-16562-2-git-send-email-ferruh.yigit@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 27 Jan 2016 16:24:07 +0000 Ferruh Yigit wrote: > +static int > +kcp_ioctl_release(unsigned int ioctl_num, unsigned long ioctl_param) > +{ > + int ret = -EINVAL; > + struct kcp_dev *dev; > + struct kcp_dev *n; > + char name[RTE_KCP_NAMESIZE]; > + unsigned int instance = ioctl_param; > + > + snprintf(name, RTE_KCP_NAMESIZE, "dpdk%u", instance); > + > + down_write(&kcp_list_lock); Some observations about how acceptable this will to upstream kernel developers. ioctl's are the lease favored form of API. You chose the worst possible mutual exclusion read/write semaphores. Read/write is slower than simpler primtives, and semaphores were replaced for almost all usage models by mutexes (about 4 years ago). Looks like you copied the out of date kernel API's used by KNI.