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

[orchagent]: Support for setting switch level DSCP to TC QoS map #2023

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

vmittal-msft
Copy link
Contributor

What I did
Added support for setting switch level DSCP to TC QoS map.

Why I did it
This is required to set correct DSCP -> TC QoS map for tunnels else they will point to some default QoS map (DSCP/8 = TC) which is not correct.

How I verified it
This needs SAI change to support this capability. Verified this to be working fine on T0 testbed with mock dual ToR topology.

Details if related

@vmittal-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

@prsunny prsunny left a comment

Choose a reason for hiding this comment

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

we may need some VS test to cover this

@@ -20,7 +21,9 @@ extern sai_qos_map_api_t *sai_qos_map_api;
extern sai_scheduler_group_api_t *sai_scheduler_group_api;
extern sai_switch_api_t *sai_switch_api;
extern sai_acl_api_t* sai_acl_api;
extern bool querySwitchDscpToTcCapability(sai_object_type_t, sai_attr_id_t);
Copy link
Collaborator

Choose a reason for hiding this comment

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

this extern is not required

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function is defined in another file hence added extern.

@@ -12,6 +12,7 @@

using namespace std;

extern sai_switch_api_t *sai_switch_api;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is already done in line 22

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

if (rv == false)
{
SWSS_LOG_ERROR("Switch level DSCP to TC QoS map configuration is not supported");
return false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is it returned from here? IMO, we should check query capability and apply the switch setting if capability is true. Another suggestion is to make it part of applyDscpToTcMapToSwitch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it is true the following code is applying DSCP to TC QoS map at switch.

SWSS_LOG_WARN("Could not query switch level DSCP to TC map %d", status);
return false;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

You have to check capability.set_implemented is true as well, before returning from this function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't check for capability.set_implemented to keep changes in SAI code to minimum. Please let me know if this is still needed.

extern sai_acl_api_t* sai_acl_api;
bool querySwitchDscpToTcCapability(sai_object_type_t, sai_attr_id_t);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove this. It is not required

sai_object_id_t DscpToTcMapHandler::addQosItem(const vector<sai_attribute_t> &attributes)
{
SWSS_LOG_ENTER();
sai_status_t sai_status;
sai_object_id_t sai_object;
vector<sai_attribute_t> qos_map_attrs;
bool rv;
Copy link
Collaborator

Choose a reason for hiding this comment

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

No longer required

@@ -231,6 +262,10 @@ sai_object_id_t DscpToTcMapHandler::addQosItem(const vector<sai_attribute_t> &at
return SAI_NULL_OBJECT_ID;
}
SWSS_LOG_DEBUG("created QosMap object:%" PRIx64, sai_object);


Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove extra line

Signed-off-by: Vineet Mittal <vineetmittal@microsoft.com>
@vmittal-msft
Copy link
Contributor Author

/azp run

1 similar comment
@vmittal-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

@prsunny prsunny left a comment

Choose a reason for hiding this comment

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

lgtm, tests are planned to be added as future commit

@vmittal-msft vmittal-msft merged commit 59cab5d into sonic-net:master Nov 22, 2021
@vmittal-msft vmittal-msft deleted the vmittal/dscp_to_tc branch November 22, 2021 18:47
@qiluo-msft
Copy link
Contributor

This commit could not be cleanly cherry-pick to 202012. Please submit another PR.

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