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

add vrrpmgrd to support FRR-VRRP configuration #3106

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

philo-micas
Copy link

@philo-micas philo-micas commented Apr 8, 2024

@philo-micas
Copy link
Author

@vvbrcm @madhupalu please help review

@@ -5,7 +5,7 @@ LIBNL_LIBS = -lnl-genl-3 -lnl-route-3 -lnl-3
SAIMETA_LIBS = -lsaimeta -lsaimetadata -lzmq
COMMON_LIBS = -lswsscommon -lpthread

bin_PROGRAMS = vlanmgrd teammgrd portmgrd intfmgrd buffermgrd vrfmgrd nbrmgrd vxlanmgrd sflowmgrd natmgrd coppmgrd tunnelmgrd macsecmgrd fabricmgrd
bin_PROGRAMS = vlanmgrd teammgrd portmgrd intfmgrd buffermgrd vrfmgrd nbrmgrd vxlanmgrd sflowmgrd natmgrd coppmgrd tunnelmgrd macsecmgrd fabricmgrd macvlanmgrd
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer vrrpmgrd, looks like we used macvlanmgrd in the HLD, please make the changes if possible.

Copy link
Author

Choose a reason for hiding this comment

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

sonic-net/SONiC#1446 (comment)

As suggested by @nser77, renaming vrrpmgrd to macvlanmgrd would enhance its generality within the whole SONiC architecture, making it more convenient for future functional components to use the macvlan interface type.

Copy link
Contributor

Choose a reason for hiding this comment

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

What future functional components you are referring to here? the whole code is written for VRRP, wondering how you would use this macvlanmgr for other features.

Copy link
Author

Choose a reason for hiding this comment

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

In VRRP, macvlanmgrd manages the configurations of adding, deleting, and addressing for macvlan devices based on VRRP configurations. Although at present only vrrp is using macvlan devices, as long as there is a similar function like VRRP which needs to use macvlan devices, you can subscribe to the corresponding table entries in macvlanmagrd, and then a simple adaptation can realize the unified management of macvlan devices.

Copy link
Contributor

@venkatmahalingam venkatmahalingam Oct 23, 2024

Choose a reason for hiding this comment

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

I'm not convinced with your answer, I don't see any mention of future functional components you are referring to here. You are trying to make the code changes with the assumption that some feature will make use of this macvlanmgrd.
If you really want to have a generic macvlanmgrd, remove VRRP name usage in the files and use it as a generic library so that any future module can use it, today VRRP feature can make use of generic MACVLAN mgr.

All I'm trying to say here is, either have the generic MACVLAN mgr and use it for the VRRP for now or specific VRRP mgr but not mixed.

Copy link
Author

Choose a reason for hiding this comment

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

Yes,you are right. We will use vrrpmgrd and have also submitted the PR for HLD sonic-net/SONiC#1834. Could you please review it. Thanks.

Copy link

Choose a reason for hiding this comment

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

Mmm, I agree with both of you.

string res;

// link add vrrp type macvlan
cmd << IP_CMD << " link add " << shellquote(vrrp_name) << " link " << shellquote(intf_alias) << " type macvlan mode bridge && ";
Copy link

Choose a reason for hiding this comment

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

I believe it will fail if there are some problems while loading the macvlan module - which looks like is done by iproute2 in this case.

Would you prefer to check if the module can be loaded into the kernel before any operations or even manage it apart?

Copy link
Author

Choose a reason for hiding this comment

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

This is a great suggestion. For now, we haven't encountered any issues during our normal validation process. Other components, such as intfmgr and vlanmgr, currently also do not check whether the module is loaded before execution. We can start a new task to implement this code reinforcement for all components in the future.

Copy link

Choose a reason for hiding this comment

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

Hey @philo-micas , thanks for your feedback and point of view.

I haven't checked other modules - really big effort - and yes, I agree that we may want to make a general consideration and evaluation here if also other SONiC's features are relaying over iprouter2 for module load and unload.

Just to expanding a bit more the topic, those operations require the CAP_SYS_MODULE capability. I believe there is an on-going work regarding this - sonic-net/SONiC#1364 - but not sure if this dependency has been identified yet (I see swss container has been retained).

We can start a new task to implement this code reinforcement for all components in the future.

Ok keep me posted plz I'm interested on it and happy to collaborate if possible.

// del vrrp intf
if (vrrp.isValid())
{
if (!delVirtualInterface(intf_alias, vrrp.getVrrpName()))
Copy link

@nmoray nmoray Dec 5, 2024

Choose a reason for hiding this comment

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

IMO, MAC Vlan interface removal needs to be avoided when the VIP list is empty as it is getting removed as soon as the assigned VIPs are removed from the VRRP interface.

Signed-off-by: philo <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Pull request contains merge conflicts.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -0,0 +1,209 @@
import time
import json

Check notice

Code scanning / CodeQL

Unused import Note test

Import of 'json' is not used.
@@ -0,0 +1,209 @@
import time
import json
import pytest

Check notice

Code scanning / CodeQL

Unused import Note test

Import of 'pytest' is not used.
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.

5 participants