From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 783021B2F5 for ; Wed, 1 Nov 2017 19:11:39 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2017 11:11:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,330,1505804400"; d="scan'208";a="1032226435" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by orsmga003.jf.intel.com with ESMTP; 01 Nov 2017 11:11:37 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX107.ger.corp.intel.com (163.33.3.99) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 1 Nov 2017 18:11:36 +0000 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.167]) by irsmsx112.ger.corp.intel.com ([169.254.1.12]) with mapi id 14.03.0319.002; Wed, 1 Nov 2017 18:11:36 +0000 From: "Dumitrescu, Cristian" To: "longtb5@viettel.com.vn" , "users@dpdk.org" Thread-Topic: IP PIPELINE tap device Thread-Index: AdNRZU0AfksVr0G1Rj22fexWs4wgnABscQ0A Date: Wed, 1 Nov 2017 18:11:36 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891267BADDF13@IRSMSX108.ger.corp.intel.com> References: <001701d3516f$b8b02e50$2a108af0$@viettel.com.vn> In-Reply-To: <001701d3516f$b8b02e50$2a108af0$@viettel.com.vn> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Wed, 01 Nov 2017 18:11:40 -0000 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 >=20 > 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 basical= ly > like a l2fwd but with two outputs. There has already been great suggestio= ns > [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 li= ke > to use this device in my IP pipeline application. >=20 > 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 broa= dcast: 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 pro= ducer multiple consumer queues that clones each input packet to N SWQs. >=20 > I have a couple of questions: > First, according to the doc [2], my input port can only be connected to o= ne > table. Moreover, a packet coming from my input port can only hit one tabl= e > entry. However it's not clear whether that one table entry can be connect= ed > to TWO output ports. > Second, I'm having trouble understanding the implementation for table use= r > actions and table reserved actions in rte_pipeline_run() [3], with all th= e > mask thingy. Any pointers would be highly appreciated! >=20 > Regards, > BL >=20 > [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=3Dv= 17 > .11 > -rc2#n1344 >=20 >=20 Regards, Cristian