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 6032A960B for ; Tue, 23 Dec 2014 10:37:35 +0100 (CET) X-ASG-Debug-ID: 1419327453-03d124379d49710001-TfluYd Received: from sjc-exch10hc-02.arubanetworks.com (sjc-exch10hc-02.arubanetworks.com [10.1.8.46]) by mx01.arubanetworks.com with ESMTP id X6G9RKhU3BpbwVIe (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Tue, 23 Dec 2014 01:37:33 -0800 (PST) X-Barracuda-Envelope-From: vmohare@arubanetworks.com Received: from BOREAL.arubanetworks.com ([fe80::19f0:d3af:7377:a759]) by sjc-exch10hc-02.arubanetworks.com ([fe80::88ce:11e3:e0a3:1489%16]) with mapi id 14.03.0158.001; Tue, 23 Dec 2014 01:37:33 -0800 From: Vithal S Mohare To: Bruce Richardson 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: AQHQHgcDLzsNwPl8IEWaK3H9c5VYMJyckoYQgADdpYD//3rLIA== Date: Tue, 23 Dec 2014 09:37:32 +0000 Message-ID: <98DB008FA2AC6644B40AD8C766FAB271014BDE3921@BOREAL.arubanetworks.com> References: <1419266844-4848-1-git-send-email-bruce.richardson@intel.com> <98DB008FA2AC6644B40AD8C766FAB271014BDE376A@BOREAL.arubanetworks.com> <20141223093015.GD10244@bricha3-MOBL3> In-Reply-To: <20141223093015.GD10244@bricha3-MOBL3> 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-02.arubanetworks.com[10.1.8.46] X-Barracuda-Start-Time: 1419327453 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: https://mx01.arubanetworks.com:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at arubanetworks.com 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.13291 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Cc: "dev@dpdk.org" 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 09:37:35 -0000 Agree. As the mbuf is already received in the rx-q, may not yield great ad= vantage. On side note, any plans to support RSS for L2 packets ? -----Original Message----- From: Bruce Richardson [mailto:bruce.richardson@intel.com]=20 Sent: Tuesday, December 23, 2014 3:00 PM To: Vithal S Mohare Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH RFC 0/3] DPDK ethdev callback support On Tue, Dec 23, 2014 at 04:23:21AM +0000, Vithal S Mohare wrote: > Hi Bruce, >=20 > > For example, for a port type that does not support RSS, a callback on RX = can be configured to calculate a hash in software. > >=20 > Wondering if this callback will also be useful to bridge the gap of no RS= S support for L2 packets. i.e. in the rx call-back handler, can applicatio= ns calculate hash and feed it back so that spraying happens based on this? = Now, all pure L2 packets (e.g. arp pkts) comes to rx-q 0 of the 'port'. A= dding callback to [port][rx-q:0] would help? >=20 > Thanks, > -Vithal Yes, that could work. The downside is that it is no faster than having an a= pp do the calculation itself, it's just perhaps a little easier to work wit= h in the app. /Bruce >=20 > -----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 >=20 > This RFC is for a small addition to the ethdev library, to add in support= for callbacks at the RX and TX stages. This allows packet processing to be= done on packets before they get returned to applications using rte_eth_rx_= burst call. >=20 > Use case: the first use case for this is to enable a consistent set of pa= ckets mbufs to be received by applications irrespective of the NIC used to = receive those. For example, for a port type that does not support RSS, a ca= llback on RX can be configured to calculate a hash in software.=20 > Similarly, this mechanism can be used to add other information to mbufs a= s they are received, such as timestamps or sequence numbers, without clutte= ring up the main packet processing path with checks for whether packets hav= e these fields filled in or not. > A second use case is ease of intrumenting existing code. The example appl= ication shows how combining a timestamp insertion callback on RX can be pai= red with a latency calculation callback on TX to easily instrument any appl= ication for packet latency. > A third use case is to potentially extend existing NIC capabilities beyon= d what is currently supported. For example, where flow director capabilitie= s 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 = millions of flows by using a software hash table lookup inline for packets = that missing the hardware lookup filters. It would all appear transparent t= o the packet handling code in the main application. >=20 > Future extensions: in future the ethdev library can be extended to provid= e a standard set of callbacks for use by drivers.=20 >=20 > For now this patch set is RFC and still needs additional work for creatin= g 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 = performance tests using testpmd with the ixgbe vector drivers (i.e. the fas= test, fast-path we have :-) ). Performance drops due to this patch seems mi= nimal to non-existant, rough tests on my system indicate a drop of perhaps = 1%. >=20 > All feedback welcome. >=20 > Bruce Richardson (3): > ethdev: rename callbacks field to intr_cbs > ethdev: Add in data rxtx callback support > examples: example showing use of callbacks. >=20 > 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=20 > 100644 examples/rxtx_callbacks/Makefile create mode 100644=20 > examples/rxtx_callbacks/basicfwd.c > create mode 100644 examples/rxtx_callbacks/basicfwd.h >=20 > -- > 1.9.3 >=20