From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 983BC324B for ; Thu, 3 Aug 2017 15:21:43 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2017 06:21:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,316,1498546800"; d="scan'208";a="133061961" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.72]) by orsmga005.jf.intel.com with SMTP; 03 Aug 2017 06:21:39 -0700 Received: by (sSMTP sendmail emulation); Thu, 03 Aug 2017 14:21:38 +0100 Date: Thu, 3 Aug 2017 14:21:38 +0100 From: Bruce Richardson To: "Chilikin, Andrey" Cc: "dev@dpdk.org" , "Ananyev, Konstantin" , "Wu, Jingjing" Message-ID: <20170803132138.GA8732@bricha3-MOBL3.ger.corp.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.8.3 (2017-05-23) Subject: Re: [dpdk-dev] [RFC] ethdev: add ioctl-like API to control device specific features X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 13:21:44 -0000 On Thu, Aug 03, 2017 at 01:21:35PM +0100, Chilikin, Andrey wrote: > To control some device-specific features public device-specific functions > rte_pmd_*.h are used. > > But this solution requires applications to distinguish devices at runtime > and, depending on the device type, call corresponding device-specific > functions even if functions' parameters are the same. > > IOCTL-like API can be added to ethdev instead of public device-specific > functions to address the following: > > * allow more usable support of features across a range of NIC from > one vendor, but not others > * allow features to be implemented by multiple NIC drivers without > relying on a critical mass to get the functionality in ethdev > * there are a large number of possible device specific functions, and > creating individual APIs for each one is not a good solution > * IOCTLs are a proven method for solving this problem in other areas, > i.e. OS kernels. > > Control requests for this API will be globally defined at ethdev level, so > an application will use single API call to control different devices from > one/multiple vendors. > > API call may look like as a classic ioctl with an extra parameter for > argument length for better sanity checks: > > int > rte_eth_dev_ioctl(uint16_t port, uint64_t ctl, void *argp, > unsigned arg_length); > > Regards, > Andrey I think we need to start putting in IOCTLs for ethdevs, much as I hate to admit it, since I dislike IOCTLs and other functions with opaque arguments! Having driver specific functions I don't think will scale well as each vendor tries to expose as much of their driver specific functionality as possible. One other additional example: I discovered just this week another issue with driver specific functions and testpmd, when I was working on the meson build rework. * With shared libraries, when we do "ninja install" we want our DPDK libs moved to e.g. /usr/local/lib, but the drivers moved to a separate driver folder, so that they can be automatically loaded from that single location by DPDK apps [== CONFIG_RTE_EAL_PMD_PATH]. * However, testpmd, as well as using the drivers as plugins, uses driver-specific functions, which means that it explicitly links against the pmd .so files. * Those driver .so files are not in with the other libraries, so ld.so does not find the pmd, and the installed testpmd fails to run due to missing library dependencies. * The workaround is to add the drivers path to the ld load path, but we should not require ld library path changes just to get DPDK apps to work. Using ioctls instead of driver-specific functions would solve this. My 2c. Regards, /Bruce PS: Following discussion on-list, this probably should be discussed at a tech board meeting, to close it out.