From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9BXw+hITNXZAgGZWk3XaHi9poSLQt9/FPZgOODKSHeU=; b=f1mn08PdIFSt6pSYgH4Y26W17CvZRSZbOyCo5MN1Dc5u8mQm4OM5IvvqLLeIiUNVxI 2Ao62W1i+RwCTNQHjFYZyTdmUiDCPqxYZPmlUJLWR6lEqVzhX7yXgsfhvAp4t1/h8SJB Ut2yuYOBJKb+g3HTx8ajgWXZ75DCeG3hm1ISsai0OfnZpHfgzm7/+biMtqyv1c+AkHru PlpV3TGcntT0S2iJ7xNjMRAgkcSKkNZpyWD1AXOTT1rxcvMg7q8D8cN37zWrX9Lh7hOZ /BlnuADCXwoAuFTefbZNeURI6tb+JToh5zdQ1QxWBh/lEmOwJQoafQ3QC9yxlXHax944 vWgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9BXw+hITNXZAgGZWk3XaHi9poSLQt9/FPZgOODKSHeU=; b=d6BHP5Pwqmf4CV2tizfdta/yf4RjwvC5Kkg4BQ9OGzzMkgarIV7r0wIF3rZFMRZxgi 75J0nbGb+R6eOmUSnI+TipKQEL3+BwVtwYj7A3l30Zlo+nidW6e5XY3Mp57IJ3QGQKaM IrrEEImjhzXYiURse6t0uY3heYahJHnhWMVasyNnCR4wR4hHV0zAOaoH3fhmr4ZItIe7 6LWm/PEMgW5VlKstYbd3uIQSKC7scfC2VCLviUDB7K2BAuAK1BaoE9QDM8SNZSOgBEh1 eWmOCE09wqCQr0i4QPrs2gtYiKWO8Iy6OpKB7ENc2yf5PMXLGwPa6d5L1V0zmRIYzzjc EL3w== X-Gm-Message-State: AD7BkJIdPWhmgdPvgxcyQzJQcKI4T/OGHYz5ziEYH0V0UKf8KeGbSR16EgbuvRaSP/av1g== X-Received: by 10.66.187.36 with SMTP id fp4mr24815042pac.47.1456776706258; Mon, 29 Feb 2016 12:11:46 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id 16sm40043622pfk.28.2016.02.29.12.11.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Feb 2016 12:11:46 -0800 (PST) Date: Mon, 29 Feb 2016 12:11:58 -0800 From: Stephen Hemminger To: Ferruh Yigit Message-ID: <20160229121158.3ff29ff8@xeon-e3> In-Reply-To: <1453911849-16562-2-git-send-email-ferruh.yigit@intel.com> 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 Subject: Re: [dpdk-dev] [PATCH 1/3] kcp: add kernel control path kernel module 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: Mon, 29 Feb 2016 20:11:47 -0000 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.