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

Support ecn on/off on a queue #577

Merged
merged 7 commits into from
Aug 18, 2018
Merged

Support ecn on/off on a queue #577

merged 7 commits into from
Aug 18, 2018

Conversation

wendani
Copy link
Contributor

@wendani wendani commented Aug 15, 2018

The approach is to use "[]" as a CLI signal to unbind wred profile from a queue or a list of queues; Add the parsing and processing logic in qosorch to support such an operation.

With the correct SAI support, we can see asic_db is correctly set to "SAI_QUEUE_ATTR_WRED_PROFILE_ID":"oid:0x0"

"ASIC_STATE:SAI_OBJECT_TYPE_QUEUE:oid:0x15000000000285":{"type":"hash","value":
{"SAI_QUEUE_ATTR_BUFFER_PROFILE_ID":"oid:0x190000000005d6","SAI_QUEUE_ATTR_WRED_PROFILE_ID":"oid:0x0","NULL":"NULL","SAI_QUEUE_ATTR_TYPE":"SAI_QUEUE_TYPE_UNICAST"}}

What I did

Why I did it

How I verified it
Tested on dut

Details if related

@wendani wendani changed the title Support Ecn on/off on a queue Support ecn on/off on a queue Aug 15, 2018
}
}

SWSS_LOG_ERROR("malformed reference:%s. Must contain 1 token or 2 tokens\n", ref_content.c_str());
Copy link
Contributor

Choose a reason for hiding this comment

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

the nested tokenization is a little bit confusing to me. could you add some sample format of the string before tokenization? also, in the line 261, if the tokens.size() is not 2, then anyway it will return false. am i understanding it correctly? then what's the purpose of checking if tokens.size() == 1? I wonder if it is better to parallel the condition checks e.g. if (size == 1) {} else { return false; }.

if (type_it != type_maps.end())
{
type_name = tokens[0];
SWSS_LOG_INFO("Incomplete reference received: type_name:%s, object_name: missing\n", tokens[0].c_str());
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to add '\n' in the log. for the rest of the code not in this pull request that has '\n', it could be removed later.

@sonic-net sonic-net deleted a comment from lguohan Aug 16, 2018
@lguohan
Copy link
Contributor

lguohan commented Aug 16, 2018

retest this please

@lguohan
Copy link
Contributor

lguohan commented Aug 16, 2018

hi wenda, the correct config model here is to delete the attribute.

1) "wred_profile"
2) "[WRED_PROFILE|AZURE_LOSSLESS]"
127.0.0.1:6379[4]> hgetall "QUEUE|Ethernet0,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3-4"
1) "wred_profile"
2) "[WRED_PROFILE|AZURE_LOSSLESS]"
3) "scheduler"
4) "[SCHEDULER|scheduler.0]"

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.

as comments

…ueue or

a list of queues; Add the parsing and processing logic in qosorch to
support such an operation

Signed-off-by: Wenda <wenni@microsoft.com>
	modified:   orchagent/qosorch.cpp
Signed-off-by: Wenda <wenni@microsoft.com>
or a list of queues

Signed-off-by: Wenda <wenni@microsoft.com>
@wendani
Copy link
Contributor Author

wendani commented Aug 17, 2018

hdel is not supported. Use hset with special value '[]' to indicate the user want to unbind the wred profile from a queue

@qiluo-msft
Copy link
Contributor

If you design the special case '[|]', the implementation will be simplified.


In reply to: 413722729 [](ancestors = 413722729)

Copy link
Contributor

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

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

As comments

@wendani
Copy link
Contributor Author

wendani commented Aug 17, 2018

I am not sure if user would be confused by this symbol for the sake of implementation convenience. What does @lguohan think? The symbol was chosen by him yesterday.

#577 (comment)

@lguohan
Copy link
Contributor

lguohan commented Aug 17, 2018

I susgest use '[]'

// clear both type_name and object_name
// as an indication to the caller that
// such a case has been encountered
SWSS_LOG_INFO("special reference:%s.", ref_in.c_str());
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this log, not necessary.

sai_object = (*(type_maps[ref_type_name]))[object_name];
if (ref_type_name.empty() && object_name.empty())
{
sai_object = SAI_NULL_OBJECT_ID;
Copy link
Contributor

Choose a reason for hiding this comment

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

you can return ref_resolve_status::empty here.

@lguohan
Copy link
Contributor

lguohan commented Aug 17, 2018

i have minor comments, looks good.

Signed-off-by: Wenda <wenni@microsoft.com>
@wendani
Copy link
Contributor Author

wendani commented Aug 18, 2018

retest this please

@wendani
Copy link
Contributor Author

wendani commented Aug 18, 2018

retest this please

2 similar comments
@lguohan
Copy link
Contributor

lguohan commented Aug 18, 2018

retest this please

@lguohan
Copy link
Contributor

lguohan commented Aug 18, 2018

retest this please

@lguohan lguohan merged commit cb28e4a into sonic-net:master Aug 18, 2018
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
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.

4 participants