Hi All,

    I using dpdk pipeline and performing table lookup to decide the packet forwarding.

One of my use case v4_acl lookup failing could not find the reason.

 

Scenario:

pipeline test_pipe1 table match v4_acl ipv4 offset 274 size 1K action test.

 

Acl table offset is set to 274. In coming packets contains vlan header.

When normal packet received src and ds tip matching according  to the rules I pushed into the table.

Packets with GRE header and outer ip header src and dst ip also matching.

 

I wanted to do lookup for inner IP header src and dst fields , to achieve this used rte_pktmbuf_adj to remove the gre and outer ip header.

Again I placed eth_header and vlan header at the start position.

 

Code snippet:

 

rte_memcpy(&temp_hdr, eth_header,

                                (sizeof(struct rte_ether_hdr) + sizeof(struct rte_vlan_hdr) +

                                 sizeof(struct rte_ipv4_hdr) +

                                 sizeof(gre_hdr_t)));

 

                rte_pktmbuf_adj (mb, (sizeof(struct rte_ether_hdr) + sizeof(struct rte_vlan_hdr) +

                                        sizeof(struct rte_ipv4_hdr) +

                                        sizeof(gre_hdr_t)));

                rte_pktmbuf_prepend (mb,

                                sizeof (struct rte_ether_hdr) + sizeof(struct rte_vlan_hdr) );

                pkt = rte_pktmbuf_mtod(mb, uint8_t *);

 

                rte_memcpy (pkt, &temp_hdr,

                                sizeof(struct rte_ether_hdr) + sizeof(struct rte_vlan_hdr) ) ;

                ip = (struct rte_ipv4_hdr*) (pkt + sizeof(struct rte_ether_hdr) + sizeof(struct rte_vlan_hdr));

 

 

My expectation is inner header lookup will work because now I moved the inner header in place of outer header position.

But lookup failed could not find the reason for failure.

 

Could any one help on this to solve the issue.

 

Why the table offset is set to 274 to match the IP header fields?

Is mbuf ip header will be at offset 274 always, I know mbuf headroom is 128 byte long

Could any one explain point me the document to refer the offset calculation for mbuf and acl table?

 

 

Regards,

Bala