From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailfilter03.viettel.com.vn (unknown [125.235.240.55]) by dpdk.org (Postfix) with ESMTP id 4392A1B33D for ; Thu, 2 Nov 2017 04:47:14 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.44,331,1505754000"; d="scan'208";a="66132494" Received: from 125.235.240.45.adsl.viettel.vn (HELO mta2.viettel.com.vn) ([125.235.240.45]) by mailfilter03.viettel.com.vn with ESMTP; 02 Nov 2017 10:47:02 +0700 Received: from localhost (localhost [127.0.0.1]) by mta2.viettel.com.vn (Postfix) with ESMTP id 5376869AE1B; Thu, 2 Nov 2017 10:47:01 +0700 (ICT) Received: from mta2.viettel.com.vn ([127.0.0.1]) by localhost (mta2.viettel.com.vn [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id v7ICdns9iu6D; Thu, 2 Nov 2017 10:47:01 +0700 (ICT) Received: from localhost (localhost [127.0.0.1]) by mta2.viettel.com.vn (Postfix) with ESMTP id 3150B69AE67; Thu, 2 Nov 2017 10:47:01 +0700 (ICT) X-Virus-Scanned: amavisd-new at Received: from mta2.viettel.com.vn ([127.0.0.1]) by localhost (mta2.viettel.com.vn [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vuYY_e7l30vc; Thu, 2 Nov 2017 10:47:01 +0700 (ICT) Received: from ANMLONGTB5 (unknown [27.68.241.28]) by mta2.viettel.com.vn (Postfix) with ESMTPSA id F025269AE49; Thu, 2 Nov 2017 10:47:00 +0700 (ICT) To: , References: <001701d3516f$b8b02e50$2a108af0$@viettel.com.vn> <3EB4FA525960D640B5BDFFD6A3D891267BADDF13@IRSMSX108.ger.corp.intel.com> In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D891267BADDF13@IRSMSX108.ger.corp.intel.com> Message-ID: <000001d3538d$6c91b960$45b52c20$@viettel.com.vn> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQFclBG0dP+yr6ViIGzP0u1l1OY5YQIaSnito90bayA= Content-Language: en-us MilterAction: FORWARD Date: Thu, 2 Nov 2017 10:47:01 +0700 (ICT) From: longtb5@viettel.com.vn Subject: Re: [dpdk-users] IP PIPELINE tap device X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Nov 2017 03:47:15 -0000 Hi Cristian, Thanks for the reply. I have some follow up questions: First, I had tried rte_pipeline_port_out_packet_insert() before you pointed it out to me that I needed to rte_pipeline_ah_packet_hijack() first (which didn't work, should have read the API more carefully, my bad). From the source code it looks like hijack() simply reset the pkts_mask to 0. But inside port_out_packet_insert(), I didn't see any manipulation involving pkts_mask; it called port_out->ops.f_tx() directly. In my case the tx function is rte_port_ethdev_writer_tx(), which I'm assuming would perform packet tx. In short, why would I need to hijack() first, if all I'm doing is sending packet out right after rx without letting the packet reach the table (we're still inside port_in_action_handler)? My second question, how do I change the dst mac address of each packet? Currently I'm using rte_pktmbuf_mtod() following the l2fwd sample app. The function seems to work correctly but my pktgen couldn't capture any output packet from pipeline_tap. Thanks and best regards, BL > -----Original Message----- > From: cristian.dumitrescu@intel.com [mailto:cristian.dumitrescu@intel.com] > Sent: Thursday, November 2, 2017 1:12 AM > To: longtb5@viettel.com.vn; users@dpdk.org > Subject: RE: IP PIPELINE tap device > > Hi BL, > > > > -----Original Message----- > > From: longtb5@viettel.com.vn [mailto:longtb5@viettel.com.vn] > > Sent: Monday, October 30, 2017 11:09 AM > > To: users@dpdk.org > > Cc: Dumitrescu, Cristian > > Subject: IP PIPELINE tap device > > > > Hi, > > I'm writing a new pipeline type called pipeline_tap, which has one > > input and two outputs. The outputs are simply duplications of the > > input, so basically like a l2fwd but with two outputs. There has > > already been great suggestions [1] on the mailing list to use the > > l2fwd sample app as a starting point, but I want to implement this > > using IP pipeline/packet framework as I would like to use this device in my > IP pipeline application. > > > > As I understand here's what I must provide in order to make my > > pipeline_tap: > > an input port, at least one table, and two output ports. > > Well, you have multiple options, depending on how statefull/stateless your > tap/probe/mirror device is. > > What do you want to mirror? > (A) all input traffic > (B) just some packet types or pkts meeting a certain condition > (B) or just some selected flows (C) > > Options (A) and (B) could be implemented without any internal table, while > (C) most likely needs a table to be managed. > > One solution could be to create a "mirror"pipeline that does a sort of > broadcast: assuming N output ports, the input packet is: > 1. Removed from the pipeline using rte_pipeline_hijack() API function 2. > Clone every input packet is cloned (N-1) times 3. All N packets are sent out to > an output port using rte_pipeline_port_out_packet_insert() > See pipeline_passthrough_be.c as example. > > Another solution could be to create a "mirror" device similar to single > producer multiple consumer queues that clones each input packet to N > SWQs. > > > > > > I have a couple of questions: > > First, according to the doc [2], my input port can only be connected > > to one table. Moreover, a packet coming from my input port can only > > hit one table entry. However it's not clear whether that one table > > entry can be connected to TWO output ports. > > Second, I'm having trouble understanding the implementation for table > > user actions and table reserved actions in rte_pipeline_run() [3], > > with all the mask thingy. Any pointers would be highly appreciated! > > > > Regards, > > BL > > > > [1] http://dpdk.org/ml/archives/dev/2015-July/021293.html > > [2] > > > http://dpdk.org/doc/guides/prog_guide/packet_framework.html#connectiv > > ity-of- > > ports-and-tables > > [3] > > http://dpdk.org/browse/dpdk/tree/lib/librte_pipeline/rte_pipeline.c?h= > > v17 > > .11 > > -rc2#n1344 > > > > > > Regards, > Cristian