All of lore.kernel.org
 help / color / mirror / Atom feed
* Working of pipeline in a given config file and regarding user-defined actions in IP_PIPELINE application
@ 2017-04-06  9:06 Nidhia Varghese
  2017-04-07 11:20 ` Singh, Jasvinder
  0 siblings, 1 reply; 8+ messages in thread
From: Nidhia Varghese @ 2017-04-06  9:06 UTC (permalink / raw)
  To: dev, users

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?
2. How does the PASS-THROUGH pipeline work with given src_mask?
3. Are the FLOW CLASSIFICATION and ROUTING pipelines using the same key or
hash values?

[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?


Thanks for your reply and help.

-- 

Regards,
Nidhia Varghese

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Working of pipeline in a given config file and regarding user-defined actions in IP_PIPELINE application
  2017-04-06  9:06 Working of pipeline in a given config file and regarding user-defined actions in IP_PIPELINE application Nidhia Varghese
@ 2017-04-07 11:20 ` Singh, Jasvinder
  2017-04-10  7:27   ` Nidhia Varghese
  0 siblings, 1 reply; 8+ messages in thread
From: Singh, Jasvinder @ 2017-04-07 11:20 UTC (permalink / raw)
  To: Nidhia Varghese, dev, users

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Working of pipeline in a given config file and regarding user-defined actions in IP_PIPELINE application
  2017-04-07 11:20 ` Singh, Jasvinder
@ 2017-04-10  7:27   ` Nidhia Varghese
  2017-04-10  9:39     ` Dumitrescu, Cristian
  0 siblings, 1 reply; 8+ messages in thread
From: Nidhia Varghese @ 2017-04-10  7:27 UTC (permalink / raw)
  To: Singh, Jasvinder; +Cc: dev, users

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 <jasvinder.singh@intel.com>
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Working of pipeline in a given config file and regarding user-defined actions in IP_PIPELINE application
  2017-04-10  7:27   ` Nidhia Varghese
@ 2017-04-10  9:39     ` Dumitrescu, Cristian
  2017-04-11  7:48       ` Nidhia Varghese
  0 siblings, 1 reply; 8+ messages in thread
From: Dumitrescu, Cristian @ 2017-04-10  9:39 UTC (permalink / raw)
  To: Nidhia Varghese, Singh, Jasvinder; +Cc: dev, users

Hi Nidhia,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nidhia Varghese
> Sent: Monday, April 10, 2017 8:27 AM
> To: Singh, Jasvinder <jasvinder.singh@intel.com>
> Cc: dev@dpdk.org; users@dpdk.org
> Subject: Re: [dpdk-dev] Working of pipeline in a given config file and
> regarding user-defined actions in IP_PIPELINE application
> 
> 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.

Yes, this is correct, the librte_pipeline allows you to configure independent action handlers for each input port/output port/table in the 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?

However, in the ip_pipeline application so far, only the pass-through pipeline provide an example of an input port action handler, and the same AH is set up for all input ports. If you want different AH for different ports, you probably need to implement your own AH functions and add some pipeline type specific parameters to the configuration file syntax in order to assign different actions to different ports.

> 
> Thanks,
> Nidhia
> 

Regards,
Cristian


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Working of pipeline in a given config file and regarding user-defined actions in IP_PIPELINE application
  2017-04-10  9:39     ` Dumitrescu, Cristian
@ 2017-04-11  7:48       ` Nidhia Varghese
  2017-04-11  9:04         ` Dumitrescu, Cristian
  0 siblings, 1 reply; 8+ messages in thread
From: Nidhia Varghese @ 2017-04-11  7:48 UTC (permalink / raw)
  To: Dumitrescu, Cristian; +Cc: Singh, Jasvinder, dev, users

Hi Cristian,

Thanks for your help.

If that is the case, is there any way to use the incoming port as a key for
table lookup? I need to use incoming port along with some other fields of
each packet as the key for my application.

On Mon, Apr 10, 2017 at 3:09 PM, Dumitrescu, Cristian <
cristian.dumitrescu@intel.com> wrote:

> Hi Nidhia,
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nidhia Varghese
> > Sent: Monday, April 10, 2017 8:27 AM
> > To: Singh, Jasvinder <jasvinder.singh@intel.com>
> > Cc: dev@dpdk.org; users@dpdk.org
> > Subject: Re: [dpdk-dev] Working of pipeline in a given config file and
> > regarding user-defined actions in IP_PIPELINE application
> >
> > 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.
>
> Yes, this is correct, the librte_pipeline allows you to configure
> independent action handlers for each input port/output port/table in the
> 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?
>
> However, in the ip_pipeline application so far, only the pass-through
> pipeline provide an example of an input port action handler, and the same
> AH is set up for all input ports. If you want different AH for different
> ports, you probably need to implement your own AH functions and add some
> pipeline type specific parameters to the configuration file syntax in order
> to assign different actions to different ports.
>
> >
> > Thanks,
> > Nidhia
> >
>
> Regards,
> Cristian
>
>


-- 

