-
Notifications
You must be signed in to change notification settings - Fork 23
lacp fixes #399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lacp fixes #399
Conversation
📝 WalkthroughWalkthroughThis pull request updates three modules. In bond control, code that added or removed the LACP destination MAC on member interfaces during initialization and cleanup was removed. In port control, MAC validation was split: NULL MACs return EINVAL; multicast MACs return success without modifying filters. In bond output, IPv4 UDP/TCP transmit hashing ignores transport ports for fragmented packets (fragment_offset != 0). Pre-merge checks❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{c,h}⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (4)📚 Learning: 2025-09-09T09:22:31.596ZApplied to files:
📚 Learning: 2025-09-09T06:02:47.703ZApplied to files:
📚 Learning: 2025-09-09T07:36:34.893ZApplied to files:
📚 Learning: 2025-11-05T14:28:28.817ZApplied to files:
🧬 Code graph analysis (1)modules/infra/control/port.c (1)
🔇 Additional comments (3)
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 |
aharivel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good just a nit-pick on the offset flag.
Also, in your commit log you say "Removes LACP multicast MAC filter operations " and
Fixes: f2b09727b0b8 because it adds LACP support right. But it should more fix the commit ec4cbdc7f18f that add the multicast filtering no ?
| ); | ||
| tuple.v4.sport = l4.udp->src_port; | ||
| tuple.v4.dport = l4.udp->dst_port; | ||
| if (l3.ip4->fragment_offset == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fragment_offset field includes both flags (upper 3 bits) and offset (lower 13 bits). Maybe we should be more clearer on what we are testing by using something like:
l3.ip4->fragment_offset & RTE_BE16(RTE_IPV4_HDR_OFFSET_MASK | RTE_IPV4_HDR_MF_FLAG)) == 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I want to consider these flags as well. The first fragment will have offset=0 but will have MF=1 so l3.ip4->fragment_offset != 0 and the ports will not be considered. Otherwise, it would mean subsequent fragments would be output on different bond members.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum: I may disagree this completely closes #397.
While we will have all fragments of a packet on the same link, all packets from the same flow may not be sent on the same link as non-fragmented and fragmented packets will have a different hash.
1st packet: < MTU: we use L4 info to hash --> we will use the info.
2nd packet fragmented --> all packets will have a different hash, ending in a different hash. This packet may be sent on another link.
Did I miss something ?
I don't think this is critical, but may be worth creating a bug. WDYT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that there is no way to guarantee these small and fragmented packets will go through the same output member.
The hash computation is completely stateless:
- First packet is transmitted, we compute the hash on a non-fragment. We can use TCP/UDP ports. We get output port 2.
- Second packet is from the same flow, but too big so it gets fragmented. First fragment gets transmitted, we compute the hash but since it is a fragment, we ignore the TCP/UDP ports. Hash is different: maybe we get a different output port (no guarantee).
- Second fragment is transmitted, it gets the same hash as the first fragment. It gets outputted on the same port as the first fragment.
The only way to solve this issue would be to reassemble but that defeats the purpose of fragmenting the packet in the first place ![]()
Honnestly, I don't think it is a critical issue and since it is not possible to fix it (unless I am mistaken), it may be just worth a comment to indicate that caveat.
What do you think?
Well, the LACP commit came after, so it is the one which introduced the issue. |
aharivel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok LGTM
Since commit ec4cbdc ("port: always enable allmulti and simplify MAC filtering"), filtering multicast addresses is no longer necessary. Allmulti is always enabled. Calling iface_add_eth_addr() with a non-unicast address returns an error. The lacp test fails when doing so: + grcli interface add bond bond0 mode lacp member p0 member p1 member p2 DEBUG: GROUT: bond_init_new_members: adding p0 to bond bond0 ERR: GROUT: bond_init_new_members: iface_add_eth_addr(lacp): Invalid argument (22) error: command failed: Invalid argument (EINVAL) Do not add the LACP multicast address to the port filters. Fixes: f2b0972 ("bond: add lacp support") Signed-off-by: Robin Jarry <[email protected]> Reviewed-by: Anthony Harivel <[email protected]>
Since commit ec4cbdc ("port: always enable allmulti and simplify MAC filtering"), ALLMULTI is always on and adding a multicast address to the mac filter of port causes a hard error. This is a bit excessive. When a multicast address is added/removed to/from a port filter, simply ignore it. Signed-off-by: Robin Jarry <[email protected]> Reviewed-by: Anthony Harivel <[email protected]>
If packets are fragmented, we cannot reliably read the TCP/UDP ports from the layer 4 header, even though ip->proto is TCP/UDP. We would read garbage. If fragment_offset is not 0, ignore the L4 header and assume the ports are 0 like for all other L4 protocols than TCP/UDP. Closes: DPDK#397 Signed-off-by: Robin Jarry <[email protected]> Reviewed-by: Anthony Harivel <[email protected]>
465705d to
d72047f
Compare
Summary by CodeRabbit