From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx01.arubanetworks.com (mx01.arubanetworks.com [104.36.248.59]) by dpdk.org (Postfix) with ESMTP id 4CFB895E8 for ; Tue, 23 Dec 2014 05:23:24 +0100 (CET) X-ASG-Debug-ID: 1419308602-03d124379d3c6e0001-TfluYd Received: from sjc-exch10hc-01.arubanetworks.com (sjc-exch10hc-01.arubanetworks.com [10.1.8.45]) by mx01.arubanetworks.com with ESMTP id HkOSe6sebAboI61a (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Mon, 22 Dec 2014 20:23:22 -0800 (PST) X-Barracuda-Envelope-From: vmohare@arubanetworks.com Received: from BOREAL.arubanetworks.com ([fe80::19f0:d3af:7377:a759]) by sjc-exch10hc-01.arubanetworks.com ([fe80::58e7:e72c:3b0d:5534%11]) with mapi id 14.03.0158.001; Mon, 22 Dec 2014 20:23:21 -0800 From: Vithal S Mohare To: Bruce Richardson , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH RFC 0/3] DPDK ethdev callback support X-ASG-Orig-Subj: RE: [dpdk-dev] [PATCH RFC 0/3] DPDK ethdev callback support Thread-Index: AQHQHgcDLzsNwPl8IEWaK3H9c5VYMJyckoYQ Date: Tue, 23 Dec 2014 04:23:21 +0000 Message-ID: <98DB008FA2AC6644B40AD8C766FAB271014BDE376A@BOREAL.arubanetworks.com> References: <1419266844-4848-1-git-send-email-bruce.richardson@intel.com> In-Reply-To: <1419266844-4848-1-git-send-email-bruce.richardson@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.20.22.46] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: sjc-exch10hc-01.arubanetworks.com[10.1.8.45] X-Barracuda-Start-Time: 1419308602 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: https://mx01.arubanetworks.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at arubanetworks.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=7.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.13280 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Subject: Re: [dpdk-dev] [PATCH RFC 0/3] DPDK ethdev callback support 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: Tue, 23 Dec 2014 04:23:24 -0000 Hi Bruce, For example, for a port type that does not support RSS, a callback on RX ca= n be configured to calculate a hash in software. Wondering if this callback will also be useful to bridge the gap of no RSS = support for L2 packets. i.e. in the rx call-back handler, can applications= calculate hash and feed it back so that spraying happens based on this? N= ow, all pure L2 packets (e.g. arp pkts) comes to rx-q 0 of the 'port'. Add= ing callback to [port][rx-q:0] would help? Thanks, -Vithal -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson Sent: Monday, December 22, 2014 10:17 PM To: dev@dpdk.org Subject: [dpdk-dev] [PATCH RFC 0/3] DPDK ethdev callback support This RFC is for a small addition to the ethdev library, to add in support f= or callbacks at the RX and TX stages. This allows packet processing to be d= one on packets before they get returned to applications using rte_eth_rx_bu= rst call. Use case: the first use case for this is to enable a consistent set of pack= ets mbufs to be received by applications irrespective of the NIC used to re= ceive those. For example, for a port type that does not support RSS, a call= back on RX can be configured to calculate a hash in software.=20 Similarly, this mechanism can be used to add other information to mbufs as = they are received, such as timestamps or sequence numbers, without clutteri= ng up the main packet processing path with checks for whether packets have = these fields filled in or not. A second use case is ease of intrumenting existing code. The example applic= ation shows how combining a timestamp insertion callback on RX can be paire= d with a latency calculation callback on TX to easily instrument any applic= ation for packet latency. A third use case is to potentially extend existing NIC capabilities beyond = what is currently supported. For example, where flow director capabilities = can match up to a certain limit of flows - in the thousands, in the case of= NICs using the ixgbe driver - a callback can extend this to potentially mi= llions of flows by using a software hash table lookup inline for packets th= at missing the hardware lookup filters. It would all appear transparent to = the packet handling code in the main application. Future extensions: in future the ethdev library can be extended to provide = a standard set of callbacks for use by drivers.=20 For now this patch set is RFC and still needs additional work for creating = a remove function for callbacks and to add in additional testing code. Since this adds in new code into the critical data path, I have run some pe= rformance tests using testpmd with the ixgbe vector drivers (i.e. the faste= st, fast-path we have :-) ). Performance drops due to this patch seems mini= mal to non-existant, rough tests on my system indicate a drop of perhaps 1%= . All feedback welcome. Bruce Richardson (3): ethdev: rename callbacks field to intr_cbs ethdev: Add in data rxtx callback support examples: example showing use of callbacks. app/test/virtual_pmd.c | 2 +- examples/rxtx_callbacks/Makefile | 57 +++++++++ examples/rxtx_callbacks/basicfwd.c | 222 +++++++++++++++++++++++++++++= ++++ examples/rxtx_callbacks/basicfwd.h | 46 +++++++ lib/librte_ether/rte_ethdev.c | 103 +++++++++++++-- lib/librte_ether/rte_ethdev.h | 125 ++++++++++++++++++- lib/librte_pmd_bond/rte_eth_bond_api.c | 2 +- 7 files changed, 543 insertions(+), 14 deletions(-) create mode 100644 ex= amples/rxtx_callbacks/Makefile create mode 100644 examples/rxtx_callbacks/= basicfwd.c create mode 100644 examples/rxtx_callbacks/basicfwd.h -- 1.9.3