[dpdk-users] problem running ip pipeline application

Singh, Jasvinder jasvinder.singh at intel.com
Fri Apr 8 22:23:01 CEST 2016


HI Biju,

> -----Original Message-----
> From: Talukdar, Biju [mailto:Biju_Talukdar at student.uml.edu]
> Sent: Thursday, April 7, 2016 12:36 AM
> To: Singh, Jasvinder <jasvinder.singh at intel.com>; users <users at dpdk.org>
> Subject: Re: problem running ip pipeline application
> 
> 
> Hi Jasvinder,
> I have seen one of your archive mail, where you described how one can
> extract fields by modifying the configuration file. here is a small excerpt:
> 
> PIPELINE1]
> type = PASS-THROUGH
> core = 1
> pktq_in = RXQ0.0 RXQ1.0 RXQ2.0 RXQ3.0
> pktq_out = TXQ0.0 TXQ1.0 TXQ2.0 TXQ3.0
> dma_size = 16
> dma_dst_offset = 64
> dma_src_offset = 150
> dma_src_mask = 00FF0000FFFFFFFFFFFFFFFFFFFFFFFF dma_hash_offset = 80
> 
> I am not able to understand what these field means. I want to extract src ip
> and destination ip. How would my configuration file would look like.
>  Again where the fields will be extracted. I need them as a input to my
> function where I will use the src/dst ips  to calculate a hash value and update
> my array.

<snip>
	/*Input ports*/
	for (i = 0; i < p->n_ports_in; i++) {
		struct rte_pipeline_port_in_params port_params = {
			.ops = pipeline_port_in_params_get_ops(
				&params->port_in[i]),
			.arg_create = pipeline_port_in_params_convert(
				&params->port_in[i]),
			.f_action = get_port_in_ah(p_pt),
			.arg_ah = p_pt,
			.burst_size = params->port_in[i].burst_size,
		};

In "static void* pipeline_passthrough_init" function, actions on the packets received at input ports have been defined during input ports initialization. These actions have been implemented using pkt_work (or pkt4_work) routines, where the mask (defined in configuration file) is applied over incoming packet header fileds to extract the key.  For example; let's assume we have following configuration file;

[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 = 16
dma_dst_offset = 128; mbuf (128) + 64
dma_src_offset = 278; mbuf (128) + headroom (128) + ethernet header (14) + ttl offset within ip header (8) = 278
dma_src_mask = 00FF0000FFFFFFFFFFFFFFFFFFFFFFFF; ipv4 5-tuple
dma_hash_offset = 144; dma_dst_offset + dma_size

The above mask (16 bytes) will be applied over the ipv4 packet header fields starting at dma_src_offset and will allow to extract 5-tuples (src/dst ip, src/dst tcp port and protocol).
The extracted fields are saved at dma_dst_offset. Application developer can defined his own mask at any offset (dma_src_offset). In pkt_work/pkt4_work routines, hash
values are computed over extracted 5-tuples and stored at dma_hash_offset for the consumption of any other pipeline in the chain.

> Also how do I print values of my variable. Is there any log file where I can
> print values. How do I debug my program, feeling helpless.

You can introduce printf statements in pkt_work/pkt4_work routines or can use gdb to see computed parameters value.

> Regarding the CLI. I also could not get any command for CLI. I just found one
> "p 1 ping". Could you please give some information.
> 
Regarding CLI command, passthrough pipeline accpets p <pipeline id> ping, link up/down related command etc. Please have a look at examples/ip_pipeline/pipeline/pipeline_comman_fe.c(h) for
commands that passthrough pipeline can accept.


Jasvinder


More information about the users mailing list