l4: ensure packet type is set before L4 processing#626
Conversation
The L4 nodes (l4_input_local, l4_loopback_output, ospf_redirect) use mbuf->packet_type to determine whether a packet comes from IPv4 or IPv6. However, the ip_input_local and ip6_input_local nodes never set this field explicitly before forwarding to L4. When the NIC does not classify packets or when the value is stale, L4 nodes cannot determine the correct protocol and drop the packet. Set packet_type to RTE_PTYPE_L3_IPV4 or RTE_PTYPE_L3_IPV6 in each ip*_input_local node before stripping the IP header. Link: DPDK#625 Signed-off-by: Robin Jarry <rjarry@redhat.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adds packet type annotations to the datapath for both IPv4 and IPv6 local input processing. The IPv4 path marks each matched packet as Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The L4 nodes (l4_input_local, l4_loopback_output, ospf_redirect) use mbuf->packet_type to determine whether a packet comes from IPv4 or IPv6. However, the ip_input_local and ip6_input_local nodes never set this field explicitly before forwarding to L4. When the NIC does not classify packets or when the value is stale, L4 nodes cannot determine the correct protocol and drop the packet.
Set packet_type to RTE_PTYPE_L3_IPV4 or RTE_PTYPE_L3_IPV6 in each ip*_input_local node before stripping the IP header.
Link: #625
L4 nodes rely on
mbuf->packet_typeto determine whether packets originate from IPv4 or IPv6. Theip_input_localandip6_input_localnodes did not explicitly set this field before forwarding to L4, causing packets to be dropped when NICs lack packet classification or the value is stale.modules/ip/datapath/ip_local.c: Set
mbuf->packet_typetoRTE_PTYPE_L3_IPV4after populating per-packet metadata fields (src/dst/len/vrf_id/proto/ttl) and before stripping the IPv4 header withrte_pktmbuf_adj().modules/ip6/datapath/ip6_local.c: Set
m->packet_typetoRTE_PTYPE_L3_IPV6when handling L4 protocols (IPPROTO_UDP, IPPROTO_TCP, IPPROTO_SCTP, IPPROTO_DCCP) and before checksum verification.