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

Update db_migrator to support PORT_QOS_MAP|global #2205

Merged
merged 6 commits into from
Jul 26, 2022

Conversation

bingwang-ms
Copy link
Contributor

Signed-off-by: bingwang wang.bing@microsoft.com

What I did

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 78 items                                                                                                                                                                                    

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

===================================================================================== 78 passed in 26.55 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>
scripts/db_migrator.py Show resolved Hide resolved
@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:52
neethajohn
neethajohn previously approved these changes Jul 15, 2022
@neethajohn
Copy link
Contributor

@stephenxs, please take a final look

@@ -725,6 +742,8 @@ def common_migration_ops(self):
self.migrate_mgmt_ports_on_s6100()
else:
log.log_notice("Asic Type: {}, Hwsku: {}".format(self.asic_type, self.hwsku))

self.migrate_port_qos_map_global()
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this in the common migration path? I thought it should be based on a version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. Please take a look. Thanks

stephenxs
stephenxs previously approved these changes Jul 16, 2022
@stephenxs
Copy link
Collaborator

@stephenxs, please take a final look

LGTM. Approved.

@bingwang-ms bingwang-ms dismissed stale reviews from stephenxs and neethajohn via 610414f July 21, 2022 09:11
@neethajohn neethajohn merged commit cd6898b into sonic-net:master Jul 26, 2022
yxieca pushed a commit that referenced this pull request Jul 28, 2022
Signed-off-by: bingwang <wang.bing@microsoft.com>

What I did
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
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Nov 21, 2022
Signed-off-by: bingwang <wang.bing@microsoft.com>

What I did
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
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.

5 participants