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

cisco-8000 pfc-wd support #1748

Merged
merged 7 commits into from
Oct 8, 2021
Merged

Conversation

VenkatCisco
Copy link
Contributor

What I did
Add support in sonic-swss for cisco-8000 to detect and recover the port/queue from pfc-wd events.

**Why I did it
Support for cisco-8000 platform for pfc-wd is missing in SONiC

How I verified it
interoperability with a Hardware based Traffic Generator to detect and recover the port/queue using the pfc-wd capability

Details if related

The support does the following:

  • Uses SAI queue attributes for PFC-WD detection and recovery action
  • Queues monitored querying SAI_QUEUE_ATTR_PAUSE_STATUS attribute on PFC-WD config
  • On WD detection, initiate recovery using SAI_QUEUE_ATTR_PFC_DLR_INIT
    : Create PfcWdSaiDlrInitHandler object
    : ASIC configured to DROP packets for the queue
  • When queue is out of pause state for restoration_time, restore queue state
    : ASIC configured to NOT DROP packets for the queue
    : Destroy PfcWdSaiDlrInitHandler object

@lguohan lguohan requested review from abdosi and neethajohn May 18, 2021 19:52
orchagent/pfc_detect_cisco-8000.lua Outdated Show resolved Hide resolved
orchagent/pfc_detect_cisco-8000.lua Show resolved Hide resolved
@VenkatCisco VenkatCisco marked this pull request as ready for review July 23, 2021 00:00
orchagent/pfc_restore_cisco-8000.lua Outdated Show resolved Hide resolved
orchagent/pfc_restore_cisco-8000.lua Show resolved Hide resolved
orchagent/pfcwdorch.cpp Outdated Show resolved Hide resolved
neethajohn pushed a commit to sonic-net/sonic-utilities that referenced this pull request Sep 30, 2021
Disable pfcwd forward action config for cisco-8000.
Do not configure pfcwd if pfc is not configured on a port
This PR is in association with: sonic-net/sonic-swss#1748 where PFC-WD forward action is disabled for cisco-8000 platform.

Signed-off-by: Alpesh S Patel alpesh@cisco.com

What I did
There are two changes of interest:
- disables pfcwd forward action configuration from pfcwd command
- in the pfcwd script, adds a check to enable pfcwd configuration on a port only if it has pfc enabled. If config_db.json has an empty entry like: "pfc_enable" : "", and subsequently pfcwd is configured, swss/orchagent throws an error logs

How to verify it
- can be verified on cisco-8000 platform. It is a no-op for other platforms
# pfcwd start -a forward 400 -r 400
SKIPPED: PFC WD 'forward' action not supported on asic 'cisco-8000'

- for a single port, in /etc/sonic/config_db.json, set no pfc enable bits by setting:
"pfc_enable" :  "" for atleast 1 port.
without this change, see the logs in syslog. With this change, there will just be a log on console.
@neethajohn
Copy link
Contributor

@VenkatCisco, can you please address the comment that was missed?

string restorePluginName = "pfc_restore.lua";
string detectPluginName = "pfc_detect_" + this->m_platform + ".lua";
string restorePluginName;
if (this->m_platform == CISCO_8000_PLATFORM_SUBSTRING) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can this cover both fixed and chassis sub-system ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes for now. If there is any change in future, we will update it here.

@abdosi
Copy link
Contributor

abdosi commented Oct 5, 2021

what about incoming traffic will that get dropped ? will that be handle in separate PR ?

@alpeshspatel
Copy link
Contributor

what about incoming traffic will that get dropped ? will that be handle in separate PR ?

Abishek: there will be a separate PR for Rx traffic drop

@neethajohn
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@VenkatCisco
Copy link
Contributor Author

Requested for 202012

@anamehra
Copy link

Hi @abdosi , please help with double commit to 202012. Thanks

qiluo-msft pushed a commit that referenced this pull request Nov 24, 2021
What I did
Add support in sonic-swss for cisco-8000 to detect and recover the port/queue from pfc-wd events.

**Why I did it
Support for cisco-8000 platform for pfc-wd is missing in SONiC

How I verified it
interoperability with a Hardware based Traffic Generator to detect and recover the port/queue using the pfc-wd capability

Details if related

The support does the following:

Uses SAI queue attributes for PFC-WD detection and recovery action
Queues monitored querying SAI_QUEUE_ATTR_PAUSE_STATUS attribute on PFC-WD config
On WD detection, initiate recovery using SAI_QUEUE_ATTR_PFC_DLR_INIT
: Create PfcWdSaiDlrInitHandler object
: ASIC configured to DROP packets for the queue
When queue is out of pause state for restoration_time, restore queue state
: ASIC configured to NOT DROP packets for the queue
: Destroy PfcWdSaiDlrInitHandler object

Signed-off-by: Venkat Garigipati <venkatg@cisco.com>
yxieca pushed a commit that referenced this pull request Dec 17, 2021
What I did

Enables support for Rx traffic drop for a port/tc by applying the zero buffer profile
Changed class hierarchy so that default getHwCounters() function is used (since the Rx counter support is enabled)
Fixes a pfc-wd off by 1 detection in case of PFC-WD detection without traffic
Why I did it

enabling a missing functionality
leveraging sonic code as our sdk now implements the missing counter
fixes a bug
How I verified it
on a cisco-8000 router:

detected pfc-wd detection and restore happens within the (detection/restore-time + 1 poll interval) duration and that the changeset passes MSFT tests
Verified that when PFC-WD is detected, both Rx and Tx traffic for a port/tc is dropped and no forwarding happens
Details if related

this patch will need to be double committed to the 202012 branch along with #1942 , #1748 and #1962

Signed-off-by: Alpesh S Patel <alpesh@cisco.com>
qiluo-msft pushed a commit that referenced this pull request Dec 20, 2021
What I did

Enables support for Rx traffic drop for a port/tc by applying the zero buffer profile
Changed class hierarchy so that default getHwCounters() function is used (since the Rx counter support is enabled)
Fixes a pfc-wd off by 1 detection in case of PFC-WD detection without traffic
Why I did it

enabling a missing functionality
leveraging sonic code as our sdk now implements the missing counter
fixes a bug
How I verified it
on a cisco-8000 router:

detected pfc-wd detection and restore happens within the (detection/restore-time + 1 poll interval) duration and that the changeset passes MSFT tests
Verified that when PFC-WD is detected, both Rx and Tx traffic for a port/tc is dropped and no forwarding happens
Details if related

this patch will need to be double committed to the 202012 branch along with #1942 , #1748 and #1962

Signed-off-by: Alpesh S Patel <alpesh@cisco.com>
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
preetham-singh pushed a commit to preetham-singh/sonic-swss that referenced this pull request Aug 6, 2022
…00 (sonic-net#2041)

What I did

Enables support for Rx traffic drop for a port/tc by applying the zero buffer profile
Changed class hierarchy so that default getHwCounters() function is used (since the Rx counter support is enabled)
Fixes a pfc-wd off by 1 detection in case of PFC-WD detection without traffic
Why I did it

enabling a missing functionality
leveraging sonic code as our sdk now implements the missing counter
fixes a bug
How I verified it
on a cisco-8000 router:

detected pfc-wd detection and restore happens within the (detection/restore-time + 1 poll interval) duration and that the changeset passes MSFT tests
Verified that when PFC-WD is detected, both Rx and Tx traffic for a port/tc is dropped and no forwarding happens
Details if related

this patch will need to be double committed to the 202012 branch along with sonic-net#1942 , sonic-net#1748 and sonic-net#1962

Signed-off-by: Alpesh S Patel <alpesh@cisco.com>
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.

6 participants