From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D40E2C45A for ; Thu, 28 Jan 2016 14:50:43 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 28 Jan 2016 05:50:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,358,1449561600"; d="scan'208";a="891062194" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 28 Jan 2016 05:50:39 -0800 Received: from sivlogin002.ir.intel.com (sivlogin002.ir.intel.com [10.237.217.37]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u0SDoclQ007976; Thu, 28 Jan 2016 13:50:38 GMT Received: from sivlogin002.ir.intel.com (localhost [127.0.0.1]) by sivlogin002.ir.intel.com with ESMTP id u0SDoc9Y026395; Thu, 28 Jan 2016 13:50:38 GMT Received: (from fyigit@localhost) by sivlogin002.ir.intel.com with œ id u0SDocA6026390; Thu, 28 Jan 2016 13:50:38 GMT X-Authentication-Warning: sivlogin002.ir.intel.com: fyigit set sender to ferruh.yigit@intel.com using -f Date: Thu, 28 Jan 2016 13:50:38 +0000 From: Ferruh Yigit To: Remy Horton Message-ID: <20160128135038.GA24660@sivlogin002.ir.intel.com> Mail-Followup-To: Remy Horton , dev@dpdk.org References: <1453911849-16562-1-git-send-email-ferruh.yigit@intel.com> <1453911849-16562-2-git-send-email-ferruh.yigit@intel.com> <56A9E43D.5000105@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56A9E43D.5000105@intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) 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: Thu, 28 Jan 2016 13:50:44 -0000 On Thu, Jan 28, 2016 at 09:49:49AM +0000, Remy Horton wrote: > Comments inline > > ..Remy > > > On 27/01/2016 16:24, Ferruh Yigit wrote: > > This kernel module is based on KNI module, but this one is stripped > > version of it and only for control messages, no data transfer > > functionality provided. > > > > This Linux kernel module helps userspace application create virtual > > interfaces and when a control command issued into that virtual > > interface, module pushes the command to the userspace and gets the > > response back for the caller application. > > > > Signed-off-by: Ferruh Yigit > > --- > > > > + net_dev = alloc_netdev(sizeof(struct kcp_dev), name, > > +#ifdef NET_NAME_UNKNOWN > > + NET_NAME_UNKNOWN, > > +#endif > > + kcp_net_init); > > Something doesn't feel quite right here. In cases where NET_NAME_UNKNOWN is > undefined, is the signature for alloc_netdev different? > Yes, this is because of API change between kernel versions, when NET_NAME_* introduced, alloc_netdev() also updated to have this. > > > +MODULE_LICENSE("Dual BSD/GPL"); > > +MODULE_AUTHOR("Intel Corporation"); > > +MODULE_DESCRIPTION("Kernel Module for managing kcp devices"); > > I'm not up to speed on this area, but some of the file headers only mention > GPL/LGPL. This correct? > This is because a header file (rte_kcp_common.h) shared by this kernel module and user-space application is dual licensed (BSD + GPL) I mimicked this from exiting KNI. > > > + nlmsg_unicast(nl_sock, skb, pid); > > + KCP_DBG("Sent cmd:%d port:%d\n", cmd_id, port_id); > > + > > + /*nlmsg_free(skb);*/ > > + > > + return 0; > > +} > > Oops.. :) > Possible memory leak, or is *skb statically allocated? > No leak, not statically allocated, but taken care by nlmsg_unicast() But commented code needs to be removed. Thanks, ferruh