[DRAFT][RFC] L2 announce: add IPv6 support#34983
Conversation
|
cc @borkmann |
9cf1969 to
45bb330
Compare
|
Any input on the open questions? |
🚀
Yes, this LGTM!
Ack, it's odd that this is part of the header guard.
Cc @dylandreimerink for visibility. Imho, looks ok.
Cc @mhofstetter wrt separate cell?
At least not that I can find it as part of #25471 which contains unit tests though. https://github.com/cilium/cilium-cli seems not to have them. |
I think this code isn't that ugly. Writing it some other way would likely end up with more boilerplate.
I think that is a good idea. You can likely reuse a lot of logic. Renaming also seems good to me, just take the Pod L2 announcement use case into account to.
Can confirm there is no E2E testing, only the _test.go and BPF tests. |
|
It looks like the author of the |
ACK. @dylandreimerink Wondering if it's better to add v6 Pod L2 announcement as part of this patchset or in a subsequent PR. Thoughts?
So just to be clear, the only test that exists today is the BPF unit test here, so an addition bpf unit test - already part of this PR - should suffice, correct?
I will give it a try, thx. We only need Gratuitous NAs here, so it should be fairly easy. |
Do not conditionally compile ICMPv6 code based on ENABLE_IPV6, to simplify codebase and be consistent with ARP code. Signed-off-by: Marc Suñé <[email protected]>
bpf code Signed-off-by: Marc Suñé <[email protected]>
Define v6_svc_one and v6_ext_one addresses required by the V6 l2_announce test. Signed-off-by: Marc Suñé <[email protected]>
This commit adds tc_l2_announce6 unit test, to cover IPv6 support for L2 announce. Signed-off-by: Marc Suñé <[email protected]>
control code Signed-off-by: Marc Suñé <[email protected]>
This commit: * Removes l2_announce IPv6 limitation from docs. * Minor cleanup on that page. Signed-off-by: Marc Suñé <[email protected]>
They are independent features, I think its fine to do that in a separate PR |
45bb330 to
c17d882
Compare
|
Commit c17d882 does not match "(?m)^Signed-off-by:". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
|
This pull request has been automatically marked as stale because it |
|
This pull request has not seen any activity since it was marked stale. |
| if e.IP.Is6() { | ||
| err = arMap.Delete(e.IP, uint32(idx)) | ||
| } else { | ||
| err = ndMap.Delete(e.IP, uint32(idx)) | ||
| } |
There was a problem hiding this comment.
Perhaps im misreading this, but you define
arMap := p.params.L2ResponderMap
ndMap := p.params.L2V6ResponderMapshouldn´t this therefore be the other way around?
| if e.IP.Is6() { | |
| err = arMap.Delete(e.IP, uint32(idx)) | |
| } else { | |
| err = ndMap.Delete(e.IP, uint32(idx)) | |
| } | |
| if e.IP.Is6() { | |
| err = ndMap.Delete(e.IP, uint32(idx)) | |
| } else { | |
| err = arMap.Delete(e.IP, uint32(idx)) | |
| } |
There was a problem hiding this comment.
Indeed, thx. I plan to (finally) continue working on this.
| if e.IP.Is6() { | ||
| desiredMap[l2respondermap.L2ResponderKey{ | ||
| IP: types.IPv4(e.IP.As4()), | ||
| IfIndex: uint32(idx), | ||
| }] = desiredEntry{ | ||
| entry: e, | ||
| } | ||
| } else { | ||
| desiredMap6[l2v6respondermap.L2V6ResponderKey{ | ||
| IP: types.IPv6(e.IP.As16()), | ||
| IfIndex: uint32(idx), | ||
| }] = desiredEntry{ | ||
| entry: e, | ||
| } |
There was a problem hiding this comment.
Same thing here, looks like the IPV6/IPV4 logic is inverted
|
Is this PR still in review? |
There will be a follow up PR (final). I didn't have the time just yet to finalise it 😉. These PRs are prep work: |
This (incomplete) patchset adds IPv6 support for L2 announcements, effectively removing one of the Beta limitations of the L2 announce feature.
The PR is in a RFC state, before I get any deeper. In particular, I would like to know if the overall approach makes sense.
Notes:
ENABLE_IPV6to compile (unused when not defined) ICMPv6 code.Missing work:
Questions
l2responder.go. It's a bit ugly with theif(v6) else ...; I am new to golang, and I haven't seen this pattern used in Maps, but would it make sense to have a common interface for bothl2respondermaps?l2responder.go), I am wondering if the best course of action is to take the current garp cell and add the NA part (and probably rename it to something likegneigh/gneigh.go).Thanks