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] [cherry-pick] Update db_migrator to support PORT_QOS_MAP|global #2215

Merged

Conversation

bingwang-ms
Copy link
Contributor

What I did

This PR is to cherry-pick #2205 into 202012 branch after resolving conflicts.

This PR is to update the db_migrator to support generation of PORT_QOS_MAP|global.

After PR sonic-net/sonic-buildimage#10565, there will be two DSCP_TO_TC_MAP

  • DSCP_TO_TC_MAP|AZURE is the default map, which is used at port level and switch level
  • DSCP_TO_TC_MAP|AZURE_TUNNEL is used to remap the priority of tunnel traffic in dualtor deployment

To address the issue, an entry PORT_QOS_MAP|global will be added into config_db

"PORT_QOS_MAP": {
        "global": {
            "dscp_to_tc_map": "AZURE"
        }
}

To handle the upgrade from older image, db_migrator is updated to generate the entry.
There is no way to check if PORT_QOS_MAP|global is supported, so the migration is ran on all platforms. There is check in sonic-swss to check the switch capability code, so it will not cause issue.

How I did it

Update db_migrator to add a common migration step.

How to verify it

Verified by vstest

collected 76 items                                                                                                                                                                                    

tests/db_migrator_test.py ............................................................................                                                                                          [100%]

===================================================================================== 76 passed in 18.26 seconds ======================================================================================

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

Signed-off-by: bingwang <wang.bing@microsoft.com>
Signed-off-by: bingwang <wang.bing@microsoft.com>
@stephenxs
Copy link
Collaborator

Comment left on the original PR #2205 is also applicable here.

@bingwang-ms bingwang-ms marked this pull request as draft July 7, 2022 10:49
scripts/db_migrator.py Outdated Show resolved Hide resolved
scripts/db_migrator.py Outdated Show resolved Hide resolved
tests/db_migrator_test.py Show resolved Hide resolved
@bingwang-ms bingwang-ms marked this pull request as ready for review July 15, 2022 07:49
@bingwang-ms
Copy link
Contributor Author

Comment left on the original PR #2205 is also applicable here.

Thanks. I address the issue by checking the ASIC type. The table is only generated on one platform now. Also a test scenario is added to cover that.

@neethajohn neethajohn requested a review from prsunny July 21, 2022 17:34
@bingwang-ms bingwang-ms merged commit 1f693e5 into sonic-net:202012 Jul 26, 2022
vaibhavhd added a commit to sonic-net/sonic-buildimage that referenced this pull request Aug 2, 2022
…11558)

To include latest warmboot fixes:

[202012] [cherry-pick] Update db_migrator to support `PORT_QOS_MAP|gl (sonic-net/sonic-utilities/pull/2215)
[202012] Migrate missed config on cross branch warm upgrade to 202012 (sonic-net/sonic-utilities#2277)
[202012] Add db_migrator_constants.py script to setup.py (sonic-net/sonic-utilities#2287)
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