From: "bala krishnan.k" <balki.ece@gmail.com>
To: dev@dpdk.org, users@dpdk.org
Subject: v4_acl lookup failed after rte_pktmbuf_adj in dpdk pipeline
Date: Fri, 30 Aug 2024 13:44:40 +0530 [thread overview]
Message-ID: <CAGUQFCDEgsB5o6cGLYN_OZA6CZW-PN6RM9vYNMgbXsTbqrdSTQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 7837 bytes --]
next reply other threads:[~2024-08-30 11:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 8:14 bala krishnan.k [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-08-30 5:35 Balakrishnan K
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGUQFCDEgsB5o6cGLYN_OZA6CZW-PN6RM9vYNMgbXsTbqrdSTQ@mail.gmail.com \
--to=balki.ece@gmail.com \
--cc=dev@dpdk.org \
--cc=users@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).