From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ferruh.yigit@intel.com>
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 by dpdk.org (Postfix) with ESMTP id 106F92BA9
 for <dev@dpdk.org>; Tue,  1 Mar 2016 01:35:05 +0100 (CET)
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by fmsmga101.fm.intel.com with ESMTP; 29 Feb 2016 16:35:06 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.22,521,1449561600"; d="scan'208";a="923853744"
Received: from mkursul1-mobl1.ger.corp.intel.com (HELO [10.252.19.102])
 ([10.252.19.102])
 by orsmga002.jf.intel.com with ESMTP; 29 Feb 2016 16:35:04 -0800
To: Stephen Hemminger <stephen@networkplumber.org>
References: <1453911849-16562-1-git-send-email-ferruh.yigit@intel.com>
 <1453911849-16562-2-git-send-email-ferruh.yigit@intel.com>
 <20160229121158.3ff29ff8@xeon-e3>
From: Ferruh Yigit <ferruh.yigit@intel.com>
X-Enigmail-Draft-Status: N1110
Message-ID: <56D4E3B7.8050102@intel.com>
Date: Tue, 1 Mar 2016 00:35:03 +0000
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.5.0
MIME-Version: 1.0
In-Reply-To: <20160229121158.3ff29ff8@xeon-e3>
Content-Type: text/plain; charset=windows-1252
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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 01 Mar 2016 00:35:06 -0000

On 2/29/2016 8:11 PM, Stephen Hemminger wrote:
> On Wed, 27 Jan 2016 16:24:07 +0000
> Ferruh Yigit <ferruh.yigit@intel.com> 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.
>
This is from v1 of patch, v3 is out and it removed ioctl, replacing it
with rtnetlink.

v3:
http://dpdk.org/dev/patchwork/patch/10872/


> 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.
> 
But still using same locks, and as you have guessed these are from
legacy code. I will replace them with newer, faster lock APIs happily.

If only problem is using slow lock APIs, it seems code is in pretty good
shape J Please check the v3, it is in better shape now. With more review
from reviewers and after a few more versions, we can have something
upstreamable.

Thanks,
ferruh