[dpdk-users] problem running ip pipeline application

Talukdar, Biju Biju_Talukdar at student.uml.edu
Wed Apr 13 02:04:15 CEST 2016


Hi Jasvinder,
Thanks a lot for your guidance. 

I could see the prints that the pipeline initialization is complete. I gave prints in the function pipeline_passthrough_init(). And I could see the prints. But I get no prints from the function pkt_work(). This function process all the packets. PKT_WORK macro uses pkt_work() function. Again PKT_WORK is used by port_in_ah macro. I am showing the code snippets from passthrough pipeline.

#define port_in_ah(dma_size, hash_enabled)            \
PKT_WORK(dma_size, hash_enabled)                \
PKT4_WORK(dma_size, hash_enabled)                \
PIPELINE_PORT_IN_AH(port_in_ah_size##dma_size##_hash##hash_enabled,\
    pkt_work_size##dma_size##_hash##hash_enabled,        \
    pkt4_work_size##dma_size##_hash##hash_enabled) 


Now, port_in_ah is called like as show below:

port_in_ah(8, 0)
port_in_ah(8, 1)
port_in_ah(16, 0)
port_in_ah(16, 1)
port_in_ah(24, 0)
port_in_ah(24, 1)
port_in_ah(32, 0)
port_in_ah(32, 1)
port_in_ah(40, 0)
port_in_ah(40, 1)
port_in_ah(48, 0)
port_in_ah(48, 1)
port_in_ah(56, 0)
port_in_ah(56, 1)
port_in_ah(64, 0)
port_in_ah(64, 1)

So eventually pkt_work() should get called by the above calls. But why I am not getting any prints from pkt_work(). I have no clue why I am not getting any test prints. Why the program execuion is not reaching up to those printfs.
Do you think that I am not even getting any packets  and thats why pkt_work() is not get called at all. In that scenario, where I should look in? Remember I am just trying the sample example application. There is no code change there apart from my prints. Logically it should work.

________________________________________
From: Singh, Jasvinder <jasvinder.singh at intel.com>
Sent: Friday, April 8, 2016 4:23 PM
To: Talukdar, Biju; users
Subject: RE: problem running ip pipeline application

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