From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0053.outbound.protection.outlook.com [104.47.41.53]) by dpdk.org (Postfix) with ESMTP id 6567EFE5 for ; Wed, 22 Feb 2017 11:57:03 +0100 (CET) Received: from BN3PR0301CA0068.namprd03.prod.outlook.com (10.160.152.164) by DM2PR0301MB0736.namprd03.prod.outlook.com (10.160.97.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 22 Feb 2017 10:57:01 +0000 Received: from BY2FFO11OLC001.protection.gbl (2a01:111:f400:7c0c::165) by BN3PR0301CA0068.outlook.office365.com (2a01:111:e400:401e::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13 via Frontend Transport; Wed, 22 Feb 2017 10:57:01 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; caviumnetworks.com; dkim=none (message not signed) header.d=none;caviumnetworks.com; dmarc=fail action=none header.from=nxp.com;caviumnetworks.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11OLC001.mail.protection.outlook.com (10.1.15.185) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.919.10 via Frontend Transport; Wed, 22 Feb 2017 10:57:01 +0000 Received: from [127.0.0.1] ([10.232.133.65]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v1MAuteh007685; Wed, 22 Feb 2017 03:56:58 -0700 To: Jerin Jacob , Cristian Dumitrescu References: <1486735550-149878-1-git-send-email-cristian.dumitrescu@intel.com> <1486735550-149878-2-git-send-email-cristian.dumitrescu@intel.com> <20170221124541.GA4411@localhost.localdomain> CC: , From: Hemant Agrawal Message-ID: Date: Wed, 22 Feb 2017 16:26:54 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170221124541.GA4411@localhost.localdomain> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131322346213469657; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7916002)(39450400003)(39840400002)(39400400002)(39860400002)(39380400002)(39850400002)(39410400002)(2980300002)(1110001)(1109001)(339900001)(377454003)(199003)(24454002)(189002)(65806001)(6246003)(68736007)(2906002)(4326007)(189998001)(97736004)(6666003)(7246003)(81156014)(81166006)(83506001)(2950100002)(7126002)(4001350100001)(85426001)(65956001)(104016004)(356003)(65826007)(305945005)(54906002)(229853002)(53546006)(38730400002)(230700001)(47776003)(77096006)(53936002)(105606002)(76176999)(36756003)(5660300001)(54356999)(69596002)(8936002)(575784001)(50986999)(31696002)(86362001)(626004)(31686004)(92566002)(8676002)(33646002)(23746002)(106466001)(120886001)(64126003)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0736; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC001; 1:lkOcU31gHWQGaQv0KBPSZeUQAiD69rmoThiH0F9Daq40aY9NmQ4z5kOiWvr7nhKyM/DrIA15nWybefAGMoy69GmLHmcmXggdDhH2rGXxAYJLW1REls5KLuJA6RpC2Q+bYmWKGttsKKYxlS2v+Cytk2oY7ogU5wuD+29GrGXrq51/T24pH/NYaOJFtpVkV9svaQc8uMTVJgoPzUCVOm54qOOKi3sCHJn4R45N4SEXyNoT8HHFJWCyVbXjevMYx/9YV6Sx32BZudEbWV9+2qqijEYGei+3OBmIELZQ2iCJPhWAGAiZerrWYlRm19NdM7C2oLMpoyglIqyRRR3qGQGosOUY9IOoN9XUiCVnVPaNMuWz8YyjxR70Sj+as93D6zYiBR4oQVtQuf3AwWFkgDBnEV6fS+OjhijBqnK+8/cYLlpzv5U6qfPinRki3EYdVUFkyK5R6+Dh/X5WjTOwvoun4gIucYHjYGMX6KskbITQUvNJkC4cF2OSh4Q5YlGWNCzv1+RJtLoVNtzys92TurbOv70IsV7UjcbRXn9RgkampUFoMOlCqsXoxzouyRkvAgF5rsM5BICL8tzIn251lGf0qKTRg+i1TS9Cdw3TP5hHifI= X-MS-Office365-Filtering-Correlation-Id: fc3aea3a-7898-4b47-8c7b-08d45b118794 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR0301MB0736; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0736; 3:qmdt5JUj5dr2TC93BABzZw3Oi9xFrLN9iLdfdaL+7r/M2r/4XRRuvhkFrdN/fQjGy8Manhio6+Zeqyv9rjE2ScVX5H/HcKnc2zeMaMxhi5aabOryEYajUvOxaPoEigafjklt+3VMGNRo7/F6yR9v6yMhVaT9YTZB4Ryg9OfxIDpIdDCwVzwXik0cNoPB1Jke2KWLwxqibw8zUicXCOIdGJ811iGsvnr36QPMenbpEacJWILNC76Ov/ALhiMNrLb1lFB8LOvCTxWpccxQYGvX1/9zkj0lAVQ86T6hFwl05iCdxIL058e/7SSRQHq/3dD0qVRx76nztGhopBzvyuG7e2DM8JbLTIJhjECAzlrwDhbYHVxmmlqQ0gPxHwMUIN+w; 25:Lskwg7WPIsrBimpE4XlCWS+nYA8x6IA50Z0eGnR0AqPx2sjGCXicbDn1ODG+VbnD1Zwf1QGDOO3Kexpi38umqmyIVkaSe+9NVJDi3USZdnAECWQheC6d9zvE5qcM3/9zpSjfIY5xL6XcSNmftvm3W+Jvi0DswBKcqpHWek68SwOJ/JC2191X6/UN62vCMcCVdsFN9FzLG4KmiqfNv5dUboGrf1GYbDRUOD5GHUD9If6ybRFfFRPuU6H2GrJ0jX+y75PHAP3UM29rtaW4PL4AuvqYCERksyNiBRk0lxVQKb0Lsctxn4zuPYTaBLXcFPFDTp4CdR3E6ZZeXoUwx7iQv8ju+SmTw68AoQEcEDsM7uEx+gfBZqC86310X3EWy7pdkp592vfTrOPAPvlWTPPPDOrwrbFeS6x6ZH0mBMuVqMHAKKP3QRlQPWqaYLjDrWYbO40XRZxxHLt1B/DnVH734w== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0736; 31:yG5hUGc1+T6ILnHkac/lYvmQwYqN69U+V0pfkiDqVZkPGEkbES+o81W5kC79/ujIofBldSzC3BUCE3fMhMtj56RY6wgXBQkIfc5mqpJV6RxInmdWE1sns9aJHe4/6lAzA6rufIF/uYm3JwKydbB5c3jvrO6Eg3pxBKNxef5WNcoxKX57fvhFNW+NCNjncS6qP/F2kKMg3EWWnREIfmVY8VyoUjqacI1o1OAGYJn9a+dKePuH/AU53xq1F+tQL35SE15ltv94IeoLW4MPte8QtQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13015025)(5005006)(8121501046)(13017025)(13024025)(13018025)(13023025)(3002001)(10201501046)(6055026)(6096035)(20161123556025)(20161123565025)(20161123559025)(20161123561025)(20161123563025); SRVR:DM2PR0301MB0736; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0736; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0736; 4:4s86fTal6lW5w82daOlGbWa6fyFL57SoML4b1NjhOdo/YCOLqV4+k54cLaXWW8LfzhQ30DtRDWKeVP8xkc/0munVoQaNxSejM7YP+ubL7M2FJThjjeXJ8F0alzO/+GsmF62Re7t9uY0rsZkGXqo19pJjzTlWGPh8El1TqDr6Eglj672Yb0ymeZ9+EfZalEI6IBGyxld50BfxiYB2WqJ/QQgmqewfh/paTpWmRLwVCn41CMEqUlqlXKZMo9b6yAV7Mwtgjuf+xhit+PzKbTeZeHoGBtllCoJWp2pAcck2lHFLvmBVwz0DMiPVlmvfDqNpa5nKFLxiY0CqRQEALQphYodrO2JxOyAtMXtk/eY4BOs0MQYnOXPHNotUeyjoVm6GRAsxxS/a2W5dfLWrmmmq/kspOItM3HQ6UrxoF9RE72q6SqSWrpQWthXBUuCU/x6/DHxxTXLb6RHKSTz92jzE6pUhbnofUAUOh0Q2GjsUxazYfZcXQoe9PUvbfa7334T+wIBFi66PZ1LF2VBwDmdNVqYh1TjqD4L3VKUlbzFwppTqJh3u1fYfbCVUzoQfG4drFKlRLqruLGL36CENRsF7ym6FirJpXL0ewoYJmKspDP+rtdicv2lQl2nT5/Fq9qEuw8SJLhVOWfEImsVRZ2Qr3M2MXdbXMaQwiCZaNhgJsgQjmn5ymr2XymCRWgtpdZfik1ECmz7XGL3XObGWzUcx7c02kFsnw/KiB7ZHOzvwQDTF0EKeN6JoXJ3x0Gf54qKDUVXxwhvB4fkENCksYm+hHQ== X-Forefront-PRVS: 022649CC2C X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; DM2PR0301MB0736; 23:VUtO2zY4IWVIxAjMg2qjcBb9dxIujAAalxF?= =?Windows-1252?Q?WKoKRCNEfV4KRZ7WPYifFsA8h9dBG1E1qTGd19Sb4rRvwwNTWmR9Eoq3?= =?Windows-1252?Q?/Y+wYmEmq2zALz0Z1b4kVms9Ml1TorB8KRDv/TfXXmTVRnLmCHSe4rJ1?= =?Windows-1252?Q?fTs4VKst59lqhuZxofpGYz9HvJL3GpapJPo+D1tXwbPR6JR3KyM2FIIq?= =?Windows-1252?Q?uwMEOUo9IOlUFUq0+ekL9JacR1Ih+ZaCXE325/8phdcT0QkcIJqbUFQP?= =?Windows-1252?Q?2pOhqvTBZC93Yl9fI1AvqIHQ6G7J5PxogC09jRWovvnSWIqBP/uPn9IW?= =?Windows-1252?Q?03M1EfMkaA7Q23K8r566IAxuo3qAkcEWNhQpIgFy3Gm17Fn+ka4PEoVm?= =?Windows-1252?Q?Xo7ZKJzFhC9tjofAJDr3RdKwdqvntEjKjX4W2YV/F0YvpYteQEN2SzRI?= =?Windows-1252?Q?TyE5pvq2a5CRFwdEyO5uiNmDI3luOh3uxQhZO3JRFBQal41rsAi6QZRI?= =?Windows-1252?Q?VQ5cl0OSi4hfigkUKGc6X4/kzXo0NTi3k1vMv8GMk8a9hvQ2o7WBbzKD?= =?Windows-1252?Q?b1YaGroCd9JGnED/snQ0DHfSoQkEy2KElk3y1jgAxNNR2hh1iUGsSr/h?= =?Windows-1252?Q?KENFr5JFQzNoTnNCGc/rzy8ZA105YsXbRdR2f/EEIKNxz8JaDtfwVPPY?= =?Windows-1252?Q?YA1/WYCtWRYXaLQFTVBeoy8iczcK77hLeYs0TvCID5tcY6EB4Wfph6iK?= =?Windows-1252?Q?PGJqdONOQ3fBIfFlZKpZJwBlEoNs89izux07F0vSdzSbWXK/JMeHwN7c?= =?Windows-1252?Q?RQcyUM4B9NDrESvAeKBakIiaOH3A5M6D+g1TiL1YCPUHuwAG2E4hop7+?= =?Windows-1252?Q?r01ku36EFC5B0KW78zbbR293FiRO68Dtx/pN2QcyFeZr0m+C7l9IGyFS?= =?Windows-1252?Q?HFy1ulBcGYYZQXz5LIr//kAHbtu/4qv/Cf43icPPNpJwGgb0j3MWU0SI?= =?Windows-1252?Q?CQemYtSroDKSBxbEIgUKVI/UO4tdfg7hOPNEQQWVfABLOLjRtuve5bq+?= =?Windows-1252?Q?jcowai4GsQF4hPO2QklHvceVgcUoHdWIsct8silcrQI1VBq7tlo5rKxp?= =?Windows-1252?Q?d9QGRcXyRn5XoUsLNkhe6qvZ5+4MNq5i+6pRMgU9ZW6ktxJFvJirN5kn?= =?Windows-1252?Q?r6FrNInKdY6CjNYdguUR4D8ITq3fg8NhGFfrBG0IyitosCN77GipYySr?= =?Windows-1252?Q?41cDkyUeJVPE2X3HTFurtNP+vkBb+woXisxpnJIfuJhzTd6kpML2J6nT?= =?Windows-1252?Q?U4IF7AYhJGQMNz7d56FWCf8w8QzmwuHqZGoCTzQJ3+DXb3ofhWQCISUj?= =?Windows-1252?Q?d/pkJ6TEGKkeZzyycC6r+IVUbFCxs+SMKL44+KJajPvScTAfCA9iwgrg?= =?Windows-1252?Q?pj0MHXyNGm7WksNuqi87iPeuVHg6tF0ofhPRXkFheLQM3IfYXksey+ar?= =?Windows-1252?Q?SkIw6GXxFTRXuEuzIQF6oe9GWYM9PH3fPzSR3hEHJQJN/cW/OMTRGOfC?= =?Windows-1252?Q?9/tPBhUE0KfOQ2m1DE1aIGJGLx1BF0+NSpmHHDv0YS5XNz69QuSBNne9?= =?Windows-1252?Q?+nAaIcQ7vh8vQy/TwlEIbTDk7pjPJY0XPKlIpRpSbEVD9eQpl3ZJxr9W?= =?Windows-1252?Q?crS5NoDdndjTog9ENveQoFuiQ8RAR3aAryZNIcqqZExrqV+lZC9UG47u?= =?Windows-1252?Q?UYnEjfqJqijqrhcTgVQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0736; 6:CgEAG7XBdibZBztp4QgNe13fF/yLQKq61cwJ3C4v24YT8MquWcvxE4Bd9MH6ZVktqq1xVN0xSwjfAkCnOTqKkjRGbAnTmOQyVI1d7FZ9kgTsIe+EGB+x5UI3wgAJIOir99F7ucHlhETP6prlkDiKQMFQwWqOfHM+8Qo7stZy5RxeelsqppmMkEDzF3VN5KvoIpM6uldQvsNDiO3xu9ChjctTHCxb77v1/J+uAjDzUpMQYwW4St/xskjYF5P3S2ehEk4vKFeRvoSiEn3DGZ0jPIzzNYAV2SjUdd8kSPkMl5r6hdzgCk1DB2GYJAUMGwJvN5YYa91R0QC84Z2kK0plQdMpkKj/TQo3Yl/Ie+a3RXkfoeEWABiLfXrt5J2QLfj6cSuvXQEp5eRwP9UTaPdSeR9PqbpMSr/22GtYoEoULVk=; 5:RtgO9xh/F30W6seoAh0ZIKCkvoRfJHVUkiBZkRQ1/wSQlEQfhG35t+8OdptNLBvW9g13HS6xVFPnK/x0aazflhcAvJ6Jy34PNdIfU6Tnt8hYc6+ZkCCWbuSokpIQJg/Oj5D6F+b4GjScqzIzpx2eLfTD/Yn7uMj5oYPxO/0f/M9A3Jx0Fmh/CuVaA3ZyixjL; 24:E0bwe8wmHIKyuiA0wVM8CKb1tEpXCUfX/G7QEkf+GiESPxfoXnlqWU5ijdKPFcttPvgqQpHVi78NnNq05m3SbqwAb22MjJSoPBk8r0iw+9A= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0736; 7:JNbvPTXeI9FncWiBzsQU9xK5IRAnlnaBbmat5WzYl+f91Yk0NLs7oSLA34Oz+CwjH210ZiDYnrbGZubcpqKMHGPzPtgwuEWdIUGTtNvIcFVOM/o6Fx0/Ued5wIoDzVNxkbILdrq+/KuO0xMG+g6zQjAoSy0p9VyUNcnZJz2IqAa84SZdLHNMTvZwrwgb0iTmBTyec+KoBwUcADIkxSlA6362c2i0eITJ6N5gI7dNg8EoR9hv/IauhWxW6SS/CGALuszohe+rIZl/DJMzKYZ2d9US8PBPVQjWx4OjkpEOtUq5MJbQQPQ0myPgIRXSUawD/Xhgy/4jFOTCLUYwgAlSRA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2017 10:57:01.0193 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0736 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: Wed, 22 Feb 2017 10:57:04 -0000 On 2/21/2017 6:15 PM, Jerin Jacob wrote: > 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 >> +}; >> + >> typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev); >> /**< @internal Ethernet device configuration. */ >> >> @@ -1427,6 +1433,10 @@ typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev, >> void *arg); >> /**< @internal Take operations to assigned filter type on an Ethernet device */ >> >> +typedef int (*eth_capability_control_t)(struct rte_eth_dev *dev, >> + enum rte_eth_capability cap, void *arg); >> +/**< @internal Take capability operations on an Ethernet device */ >> + >> typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev, >> struct rte_eth_dcb_info *dcb_info); >> /**< @internal Get dcb information on an Ethernet device */ >> @@ -1548,6 +1558,8 @@ struct eth_dev_ops { >> eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */ >> eth_timesync_read_time timesync_read_time; /** Get the device clock time. */ >> eth_timesync_write_time timesync_write_time; /** Set the device clock time. */ >> + >> + eth_capability_control_t cap_ctrl; /**< capability control. */ >> }; >> >> /** >> @@ -3890,6 +3902,23 @@ int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, >> enum rte_filter_op filter_op, void *arg); >> >> /** >> + * Take capability operations on an Ethernet device. >> + * >> + * @param port_id >> + * The port identifier of the Ethernet device. >> + * @param cap >> + * The capability of the Ethernet device >> + * @param arg >> + * A pointer to arguments defined specifically for the operation. > > Better to add _out_ for output parameter. > @param[out] arg. > >> + * @return >> + * - (0) if successful. >> + * - (-ENOTSUP) if hardware doesn't support. >> + * - (-ENODEV) if *port_id* invalid. >> + */ >> +int rte_eth_dev_capability_control(uint8_t port_id, >> + enum rte_eth_capability cap, void *arg); > > > I like the idea of "plugin" interface to ethdev to accommodate > hierarchical scheduler ops with different name space like rte_flow. > Though I don't have strong opinion on the API > name, I think its better to have something end with _ops_get instead of > capability_control > > With that suggestion, > > Acked-by: Jerin Jacob > I echo the suggestion. otherwise, you can add Acked-by: Hemant Agrawal >> + >> +/** >> * Get DCB information on an Ethernet device. >> * >> * @param port_id >> diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map >> index c6c9d0d..d00cb5c 100644 >> --- a/lib/librte_ether/rte_ether_version.map >> +++ b/lib/librte_ether/rte_ether_version.map >> @@ -154,3 +154,10 @@ DPDK_17.02 { >> rte_flow_validate; >> >> } DPDK_16.11; >> + >> +DPDK_17.05 { >> + global: >> + >> + rte_eth_dev_capability_control; >> + >> +} DPDK_17.02; >> -- >> 2.5.0 >> >