From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 4206A11D4 for ; Thu, 3 Aug 2017 14:21:38 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP; 03 Aug 2017 05:21:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,315,1498546800"; d="scan'208";a="134967278" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by fmsmga005.fm.intel.com with ESMTP; 03 Aug 2017 05:21:36 -0700 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.236]) by IRSMSX102.ger.corp.intel.com ([169.254.2.211]) with mapi id 14.03.0319.002; Thu, 3 Aug 2017 13:21:36 +0100 From: "Chilikin, Andrey" To: "dev@dpdk.org" CC: "Richardson, Bruce" , "Ananyev, Konstantin" , "Wu, Jingjing" Thread-Topic: [RFC] ethdev: add ioctl-like API to control device specific features Thread-Index: AdMMUkb0+6rZdn91TFOM0eBbJSgGcA== Date: Thu, 3 Aug 2017 12:21:35 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [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 12:21:39 -0000 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