From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0046.outbound.protection.outlook.com [104.47.42.46]) by dpdk.org (Postfix) with ESMTP id DE7E08DA2 for ; Sat, 11 Feb 2017 07:38:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=+RpYQ/GhjnhEVHliisa0J0HnQi7NPF2+C8nPIJvmsW0=; b=g+/U+nkbS6d/bDHtIOZsq1IdCpnXrMYHOSDNBimskLrKNzoaETtm4GlCkzQMjLGUMJcXLyRXdblapFeJ5pCmFm2CsGSfRea7JKx/wB+kB4El1L9N3WIHsLcQn8RQSFWH4ibard2RGL7QRsktbAuXRCpIVm+518RoWlL3hkG1YkM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (122.167.42.129) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Sat, 11 Feb 2017 06:38:51 +0000 Date: Sat, 11 Feb 2017 12:08:34 +0530 From: Jerin Jacob To: Cristian Dumitrescu Cc: dev@dpdk.org, thomas.monjalon@6wind.com, hemant.agrawal@nxp.com Message-ID: <20170211063833.GB9218@localhost.localdomain> References: <1486735550-149878-1-git-send-email-cristian.dumitrescu@intel.com> <1486735550-149878-2-git-send-email-cristian.dumitrescu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1486735550-149878-2-git-send-email-cristian.dumitrescu@intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [122.167.42.129] X-ClientProxiedBy: MA1PR01CA0065.INDPRD01.PROD.OUTLOOK.COM (10.164.116.165) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-Office365-Filtering-Correlation-Id: f430e699-47ec-4d2b-3ed7-08d45248a562 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:eWesIcfK2irjue9wPF1tcRdPwXujyfUdKmMllh44aucPQxoD1atBeg65Rpl4NDQkrbeDWLfJnvvhmyihsZCmBp+xiH4YNLiu/qrsIq37dwHiRkiovC16n792ntALZcYTDtJ6AcKZb3gDH1j2VZLc50h1ysjJYdnv/22pByhnlc0fEw7xO51VmxC5JVxwxBwqpI/B1GKbvgEgZMeW2VmI6faLkL4h5quEdVdO9myngngcJZKpoqJAykXgcawnocIwh2OW6hRJKZfXKb+dUPHw4Q==; 25:5ODj3b9Y/6PtywOhC5vReNUWpfQtwklUeAhZ7BUSOuUJeZSDeVez/CDvEaebVdiYv58MbkFB4M/bG6GxixhrD4j4kCIgEV8AtfA/9TDWyOgJD8CDNFxiky5D/DJiuL1IiUb7JeQ+RlTAQU906FfnC6S0r+hCEmV3JnSqud8pS3PrSFXUq/qXU1olsnYUW7eoqvTm5XSe7Ety+2AD+TCISLAmmNgM6sEBT7CChM0hceqQxrnMxCrNj+L8p3zZSq6LrryvrxUCuuXewx/2FfUrsIinSS4ivCJx8gb541Crn6buuXIvohNxGXuQVP4DL35C2G8KivDgjXwlknbcBOFRQVV/NOAZaPpCKPd/2loZG/zBQgcyCralW2A5iRyfLwvDg7N+9dDBKAIFtYvmaLuXnKE1RRu5PQiCNChF8b/U/4kQlRw5X2oJkKzstFrzQ5jy8Dr5KsLmrhDXROmWv/XktQ== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:F3DRDn4mZAxFUk+QRKCqnE2Okxm1KQuW+TWWaFsHi/wIGXR0Kur6NyV6kYt3maXgd4Ob2p1UP9sD3WUSH5tFhkr6XpH8a4nbX8Y1uhF4NE/67jbobiKJIlf7TOZ9jr66IUFUljb6aDBjozw5zgk2+jfzYrJgTVNnHT2Sfk7PCEc0fStmHlTR2cXp8CoACe3CXlb0ao5RG3j1mqiXECJQ0I+7t9McK/hHSl477+quqHXdqy81MZslfnXNlFrjHuEUza633bFDuD/uenNvJuGMkQ5UqGXURadMNwZTsn4grtA=; 20:14V1yg4a5PFlnKF0Usw4Nm8oheZAgpCR6k4/ku0wDJkmLgVcF+e+rBoXaZdeCJnJTGPmD09DVpKmwpnF7KkW8uAKKuAhob490BaLdjPmVFleEzlEtTz+flTD5UtHsIRP45mjb0iKPRKuvjRDOHpW9K4EVs4ZOxGC+DxQ2FX4mAKTrdriOBc4eRe4Bo8Tt5Ugw2UtpbBPX1vL5VdHkhzpCXksbRFMOJy0okD6tj8tjep3nnPTRXZAhg5nJyVWgwe2h9eRJoCWBGues+femJkdpuM6WiRou5PMDz3IQ4ldUk4ztAL8hch2iDMiuzNNU7Lm0O2oUtI0LZY/DxN1cODwwLMolFIfGETwWbeONkRpVi9+S5umPUjJ+3bht5xVvvg9rpDV4+YL0tXqyVEuno+RhLjoeuwqIBGgENf0SyTiYY3GQEywBXTapgYg5duf5BuMVCLRYdYotfcIXDVoofSgM7sUGSZ8A7Y6MXFoGs3hveZwuCKeDP9cT/l2O3jAz/aqkNnbquOTEUhmtfpj/g8QHVxRickkTu2yOYLsTNMJPtkRDazE3aiy/zJ6zI/wKQdUFwGJLLLGTCmaQKFdp6GP4hskQ6IdTXWC0XVREME4FO4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123558025)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:5vfzyr9JnewYNN31rBLb357+qUNNmlXX1R49qa5/7wck6+tqOOEQA4kFeda1lZ308u95mapu2CSET1+0kpJNPauPnUZfGfCMov93Rd66jxc4dhmFtNNQsRRHHpcMEZgbpA3jdjYB7BRdsZpjTfQwAPwapVu0piCdaK6gi3kic5R3/myQfiM+Big4iDkNuuqETL2Lks6RC/LTmystYHTfSg308/ADfkr0oN+IKo2FW4YRxHy55yWjgWAFC0d9mc456w0xZOg+NpxsiiYFHlZkh1AOETWmx6i2iAY4k8+2L5d2jLsKgeIRlO0KIF4YoB+02vJbu07pcutKDd2HCitlP0+kWYa8a9JruUKgVYZy1kr4fLNT8ezASLBgDTYZFgOcJY8G4ZIUmLBg1+eaLZalViNz81SwPMuAYZ9vQJ3u+VjFyOHZYE1NwB9ksWy5jvq531xQVkyJF3p3uiA/rQkJbRRfTFroYXfNp4f7lC+Ss22dklmYodK7X6WVcZ+2LBMLFkEI5R+23lD9VnXr1FOpFw+GASVXwlBFinQLYfYJI1ZvNKg5U3lLHh5/jvHvUJ8l/VgnUuVe/z1J6X3L8qDALjt31bAOWQP4XvpTGvPlT3OaVRklDzsoAMvWaFyhepD5B/WOhOImkuEu+S4K2Globw== X-Forefront-PRVS: 0215D7173F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(189002)(24454002)(199003)(68736007)(105586002)(25786008)(50466002)(55016002)(9686003)(1076002)(42186005)(61506002)(8656002)(23726003)(3846002)(53936002)(106356001)(229853002)(6116002)(7736002)(2906002)(305945005)(5660300001)(81166006)(81156014)(8676002)(76176999)(38730400002)(575784001)(54356999)(110136004)(50986999)(97736004)(42882006)(6666003)(83506001)(2950100002)(6246003)(189998001)(33656002)(66066001)(101416001)(4001350100001)(47776003)(92566002)(6506006)(6916009)(7099028)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 23:NVRKuDr75IoKnHK68wUuxS53AmJ+UPfts8QvhaW?= =?us-ascii?Q?En7bHwJyQx8ikZpQyUsVhJpBOumIfwTBwkPbYbW5ssHvXtW8oKukx+wT67/X?= =?us-ascii?Q?e2J9mRIx+6cw3WmXjYjJyOQSZRL8vgKHTXDD7+YM/dN9ypB4JyQfTOiieFLl?= =?us-ascii?Q?WUuKrxD97wJw9mJz6DKmK5BQFU6A7kII4HgqJKhaAqpIele/gcuoR74ySosQ?= =?us-ascii?Q?BBz6cZWiKiIganvVyQ/4DjQUhlbpnaJviEoi7U+NBABwXUDsmv0MSkUdtog7?= =?us-ascii?Q?FIYFWucmSWpuL3JnfEvoIYf396i1mE5B2H+2fWMkahHPXov92QDdQi0OlQsS?= =?us-ascii?Q?DANRLtH9dnbFau9F1Kzw0mJ9k1j5LutU7D4kjFq98Gk0Ggz6nFSwsP3mfeqs?= =?us-ascii?Q?5OA7Ue63PTiHUSwdmBIrunH9OPzpdfvYDujGhLQznX8IUYPPIeo3G1lsHm6h?= =?us-ascii?Q?ReVWHRuu7Zr/M7Hx+Wkcag/+cQs812Oo0vZydS3jrQpkJAdjHGC9rAZPzgbu?= =?us-ascii?Q?iWC/Q0vJFSQRlRuS6tUAnoT+IkEWDGqhUUe19yen0GVsy45/+7fmp47Q4ehg?= =?us-ascii?Q?4WTYfCzsMH27QXSJpImNRC7Ye3oYVA+uCt6T1Qi/H0ZRb/W3/WGMAM+sbIlK?= =?us-ascii?Q?C5Bh5ADOAMlwK+JYvl0hNaBvYyTxuFdxKdv0PSI4uWczVJ6ReZSIa/rXHvZm?= =?us-ascii?Q?eSgTon9W+Ckdz5QVOetPBxWDdD/3GcaolmQgez48m+NiIcGa60+8jzS6uFpy?= =?us-ascii?Q?RmrYjTwChlF2CHMKnXAR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oZZDP6dlzbK/MJvDM7BIxSreaKYw==; 5:4akHzcksVIu/6JMguBntRajka7yMKJ+0wVV8IkODShpER1bFz3e4Y2k14lo6JNPTFWshZ7RFpzCbYNoQ7p5wz8ngWmhzDHhXn1xV/wc8pONIkt7StF6YHUYfTs2osBfMuvefK7RDkPAN4eM6uc+aFw==; 24:1gecvEIQhyRlAJj+Zx9Hz0YR4CgkF/BUFEVGl7jXog1r7EwWFEuDYBOT1umEWwwevLwe3mysb63cfU/8b7yYaS6XItOzSSzIUW/8IyIQMMQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:n4B98/+Rf6AlhpqhNLaakoVcxRrBtraeJSmBalwqPkdr/ZJJOE/wm4GoG91IVWsRaBVd9hikpjBQ2W2trF3WOaxSlmkDY9MfuSxuIi2YGoiZu0tt0srZ2yrE5G57X7T7g4t+1dInQ8hvBwypmKkmx+5awSEJJX4X3yB2BPBM8dndKKGNFQ44Os5skZr9vkJuuOgfmBSoES6oaGqc9EaSsl13JDslyz14MohS9DW9Am+UYrFVBxHQra76SreeZk9hSgHlXckkxF3TsYZJuLJt1ufd5Be6IkaFWMl66DgKu65jdEvKzmjjXMUTsIX5IMfJ1Yhcg7VmNlPijF6NDOMKoWOMy+L63TMsABsX8M/u/iiK0BIIH9SSlYwZSs63tq0G9F3UY87K1u/JTDDI6Q9l9tTMZoWfbHAMP9uEWaX4BfgJVW4h0drM6rvyx/4jjyezTC26UWzGxmMtSa413vLzuJNugx329xj8wvxRvj4qqTAwAVHTEUbAEoFde/4SYjSnlY28n6ZVN1iUVsKV2twgCA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2017 06:38:51.3448 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: Re: [dpdk-dev] [PATCH 1/2] ethdev: add capability control API 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: Sat, 11 Feb 2017 06:38:56 -0000 On Fri, Feb 10, 2017 at 02:05:49PM +0000, Cristian Dumitrescu wrote: > The rte_flow feature breaks the current monolithic approach for ethdev and > introduces the new generic flow API to ethdev using a plugin-like approach. > > Basically, the rte_flow API is still logically part of ethdev: > - It extends the ethdev functionality: rte_flow is a new feature/capability > of ethdev; > - all its functions work on an Ethernet device: the first parameter of the > rte_flow functions is Ethernet device port ID. > > At the same time, the rte_flow API is a sort of capability plugin for ethdev: > - the rte_flow API functions have their own name space: they are called > rte_flow_operationXYZ() as opposed to rte_eth_dev_flow_operationXYZ()); > - the rte_flow API functions are placed in separate files in the same > librte_ether folder as opposed to rte_ethdev.[hc]. > > The way it works is by using the existing ethdev API function > rte_eth_dev_filter_ctrl() to query the current Ethernet device port ID for the > support of the rte_flow capability and return the pointer to the > rte_flow operations when supported and NULL otherwise: > > struct rte_flow_ops *eth_flow_ops; > int rte = rte_eth_dev_filter_ctrl(eth_port_id, > RTE_ETH_FILTER_GENERIC, RTE_ETH_FILTER_GET, ð_flow_ops); > > Unfortunately, the rte_flow opportunistically uses the rte_eth_dev_filter_ctrl() > API function, which is applicable just to RX-side filters as opposed to > introducing a mechanism that could be used by any capability in a generic way. > > This is the gap that addressed by the current patch. This mechanism is intended > to be used to introduce new capabilities into ethdev in a modular plugin-like > approach, such as hierarchical scheduler. Over time, if agreed, it can also be > used for exposing the existing Ethernet device capabilities in a modular way, > such as: xstats, filters, multicast, mirroring, tunnels, time stamping, eeprom, > bypass, etc. > > Signed-off-by: Cristian Dumitrescu > --- > lib/librte_ether/rte_ethdev.c | 13 +++++++++++++ > lib/librte_ether/rte_ethdev.h | 29 +++++++++++++++++++++++++++++ > lib/librte_ether/rte_ether_version.map | 7 +++++++ > 3 files changed, 49 insertions(+) > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index eb0a94a..ae187c4 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -2802,6 +2802,19 @@ rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, > return (*dev->dev_ops->filter_ctrl)(dev, filter_type, filter_op, arg); > } > > +int > +rte_eth_dev_capability_control(uint8_t port_id, enum rte_eth_capability cap, > + void *arg) > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + > + dev = &rte_eth_devices[port_id]; > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->cap_ctrl, -ENOTSUP); > + return (*dev->dev_ops->cap_ctrl)(dev, cap, arg); > +} > + > void * > rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, > rte_rx_callback_fn fn, void *user_param) > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index c17bbda..43ffb9e 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -1073,6 +1073,12 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback); > * structure associated with an Ethernet device. > */ > > +enum rte_eth_capability { > + RTE_ETH_CAPABILITY_FLOW = 0, /**< Flow */ > + RTE_ETH_CAPABILITY_SCHED, /**< Hierarchical Scheduler */ > + RTE_ETH_CAPABILITY_MAX > +}; Shouldn't it be the FLAG?. Meaning, To represent ethdev port can have both. > +