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

zebra: Add link_nsid to zebra interface #12959

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

leonshaw
Copy link
Contributor

@leonshaw leonshaw commented Mar 6, 2023

Add link_nsid to zebra interface, so that the <link_nsid, link_ifindex> pair can uniquely identify the link interface. And VLAN interface is not necessary in the same netns of its parent.

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Mar 6, 2023

Continuous Integration Result: SUCCESSFUL

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-10053/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@donaldsharp
Copy link
Member

After spending a few minutes with this patch, I am having a hard time understanding what the point of this is and what it is really accomplishing. Can you expand on the commit comment to help me understand?

Create VRF and interfaces:

    ip netns add vrf1
    ip link add veth1 index 100 type veth
    ip link add link veth1 veth1.200 type vlan id 200
    ip link set veth1.200 netns vrf1
    ip -n vrf1 link add veth2 index 100 type veth

After reloading zebra, "show interface veth1.200" shows wrong parent
interface:

    test# show interface veth1.200
    Interface veth1.200 is down
      ...
      Parent interface: veth2

This is because veth1.200 and veth1 are in different netns, and veth2
happens to have the same ifindex as veth1, in the same netns of
veth1.200.
When looking for parent, link-ifindex 100 should be looked up within
link-netns, rather than that of the child interface.

Add link_nsid to zebra interface, so that the <link_nsid, link_ifindex>
pair can uniquely identify the link interface.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
@leonshaw leonshaw force-pushed the fix/zif-link-nsid branch from eccbe41 to af19624 Compare March 8, 2023 02:18
@leonshaw
Copy link
Contributor Author

leonshaw commented Mar 8, 2023

@donaldsharp updated. Please see the commit.

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-10087/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@Jafaral
Copy link
Member

Jafaral commented Apr 11, 2023

@Mergifyio backport stable/8.4 stable/8.5

@FRRouting FRRouting deleted a comment from mergify bot Apr 11, 2023
@mergify
Copy link

mergify bot commented Apr 11, 2023

backport stable/8.4 stable/8.5

✅ Backports have been created

@Jafaral Jafaral self-requested a review April 11, 2023 15:37
Copy link
Member

@pguibert6WIND pguibert6WIND left a comment

Choose a reason for hiding this comment

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

it looks logic to me.
I would just to be sure that we really want to offer this new API: if_lookup_by_index_per_nsid().
today, there is one single call.
I would not want to generalize this API.

@Jafaral Jafaral merged commit bd2711d into FRRouting:master Apr 11, 2023
Jafaral added a commit that referenced this pull request Apr 12, 2023
zebra: Add link_nsid to zebra interface (backport #12959)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants