From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 3F71E5A15 for ; Wed, 21 Jan 2015 17:43:31 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 21 Jan 2015 08:30:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,442,1418112000"; d="scan'208";a="515480552" Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.28]) by orsmga003.jf.intel.com with SMTP; 21 Jan 2015 08:23:59 -0800 Received: by (sSMTP sendmail emulation); Wed, 21 Jan 2015 16:30:40 +0025 Date: Wed, 21 Jan 2015 16:30:40 +0000 From: Bruce Richardson To: deco33000 Jog Message-ID: <20150121163040.GA11720@bricha3-MOBL3> References: <2523541421848850@web15h.yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2523541421848850@web15h.yandex.ru> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] DPDK - TX from lcore in packet distributor configuration 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: Wed, 21 Jan 2015 16:43:31 -0000 On Wed, Jan 21, 2015 at 03:00:50PM +0100, deco33000 Jog wrote: > Hello, > > -- PROBLEM > I have a AF_PACKET socket which is in promiscuous mode to get all the NIC traffic and let my apps do the whole stuff. > > So I have one receiver and need to communicate the packet to different threads/processes (lcore) so that they can process the rest of the packet (tcp/udp...) > > -- QUESTION > I read about the packet distributor architecture which seems to answer that need. > http://dpdk.org/doc/guides/prog_guide/packet_distrib_lib.html > > BUT i fear that it be slow at resending the packet to the distributor which may already be overloaded by inputs from the net. Why pass back the answer to the distributor if the lcore could send to the wire directly ? > > My problem is going back to the distributor after the packet processing. i would a direct send to the tx ring. > > Is it possible ? How ? By passing the TX pointer to the lcore ? If you sent up the NIC so that it has multiple queues for each thread you can have each worker send directly to the NIC. Without multiple queues, they could still send directly, they will just have to use locking or some other access mechanism to mediate access to the common TX queue. The other problem with this approach is that sending packets individually is almost always slower than sending them in bursts. To mitigate against this, you could look to buffer packets inside the workers before transmitting them back out, but that could lead to packets being sent out of order - not sure if that is a problem for you or not. The reason the distributor sample app sends the packets back to the distributor after worker processing is to overcome these limitations. There is no additional cross-core round trip involved in sending a packet back to the distributor along with the request, and having the distributor re-gather the packets ensures ordering within flows/tags is maintained. Thereafter packets can be burst-sent out an ethernet port. Out of interest, given you are using the AF_PACKET driver, what rate of packets per second are you looking at? /Bruce