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

[202012] Allowing the first time FEC and AN configuration to be pushed to SAI #1710

Merged
merged 1 commit into from
Apr 16, 2021

Conversation

dgsudharsan
Copy link
Collaborator

What I did
Allowing the first time configuration for FEC and Autoneg to be pushed to SAI even if they are default.

Why I did it
In orchagent, the port struct is pre-initialized with fec = none and autoneg = false (Default SAI values). However in different hardware the underlying implementation might be different. There can also be requirement where the user values need to be forced. In current logic due to the port struct being initialized with default, fec = none or an = false configurations are not pushed from orchagent to SAI. In order to push it even in default case the conditional checks are modified.

How I verified it
Configure FEC as none and autoneg as false and check if ASIC DB is programmed.

Details if related
This change will force the FEC and autoneg configuration only if the configuration is explicitly present. There is no impact when there are no external FEC or autoneg configuration.
If an external FEC or autoneg config is present below are how different boot scenarios will be handled.

Warm boot will not be affected even if an external configuration is present since it will be reconciled. I tested the case and found no link flaps
Fast boot and Cold boot - Only if external configuration is present, it will be programmed during port initialization. No additional link flaps is seen or additional time is taken.

This is the porting of PR #1705 to 202012

@lguohan lguohan requested a review from jleveque April 16, 2021 02:04
@jleveque jleveque changed the title Allowing the first time FEC and AN configuration to be pushed to SAI [202012] Allowing the first time FEC and AN configuration to be pushed to SAI Apr 16, 2021
@jleveque jleveque merged commit 0ad524b into sonic-net:202012 Apr 16, 2021
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
… due to bugs found in poetry-semver (sonic-net#1710)

#### What I did

I replaced underneeth a library which I used for semver functionality.

#### How I did it

Tried to keep existing Version/VersionConstraint API but replaced library used underneeth.
I also added two UT that failed with poetry-semver and show the motivation for this change.

UT description:

- ```test_invalid_version```

This test is to verify that **invalid** semantic version strings are rejected with exception by ```Version.parse```.
E.g. "1.2.3-0123" is not a valid semantic version due to this (https://semver.org/#spec-item-9):
```
A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphens [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes
```

- ```test_version_comparison```

This test checks whether the implementation correctly compare two version strings (this is needed due to the logic that checks if we are upgrading or downgrading). According to https://semver.org/#spec-item-11, "1.0.0-alpha" < "1.0.0".

#### How to verify it

Run UT, run some basic sonic-package-manager commands.
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.

2 participants