Regards,
Nidhia Varghese

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Working of pipeline in a given config file and regarding user-defined actions in IP_PIPELINE application
  2017-04-11  7:48       ` Nidhia Varghese
@ 2017-04-11  9:04         ` Dumitrescu, Cristian
  2017-04-18  5:40           ` Nidhia Varghese
  0 siblings, 1 reply; 8+ messages in thread
From: Dumitrescu, Cristian @ 2017-04-11  9:04 UTC (permalink / raw)
  To: Nidhia Varghese; +Cc: Singh, Jasvinder, dev, users

Hi Nidhia,

>Hi Cristian,
>
>Thanks for your help.
>
>If that is the case, is there any way to use the incoming port as a key for table lookup? I need to use incoming port along with some other fields of each packet as the key for my application.

Yes, you can. There is an input port field in the rte_mbuf structure that you can use.

The hash tables from librte_table/rte_table_hash* work with lookup key placed at any location from the start of the mbuf (see the key offset parameter), and for some tables there is a key mask parameter as well. Assuming a flat buffer that has both the mbuf and the packet in the same buffer (see the buffer anatomy in rte_mbuf.h), the key offset parameter can basically cover any location from the buffer, including meta-data (fields from mbuf or the buffer headroom, such as the input port), as well as packet fields (from the header/payload, such as the DiffServ 5-tuple).

You can do any of the two things below:
1. Use the key offset and key mask parameter of the hash table to select the relevant metadata/packet header fields;
2. Use the DMA action of the pass-through table to copy & pack the relevant metadata/packet header fields in some unused headroom space, and then point the key offset to this buffer location.

>
>Regards,
>Nidhia Varghese

Regards,
Cristian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Working of pipeline in a given config file and regarding user-defined actions in IP_PIPELINE application
  2017-04-11  9:04         ` Dumitrescu, Cristian
@ 2017-04-18  5:40           ` Nidhia Varghese
  2017-04-18  9:53             ` Dumitrescu, Cristian
  0 siblings, 1 reply; 8+ messages in thread
From: Nidhia Varghese @ 2017-04-18  5:40 UTC (permalink / raw)
  To: Dumitrescu, Cristian; +Cc: Singh, Jasvinder, dev, users

Hi Christian,

Can you please elaborate on how to use DMA action of pass-through table for
this?

Is that like creating a separate pipeline for saving this metadata to the
headroom space and in the next pipeline we use this metadata field for
further lookups. And we will be using different keys for each of these
pipelines. Is that so?

Thanks for your help.

Nidhia

On Tue, Apr 11, 2017 at 2:34 PM, Dumitrescu, Cristian <
cristian.dumitrescu@intel.com> wrote:

> Hi Nidhia,
>
> >Hi Cristian,
> >
> >Thanks for your help.
> >
> >If that is the case, is there any way to use the incoming port as a key
> for table lookup? I need to use incoming port along with some other fields
> of each packet as the key for my application.
>
> Yes, you can. There is an input port field in the rte_mbuf structure that
> you can use.
>
> The hash tables from librte_table/rte_table_hash* work with lookup key
> placed at any location from the start of the mbuf (see the key offset
> parameter), and for some tables there is a key mask parameter as well.
> Assuming a flat buffer that has both the mbuf and the packet in the same
> buffer (see the buffer anatomy in rte_mbuf.h), the key offset parameter can
> basically cover any location from the buffer, including meta-data (fields
> from mbuf or the buffer headroom, such as the input port), as well as
> packet fields (from the header/payload, such as the DiffServ 5-tuple).
>
> You can do any of the two things below:
> 1. Use the key offset and key mask parameter of the hash table to select
> the relevant metadata/packet header fields;
> 2. Use the DMA action of the pass-through table to copy & pack the
> relevant metadata/packet header fields in some unused headroom space, and
> then point the key offset to this buffer location.
>
> >
> >Regards,
> >Nidhia Varghese
>
> Regards,
> Cristian
>



-- 

Regards,
Nidhia Varghese

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Working of pipeline in a given config file and regarding user-defined actions in IP_PIPELINE application
  2017-04-18  5:40           ` Nidhia Varghese
@ 2017-04-18  9:53             ` Dumitrescu, Cristian
  0 siblings, 0 replies; 8+ messages in thread
From: Dumitrescu, Cristian @ 2017-04-18  9:53 UTC (permalink / raw)
  To: Nidhia Varghese; +Cc: Singh, Jasvinder, dev, users



From: Nidhia Varghese [mailto:nidhiavarghese93@gmail.com]
Sent: Tuesday, April 18, 2017 6:40 AM
To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
Cc: Singh, Jasvinder <jasvinder.singh@intel.com>; dev@dpdk.org; users@dpdk.org
Subject: Re: [dpdk-dev] Working of pipeline in a given config file and regarding user-defined actions in IP_PIPELINE application

Hi Christian,

Can you please elaborate on how to use DMA action of pass-through table for this?

Is that like creating a separate pipeline for saving this metadata to the headroom space and in the next pipeline we use this metadata field for further lookups. And we will be using different keys for each of these pipelines. Is that so?

Thanks for your help.

Nidhia


[Cristian] Yes, exactly. In the config/edge_router_upstream.cfg personality, you can see this taking place between PIPELINE2 (Pass-through) and PIPELINE3 (FlowClassification). The hash table mask approach can be used here to eliminate the PIPELINE2, but this was an after-thought at the time, which now is supported.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-04-18  9:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06  9:06 Working of pipeline in a given config file and regarding user-defined actions in IP_PIPELINE application Nidhia Varghese
2017-04-07 11:20 ` Singh, Jasvinder
2017-04-10  7:27   ` Nidhia Varghese
2017-04-10  9:39     ` Dumitrescu, Cristian
2017-04-11  7:48       ` Nidhia Varghese
2017-04-11  9:04         ` Dumitrescu, Cristian
2017-04-18  5:40           ` Nidhia Varghese
2017-04-18  9:53             ` Dumitrescu, Cristian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.