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

LAG LACP & L3 Support #146

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

LAG LACP & L3 Support #146

wants to merge 14 commits into from

Conversation

AkeelAli
Copy link
Contributor

@AkeelAli AkeelAli commented Dec 18, 2024

Adding support for LAG LACP & L3. Addresses #140 and #90.

See the corresponding sections in the LAG HLD for details of the changes in this PR.

@mssonicbld
Copy link

/azp run

Copy link

No pipelines are associated with this pull request.

@AkeelAli AkeelAli mentioned this pull request Dec 18, 2024
@mssonicbld
Copy link

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@mssonicbld
Copy link

/azp run

Copy link

linux-foundation-easycla bot commented Feb 10, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Both SONiC and VPP can run LACP. If we choose to run LACP in VPP, the PortChannel interface in SONiC will not be reported up.
Instead, we need to let SONiC run LACP and instruct VPP to carry SONiC's LACP packets without generating or consuming them.

To achieve this, we can use the VPP [linux-cp plugin](https://s3-docs.fd.io/vpp/22.06/developer/plugins/lcp.html) to mirror packets between the member tap interfaces (on host)
Copy link
Contributor

Choose a reason for hiding this comment

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

mirror means copy. Do we actually do that?

#define SAIVPP_WARN clib_warning
#define SAIVPP_ERROR clib_error
//#define SAIVPP_DEBUG(format,args...) {}
#define SAIVPP_DEBUG(format,args...) clib_warning("PID: %d, TID: %ld, " format, getpid(), syscall(SYS_gettid), ##args)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to enable debug log? Could it be too chatty?

@@ -1159,28 +1164,86 @@ sai_status_t SwitchStateBase:: createLag(

}

uint32_t SwitchStateBase::find_bond_id()
Copy link
Contributor

Choose a reason for hiding this comment

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

probably find_new_bond_id is better.


if (existing_bond_ids.find(bond_id) == existing_bond_ids.end()) {
SWSS_LOG_NOTICE("Found new bond id from PortChannel name: %d", bond_id);
found_new_bond_id = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

what will happen if there are multiple port channel interfaces created? I feel this race condition is real but we don't see any problem with sonic-mgmt test. So probably we just keep this in mind in case weird behavior happens.

}

// Set mode and lb. SONiC config does not have provision to pass mode and load balancing algorithm
mode = VPP_BOND_API_MODE_XOR;
lb = VPP_BOND_API_LB_ALGO_L23;
Copy link
Contributor

Choose a reason for hiding this comment

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

for l3 port channel interface, LB algo should be L34. Can we change the algo when it is assigned?

SWSS_LOG_ENTER();

uint32_t lag_swif_idx = lag_to_bond_if_idx(lag_oid);
SWSS_LOG_NOTICE("lag swif idx :%d",lag_swif_idx);
LAG_MUTEX;
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed?

bool found = getTapNameFromPortId(obj_id, if_name);
bool found = false;
platform_bond_info_t bond_info;
if (objectTypeQuery(obj_id) == SAI_OBJECT_TYPE_LAG) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is it better to incorporate this logic in getTapNameFromPortid?

snprintf(hw_bondifname, sizeof(hw_bondifname), "%s%d", BONDETHERNET_PREFIX, bond_info.id);
hwif_name = hw_bondifname;
} else {
hwif_name = tap_to_hwif_name(if_name.c_str());
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above, is it better to incorporate it in tap_to_hwif_name?

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.

3 participants