[PWCI] "[ovs-dev] netdev-dpdk: Remove workarounds for fixed checksum bugs."#16
[PWCI] "[ovs-dev] netdev-dpdk: Remove workarounds for fixed checksum bugs."#16
Conversation
Moving Russell to emeritus status at his request. Thanks, Russell, for all your contributions and support! Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
OVS adds matches on the DF/CSUM/etc bits of the tunnel info flags, but the DF bit is never actually extracted from the outer IP header during the tunnel decapsulation. This is not a huge problem, as we'll only match on what was parsed out, since matching on DF flag is not exposed through OpenFlow to the users. And since the bit is never extracted, we'll just always match on -df, which sort of "works", because the bit is never extracted and so it is never set. However, this causes misleading -df matches in the datapath flow dumps even if the packets actually have the DF bit set, which it is by default. Fix that by actually extracting the bit from the outer header while decapsulating tunneled traffic. Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
net/tap fixes were merged as part of v21.11.6/v22.11.4/v23.11 DPDK LTS versions. A net/txgbe fix was merged as part of v21.11.9/v22.11.7/v23.11.3/v24.11 DPDK LTS versions. We can remove the capability filtering workarounds now that OVS main branch requires at least v24.11. Link: https://git.dpdk.org/dpdk/commit/drivers/net/tap?id=0bbafe48ae0a Link: https://git.dpdk.org/dpdk/commit/drivers/net/txgbe?id=25fe1c780d39 Signed-off-by: David Marchand <david.marchand@redhat.com> Signed-off-by: 0-day Robot <robot@bytheb.org>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR removes obsolete DPDK driver checksum-workarounds in the datapath while improving native tunnel parsing by adding DF-bit support and fixing GRE checksum flag handling, and updates related metadata and test expectations. Entity relationship diagram for updated tunnel metadata flagserDiagram
DP_PACKET ||--o| FLOW_TNL : extracts
FLOW_TNL {
int ip_tos
int ip_ttl
int flags
}
DP_PACKET {
}
FLOW_TNL ||--|{ FLAGS : has
FLAGS {
FLOW_TNL_F_DONT_FRAGMENT
FLOW_TNL_F_CSUM
}
Class diagram for updated netdev_dpdk and tunnel metadata handlingclassDiagram
class netdev_dpdk {
hw_ol_features
+dpdk_eth_dev_init()
}
class dp_packet {
}
class flow_tnl {
ip_tos
ip_ttl
flags
}
netdev_dpdk -- dp_packet : uses
dp_packet -- flow_tnl : extracts metadata
class ip_extract_tnl_md {
+ip_extract_tnl_md(packet, tnl, ...)
}
dp_packet -- ip_extract_tnl_md : used in
ip_extract_tnl_md -- flow_tnl : sets flags
class parse_gre_header {
+parse_gre_header(packet, tnl, ...)
}
dp_packet -- parse_gre_header : used in
parse_gre_header -- flow_tnl : sets flags
flow_tnl : +FLOW_TNL_F_DONT_FRAGMENT
flow_tnl : +FLOW_TNL_F_CSUM
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughThe change updates maintainers metadata, removes DPDK driver-specific TX offload overrides, adjusts tunnel metadata parsing to set DF and preserve flags when GRE CSUM is present, and updates test expectations to reflect DF flag visibility (and some in_port renderings). Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant NIC as NIC
participant PMD as DPDK PMD
participant OVS as OVS netdev
participant TNL as Tunnel Parser
NIC->>PMD: Advertise TX offload capabilities
PMD->>OVS: rte_eth_dev_info (capabilities)
OVS->>OVS: Initialize TX offloads = PMD capabilities
Note over OVS: No driver-specific overrides applied
sequenceDiagram
autonumber
participant RX as Rx Path
participant IP as IPv4 Parser
participant GRE as GRE Parser
participant MD as Tunnel Metadata
RX->>IP: Parse IPv4 header
IP->>MD: Set header fields
IP-->>MD: If IP.DF set → MD.flags |= DF
IP->>GRE: If proto=GRE, parse GRE hdr
GRE->>MD: If GRE_CSUM → MD.flags |= CSUM (preserve existing flags)
GRE->>MD: If KEY present → MD.flags |= KEY
Note over MD: Flags accumulate via OR (DF/CSUM/KEY)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks (1 passed, 2 warnings)❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
Poem
✨ Finishing Touches
🧪 Generate unit tests
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
MAINTAINERS.rst (1)
94-95: Move to Emeritus looks right; minor nit on ordering.Russell Bryant’s entry under Emeritus LGTM. Please ensure the list remains alphabetically sorted by name if that’s the convention in this file.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
MAINTAINERS.rst(1 hunks)lib/netdev-dpdk.c(0 hunks)lib/netdev-native-tnl.c(2 hunks)tests/nsh.at(2 hunks)tests/packet-type-aware.at(8 hunks)tests/tunnel-push-pop.at(1 hunks)
💤 Files with no reviewable changes (1)
- lib/netdev-dpdk.c
🧰 Additional context used
🧬 Code graph analysis (1)
lib/netdev-native-tnl.c (1)
include/sparse/netinet/in.h (1)
htons(158-161)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: freebsd_build COMPILER:clang freebsd_instance:family/freebsd-13-5-snap
- GitHub Check: freebsd_build COMPILER:gcc freebsd_instance:family/freebsd-14-3-snap
- GitHub Check: build oss-fuzz fuzzers
🔇 Additional comments (12)
tests/tunnel-push-pop.at (1)
688-689: Updated tunnel flags expectation (+df-csum+key) matches DF propagation change.This aligns with setting FLOW_TNL_F_DONT_FRAGMENT from the outer IPv4 DF bit. No further changes needed.
lib/netdev-native-tnl.c (2)
155-158: Correct: propagate IPv4 DF into tunnel metadata.Using ‘ip->ip_frag_off & htons(IP_DF)’ and OR-ing FLOW_TNL_F_DONT_FRAGMENT is correct and symmetric with header build logic.
474-474: Fix GRE flag clobbering by OR-ing CSUM.Changing to ‘tnl->flags |= FLOW_TNL_F_CSUM’ preserves previously set flags (e.g., KEY). Good catch.
tests/nsh.at (2)
722-724: NSH over VXLAN: +df-csum+key expectation is consistent.Matches DF flag extraction and checksum preservation. Looks good.
776-779: Follow-on DF flag updates LGTM.The flipped DF bit in subsequent recirc entries is consistent with the parser change.
tests/packet-type-aware.at (7)
327-328: GRE path: switch to flags(+df-csum) and in_port(gre_sys) is correct.Reflects DF propagation and sys GRE port naming in dumps.
345-346: DF flag expectation update LGTM.Keeps consistency across N1→N2 case.
363-364: DF flag expectation update LGTM.Matches reverse-path GRE handling.
381-383: Chained GRE hops: +df-csum updates are correct.Both intermediate and final hop expectations align with new metadata flags.
400-402: L3 GRE decap path: DF flag shown for tunnel flows is correct.Expectation matches IPv4 DF extraction before push/recirc.
419-420: DF flag expectation update LGTM.Consistent with earlier sections.
1018-1020: MPLS-over-GRE recirc: DF flag presence is correct.Dumps showing flags(+df-csum) before and after recirc are as expected.
When vport_add_channel() is called duplicate, the resources for previously
specified sock was not freed. This patch fixes this issue.
Reported by Address Sanitizer.
Direct leak of 60 byte(s) in 3 object(s) allocated from:
#0 0xffffb3658080 in malloc (/usr/lib64/libasan.so.6+0xa9080)
#1 0x922630 in xmalloc__ lib/util.c:141
#2 0x922718 in xmalloc lib/util.c:176
#3 0x9c67e4 in nl_sock_create lib/netlink-socket.c:147
#4 0x94cb6c in create_nl_sock lib/dpif-netlink.c:283
#5 0x950bec in dpif_netlink_port_add__ lib/dpif-netlink.c:978
#6 0x951a20 in dpif_netlink_port_add_compat lib/dpif-netlink.c:1101
#7 0x951cd0 in dpif_netlink_port_add lib/dpif-netlink.c:1147
#8 0x616354 in dpif_port_add lib/dpif.c:602
#9 0x49f424 in port_add ofproto/ofproto-dpif.c:4144
#10 0x44d51c in ofproto_port_add ofproto/ofproto.c:2204
#11 0x416914 in iface_do_create vswitchd/bridge.c:2203
#12 0x416dbc in iface_create vswitchd/bridge.c:2246
#13 0x40e1d0 in bridge_add_ports__ vswitchd/bridge.c:1225
#14 0x40e290 in bridge_add_ports vswitchd/bridge.c:1241
#15 0x40cc6c in bridge_reconfigure vswitchd/bridge.c:952
#16 0x420884 in bridge_run vswitchd/bridge.c:3440
#17 0x42f3d0 in main vswitchd/ovs-vswitchd.c:137
Fixes: 69c5158 ("dpif-netlink: don't allocate per thread netlink sockets")
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
When vport_add_channel() is called duplicate, the resources for previously
specified sock was not freed. This patch fixes this issue.
Reported by Address Sanitizer.
Direct leak of 60 byte(s) in 3 object(s) allocated from:
#0 0xffffb3658080 in malloc (/usr/lib64/libasan.so.6+0xa9080)
#1 0x922630 in xmalloc__ lib/util.c:141
#2 0x922718 in xmalloc lib/util.c:176
#3 0x9c67e4 in nl_sock_create lib/netlink-socket.c:147
#4 0x94cb6c in create_nl_sock lib/dpif-netlink.c:283
#5 0x950bec in dpif_netlink_port_add__ lib/dpif-netlink.c:978
#6 0x951a20 in dpif_netlink_port_add_compat lib/dpif-netlink.c:1101
#7 0x951cd0 in dpif_netlink_port_add lib/dpif-netlink.c:1147
#8 0x616354 in dpif_port_add lib/dpif.c:602
#9 0x49f424 in port_add ofproto/ofproto-dpif.c:4144
#10 0x44d51c in ofproto_port_add ofproto/ofproto.c:2204
#11 0x416914 in iface_do_create vswitchd/bridge.c:2203
#12 0x416dbc in iface_create vswitchd/bridge.c:2246
#13 0x40e1d0 in bridge_add_ports__ vswitchd/bridge.c:1225
#14 0x40e290 in bridge_add_ports vswitchd/bridge.c:1241
#15 0x40cc6c in bridge_reconfigure vswitchd/bridge.c:952
#16 0x420884 in bridge_run vswitchd/bridge.c:3440
#17 0x42f3d0 in main vswitchd/ovs-vswitchd.c:137
Reproduce steps:
ovs-vsctl add-br br-ovs
ovs-vsctl add-port br-ovs test -- set interface test type=internal
ip netns add ns_test
ip link set test netns ns_test
ip netns del ns_test
ifconfig br-ovs up
sleep 1
ifconfig br-ovs down
sleep 1
ovs-vsctl del-br br-ovs
Fixes: 69c5158 ("dpif-netlink: don't allocate per thread netlink sockets")
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
NOTE: This is an auto submission for "[ovs-dev] netdev-dpdk: Remove workarounds for fixed checksum bugs.".
See "http://patchwork.ozlabs.org/project/openvswitch/list/?series=473093" for details.
Summary by Sourcery
Remove obsolete DPDK checksum workarounds and improve native tunnel parsing by handling the IP 'Don't Fragment' bit and preserving existing GRE flags.
New Features:
Enhancements:
Summary by CodeRabbit
Bug Fixes
Refactor
Tests
Chores