From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by dpdk.org (Postfix) with ESMTP id 61F319634 for ; Mon, 22 Dec 2014 19:32:08 +0100 (CET) Received: by mail-pd0-f172.google.com with SMTP id y13so6293628pdi.17 for ; Mon, 22 Dec 2014 10:32:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=p/Phl88Y7/qXBd5tWHJe6S533LvjatiAmcDfovCsH1c=; b=KjzkzmYcYPT8zCdTIFuHBsdWLHM8SG7eIyvSQStxLxzojwyHmdDbpSN48kXmGx0B21 5OPhyaxjra1V0n1kur4CNf3LQW5CMjDgvFr1BtFHnMQiWS3TPhWQF94sxzJzkzq2taKE AsaueUNz68YSKUD8Fcku2Ji0HhuHyCiScpNt5VEXHqb0mTtg+72EnbjPephC4k3Gqwl6 ywjO/anLG2aN3IZGIhpEHro/gbhelXdgB6OtOc1vxr0oHHzBlATM5CRc2YbitMkCpSMe b0yH0+svGRH6McDVv3drpHHjIKzLONtxnyvf/bHrtOt3+hg6UUzDYipDrwa0etaahwsC gdpg== X-Gm-Message-State: ALoCoQlgsvUkCSi7MD5fmuU8sLVvPlGNngBA3uQ3cQ96yianTqbCfVYMRjlydwCOofQ5+qo9WbVP X-Received: by 10.66.141.165 with SMTP id rp5mr37100844pab.121.1419273126248; Mon, 22 Dec 2014 10:32:06 -0800 (PST) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id lm3sm17943589pab.34.2014.12.22.10.32.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Dec 2014 10:32:05 -0800 (PST) Date: Mon, 22 Dec 2014 10:31:57 -0800 From: Stephen Hemminger To: Bruce Richardson Message-ID: <20141222103157.58e33123@urahara> In-Reply-To: <1419266844-4848-1-git-send-email-bruce.richardson@intel.com> References: <1419266844-4848-1-git-send-email-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Mon, 22 Dec 2014 18:32:08 -0000 On Mon, 22 Dec 2014 16:47:21 +0000 Bruce Richardson wrote: > 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. > > Use case: the first use case for this is to enable a consistent set of > packets 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 callback on RX can be configured to calculate a hash in software. > Similarly, this mechanism can be used to add other information to mbufs > as they are received, such as timestamps or sequence numbers, without cluttering > 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 application > shows how combining a timestamp insertion callback on RX can be paired with a > latency calculation callback on TX to easily instrument any application 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 > millions of flows by using a software hash table lookup inline for packets > that 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. > > 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 > performance tests using testpmd with the ixgbe vector drivers (i.e. the > fastest, fast-path we have :-) ). Performance drops due to this patch > seems minimal 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 examples/rxtx_callbacks/Makefile > create mode 100644 examples/rxtx_callbacks/basicfwd.c > create mode 100644 examples/rxtx_callbacks/basicfwd.h > What about SMP safety? The callback list is not thread safe. Do you plan to start integrating with an RCU framework like userspace RCU?