Skip to content

[macsecorch]: Add IPG adjusting for MACsec gearbox model #1925

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

Merged
merged 7 commits into from
Oct 18, 2021

Conversation

Pterosaur
Copy link
Contributor

@Pterosaur Pterosaur commented Sep 23, 2021

Signed-off-by: Ze Gan [email protected]

What I did
If the MACsec use gearbox model, to adjust the IPG in the system port to the required IPG in the corresponding gearbox at the creating MACsec port stage, and reset the default IPG at the removing MACsec port stage.

Why I did it
Gearbox will increase few bits for MACsec header, if the system port use the default IPG, the gearbox maybe cannot meet the minimum required IPG.

How I verified it
Waiting for a test.

Details if related

Wait for SAI updated to https://github.com/opencomputeproject/SAI/pull/1253/files

@Pterosaur Pterosaur force-pushed the ipg_macsec branch 2 times, most recently from f3359eb to 6697fc2 Compare September 23, 2021 12:44
@Pterosaur Pterosaur changed the title [macsecorch]: Add IPGadjusting for MACsec gearbox model [macsecorch]: Add IPG adjusting for MACsec gearbox model Sep 26, 2021
Signed-off-by: Ze Gan <[email protected]>
Signed-off-by: Ze Gan <[email protected]>
orchagent/port.h Outdated
@@ -28,6 +28,9 @@ extern "C" {

#define VNID_NONE 0xFFFFFFFF

// Default inter-packet gap(IPG) is 96 which is recommended by IEEE 802.3

Choose a reason for hiding this comment

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

Recommend adding 'bits' after 96 in comment line just to be explicit, clear

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, Add it.

SAI_MACSEC_DIRECTION_INGRESS);
});

if (phy)
{
if (!adjustIPG(port, phy->macsec_ipg))
Copy link

Choose a reason for hiding this comment

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

Is IPG is mandatory parameter? I think it should be optional and every platform may not support this. So I feel you may need check here that if config comes from gerarbox then only adjust if not don't attempt to adjustIPG.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sense, fixed it.

attr.id = SAI_PORT_ATTR_IPG;
attr.value.u32 = ipg;

sai_status_t status = sai_port_api->set_port_attribute(port.m_port_id, &attr);
Copy link

Choose a reason for hiding this comment

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

Is this SET operation forwarded to NPU or PHY? IPG is configurable property for the port managed by ASIC right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IPG configuration will be executed by NPU(Switch ASIC). And it should be a configurable property for the port managed by ASIC.

Signed-off-by: Ze Gan <[email protected]>
@Pterosaur Pterosaur force-pushed the ipg_macsec branch 2 times, most recently from 0a292ec to 7ac152a Compare October 11, 2021 02:58
Signed-off-by: Ze Gan <[email protected]>
@Pterosaur Pterosaur marked this pull request as ready for review October 12, 2021 06:05
@Pterosaur Pterosaur requested a review from prsunny as a code owner October 12, 2021 06:05
@Pterosaur Pterosaur requested a review from lguohan October 12, 2021 06:05
@lguohan
Copy link
Contributor

lguohan commented Oct 12, 2021

lack of swss vs test. please add.

Copy link
Contributor

@lguohan lguohan left a comment

Choose a reason for hiding this comment

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

please add swss vs test cases.

@Pterosaur Pterosaur merged commit 452cbc1 into sonic-net:master Oct 18, 2021
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
…9202 (sonic-net#1925)

* [flex counter] Flex counter threads consume too much CPU resources. #9202

Increase the interval up lmit from 30 seconds to 60 seconds

* only modify the interval of watermark counter group

* fix merge conflict

* fix commit issue
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.

4 participants