From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id EBC0A2BB0; Mon, 10 Apr 2017 09:27:07 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id t189so30087221wmt.1; Mon, 10 Apr 2017 00:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=L/exucUDSH9ISAxVZI4vUYAAy2j89+N6tf3r9iGIpPg=; b=OY0ApcHAf53mdA18PA8rMiaCJhSGdll0PV+/H/xn6dFPb09NXMD2zdrvlvB6L8VOpN qE3n+oHc+WjeUZLrzc208hcwdmJUfFC5bqCxIF/Ar7PBjWyi3ezJnZBw2v5OSt9NYbd+ B5+NayBHYJAB/za39NIOxxb13IMd2aJF2uNJbtiGF9kVX1y2LP8dDRXcc7x/JZpbJbrh I7V+DRE1uzVHywGG2K/2G87hLnxfKneaW0NKZu0rVvjJIBWNuQB9yCeesleKDA6c6Oi0 fhpDFu6fMcNYCEoCnsFQglA8ERN7rnEePqqHJU/FAvSwYraSspFRvMklVp8vyfDhHKTC VTTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=L/exucUDSH9ISAxVZI4vUYAAy2j89+N6tf3r9iGIpPg=; b=McLHwlNj7FaKaRnLrM0NPWsfRehnr8UvRITEDBRvtd7fUFnrO350ZPKWFIcBahoJ54 OAPdPcXGm6RWcmuwvKRjqUNwszlit2hmC9TFz9tEYUtInRNPVXgPXyTwjIzQCu0Xw+CK xgfkDcNrbf+PN6CZm6YPHy4RmTGDLbBI7zAjkR/YgDgOD26EmR7gt8qfhnVXaIqQP1EA ADVcCOTIFD6Un7Zc89p47lSSgVDrIkfD9il8U3qCSuSOM1AJD8nF58BD32rp+xDoW0jy aPmGW5Fifx/Eye+s2mMi6nfX2/hq0RQJ3FfxnPAbK7YFtgtyYeeNCOXjKQE9kSSslEj4 fcgw== X-Gm-Message-State: AN3rC/4gnsr3xmGtGYhGsNd3If/aYu9DzBSvgUMBQ79+YaaKkgIR4cyr YToXESsNG0JI8Tyn6abHjKJMZz4kig== X-Received: by 10.28.191.75 with SMTP id p72mr8360610wmf.136.1491809227373; Mon, 10 Apr 2017 00:27:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.169.68 with HTTP; Mon, 10 Apr 2017 00:27:06 -0700 (PDT) In-Reply-To: <54CBAA185211B4429112C315DA58FF6D31B4B2B1@IRSMSX103.ger.corp.intel.com> References: <54CBAA185211B4429112C315DA58FF6D31B4B2B1@IRSMSX103.ger.corp.intel.com> From: Nidhia Varghese Date: Mon, 10 Apr 2017 12:57:06 +0530 Message-ID: To: "Singh, Jasvinder" Cc: "dev@dpdk.org" , "users@dpdk.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] [dpdk-dev] Working of pipeline in a given config file and regarding user-defined actions in IP_PIPELINE application 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: Mon, 10 Apr 2017 07:27:08 -0000 Hi Jasvinder, Thanks for your help. What I understood from the programmer's guide is that, port action handler can be assigned to each input/output port to define actions to be executed on each input packet that is received by the port. But one pipeline can have more than one input and output ports. Actions that has to be done to packets coming from each port can be different even though it is in the same pipeline. How can we define different actions for different ports in this case where we have more than one ports for reception or transmission in same pipeline? Which parameter is used to distinguish the ports? Thanks, Nidhia On Fri, Apr 7, 2017 at 4:50 PM, Singh, Jasvinder wrote: > Hi Nidhia, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nidhia Varghese > > Sent: Thursday, April 6, 2017 10:07 AM > > To: dev@dpdk.org; users@dpdk.org > > Subject: [dpdk-dev] Working of pipeline in a given config file and > regarding > > user-defined actions in IP_PIPELINE application > > > > Hi all, > > > > I am learning DPDK packet framework library for an APP development. I am > > going through the config files and the code. I found the below cfg file > in a > > DPDK summit ppt. I have some doubts regarding the fields used in the cfg > > file. > > 1.What is the difference between dma_size and key_size? > > In ip_pipeline, dma_size is used as one of the parameter in pass-through > pipeline. It is basically the total size (bytes) of the packet fields which > could be used to distinguish the specific packet flow. It could be used for > some other purpose as well. The key_size also defines the size(bytes) of > the packet fields but used as an parameter in flow-classifcation pipeline, > etc where the key (specific set of packet fields) is used to identify the > table entry. > > > 2. How does the PASS-THROUGH pipeline work with given src_mask? > > The src_mask will be applied over incoming packet header fields starting > at dma_src_offset and will help to extract the desired fields from the > packets. The extracted fields are saved at dma_dst_offset as packet > meta-data. This meta-data can be consumed by the same pipeline or any other > pipeline in the application. > In pass-through pipeline, we use this meta-data to implement the load > balancer by distributing the incoming packets across the output ports. The > meta-data is used to compute the hash values which eventually gives the > output port id to send packet out of the pipeline. > > > 3. Are the FLOW CLASSIFICATION and ROUTING pipelines using the same key > > or hash values? > > No, they use different keys. Flow Classification pipeline uses hash tables > and depending upon the type of the packets (IPv4, IPv6, QinQ etc), we > defined the key (a specific combination of packet header fields) to > classify the packets. The routing pipeline use LPM table which uses > destination ip address with prefix length as a key to find the routing > entry for the packets. > > > [PIPELINE0] > > type = MASTER > > core = 0 > > > > [PIPELINE1] > > type = PASS-THROUGH > > core = 1 > > pktq_in = RXQ0.0 RXQ1.0 RXQ2.0 RXQ3.0 > > pktq_out = SWQ0 SWQ1 SWQ2 SWQ3 > > dma_size = 8 > > dma_dst_offset = 0 > > dma_src_offset = 140; headroom (128) + 1st ethertype offset (12) = 140 > > dma_src_mask = 00000FFF00000FFF; qinq dma_hash_offset = 8; > > dma_dst_offset + dma_size = 8 > > > > [PIPELINE2] > > type = FLOW_CLASSIFICATION > > core = 1 > > pktq_in = SWQ0 SWQ1 SWQ2 SWQ3 > > pktq_out = SWQ4 SWQ5 SWQ6 SWQ7 > > n_flows = 16777216; n_flows = 65536 > > key_size = 8; dma_size = 8 > > key_offset = 0; dma_dst_offset = 0 > > hash_offset = 8; dma_hash_offset = 8 flow_id_offset = 64 > > > > [PIPELINE3] > > type = ROUTING > > core = 2 > > pktq_in = SWQ4 SWQ5 SWQ6 SWQ7 > > pktq_out = TXQ0.0 TXQ1.0 TXQ2.0 TXQ3.0 > > n_routes = 4096 > > l2 = mpls > > mpls_color_mark = yes > > ip_hdr_offset = 150; headroom (128) + ethernet header (14) + qinq (8) = > 150 > > color_offset = 68 > > > > > > Other than this, > > 4. How users can add user-defined actions? Can you please give an > example, > > like push or pop VLAN label from the packet 5. How does port action > handler > > works? How and where can we define actions for ports? > > > > Please have a look at pass-through pipeline (pipeline/pipeline_passthrough_be.c) > where we have defined standard macro PIPELINE_PORT_IN_AH > (pipeline/pipeline_common_actions.h) for implementing port actions ( for > example, by default we have few actions implemented for input port such > as swapping the packet fields, load balancing action by distributing the > ingress traffic uniformly across output ports, etc.). These actions can be > enabled by specifying the right parameters in the pipeline section of the > configuration file( reference static rte_pipeline_port_in_action_handler > get_port_in_ah(struct pipeline_passthrough *p)). Likewise you can add your > port actions. > > > > Thanks for your reply and help. > > > Jasvinder > -- Regards, Nidhia Varghese