Skip to content
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

1.x: backport support for locked ports and fdb entries #461

Merged
merged 8 commits into from
Feb 20, 2025

Conversation

KanjiMonster
Copy link
Contributor

@KanjiMonster KanjiMonster commented Feb 14, 2025

@KanjiMonster KanjiMonster marked this pull request as ready for review February 14, 2025 15:31
@KanjiMonster
Copy link
Contributor Author

KanjiMonster commented Feb 14, 2025

Won't fix the linter complains; this isn't just one line but almost the whole file, and would just pollute the PR. I didn't even touch any of those lines.

@KanjiMonster KanjiMonster marked this pull request as draft February 14, 2025 15:31
@KanjiMonster KanjiMonster force-pushed the jogo_1.x_port_locked branch 2 times, most recently from 6b55fd0 to 1fdf8b8 Compare February 20, 2025 08:55
Update proto for latest ofdpa.proto:

* a3d97dc40faf api: ofdpa: add functions to configure per port learning

Signed-off-by: Jonas Gorski <[email protected]>
(cherry picked from commit ad25680)
Signed-off-by: Jonas Gorski <[email protected]>
Expose the newly added functions for configuring learning on a per port
basis.

To make it more SAI-ish, use the logical SAI states [1]. Since the
default learning behavior isn't covered by any of the states, add an
extra state for that.

[1] https://github.com/opencomputeproject/SAI/blob/5ff3424512031258ed2431b06b64beea5bc36712/inc/saibridge.h#L39

Signed-off-by: Jonas Gorski <[email protected]>
(cherry picked from commit 87b00ee)
Signed-off-by: Jonas Gorski <[email protected]>
To ensure that ports work as expected, initialize learning on connect.

Signed-off-by: Jonas Gorski <[email protected]>
(cherry picked from commit 824632b)
Signed-off-by: Jonas Gorski <[email protected]>
Update learning mode for bridge ports based on lock state, and for bond
ports set the learning mode for all bonded ports.

Signed-off-by: Jonas Gorski <[email protected]>
(cherry picked from commit a299dd3)
Signed-off-by: Jonas Gorski <[email protected]>
With ae62117 ("cnetlink: pass on layer 2 neigh updates"), we make
sure to handle updates only on neighs we support, so we check both old
and new to be usable.

But this misses the transitions where a ll neigh becomes usable due to
updates or vice versa.

Fix this by treating those changes as a new or deleted ll neigh insted
of ignoring it alltogether.

Fixes: ae62117 ("cnetlink: pass on layer 2 neigh updates")
Signed-off-by: Jonas Gorski <[email protected]>
(cherry picked from commit 3b3a65e)
Signed-off-by: Jonas Gorski <[email protected]>
Treat locked fdb entries like they don't exist, so let check_ll_neigh()
also return false for them.

Signed-off-by: Jonas Gorski <[email protected]>
(cherry picked from commit dcab584)
Signed-off-by: Jonas Gorski <[email protected]>
In controller::port_set_move_learn(), we convert the passed enum to
flags, but then pass on the original enum instead to OF-DPA. This sets a
random configuration, which may or may not be what we actually
intentend.

Fix this by passing the correct flags variable.

Fixes: 87b00ee ("ofdpa_client: expose per port learning configuration")
Signed-off-by: Jonas Gorski <[email protected]>
(cherry picked from commit 00ed2ca)
Signed-off-by: Jonas Gorski <[email protected]>
Port nbi_impl::port_notification() is handled in a different thread than
our netlink handling thread, so any gRPC calls it may do will race
against gRPC calls done by the netlink thread, and it seems our gRPC
code is not thread-safe.

So move the port learning setup to cnetlink::link_created(), so that we
avoid parallel gRPC calls.

Fixes broken bond interfaces when setup by systemd-networkd.

Fixes: 824632b ("nbi_impl: initialize learning on connect")
Signed-off-by: Jonas Gorski <[email protected]>
(cherry picked from commit 7170e72)
Signed-off-by: Jonas Gorski <[email protected]>
@KanjiMonster KanjiMonster marked this pull request as ready for review February 20, 2025 13:18
Copy link
Contributor

@ideaship ideaship left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ideaship ideaship merged commit 04eb09a into 1.x Feb 20, 2025
2 of 4 checks passed
@ideaship ideaship deleted the jogo_1.x_port_locked branch February 20, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants