-
Notifications
You must be signed in to change notification settings - Fork 558
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
[PFCWD + Asym PFC]: Allow PFCWD to detect PFC storm on all priorities when Asym PFC is enabled #1360
[PFCWD + Asym PFC]: Allow PFCWD to detect PFC storm on all priorities when Asym PFC is enabled #1360
Changes from 9 commits
0f3e9f3
93fb08e
3ab862b
571e991
a6b31ea
acf21f5
0d36d37
53cf04e
a946c21
4837534
9586b6f
1e001f5
d710235
6fd9206
c7f26fc
0c720df
7990b32
13b56d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -393,16 +393,17 @@ PfcWdLossyHandler::PfcWdLossyHandler(sai_object_id_t port, sai_object_id_t queue | |
{ | ||
SWSS_LOG_ENTER(); | ||
|
||
uint8_t pfcMask = 0; | ||
uint8_t pfcTxMask = 0; | ||
uint8_t pfcRxMask = 0; | ||
|
||
if (!gPortsOrch->getPortPfc(port, &pfcMask)) | ||
if (!gPortsOrch->getPortPfc(port, &pfcTxMask, &pfcRxMask)) | ||
{ | ||
SWSS_LOG_ERROR("Failed to get PFC mask on port 0x%" PRIx64, port); | ||
} | ||
|
||
pfcMask = static_cast<uint8_t>(pfcMask & ~(1 << queueId)); | ||
pfcRxMask = static_cast<uint8_t>(pfcRxMask & ~(1 << queueId)); | ||
|
||
if (!gPortsOrch->setPortPfc(port, pfcMask)) | ||
if (!gPortsOrch->setPortPfc(port, pfcTxMask, pfcRxMask)) | ||
{ | ||
SWSS_LOG_ERROR("Failed to set PFC mask on port 0x%" PRIx64, port); | ||
} | ||
|
@@ -412,16 +413,17 @@ PfcWdLossyHandler::~PfcWdLossyHandler(void) | |
{ | ||
SWSS_LOG_ENTER(); | ||
|
||
uint8_t pfcMask = 0; | ||
uint8_t pfcTxMask = 0; | ||
uint8_t pfcRxMask = 0; | ||
|
||
if (!gPortsOrch->getPortPfc(getPort(), &pfcMask)) | ||
if (!gPortsOrch->getPortPfc(getPort(), &pfcTxMask, &pfcRxMask)) | ||
{ | ||
SWSS_LOG_ERROR("Failed to get PFC mask on port 0x%" PRIx64, getPort()); | ||
} | ||
|
||
pfcMask = static_cast<uint8_t>(pfcMask | (1 << getQueueId())); | ||
pfcRxMask = static_cast<uint8_t>(pfcRxMask | (1 << getQueueId())); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to update pfcTxMask as well in combined mode and in asym mode, update pfcTxMask if the queue is one specified in 'pfc_enable' fields of PORT_QOS_MAP |
||
|
||
if (!gPortsOrch->setPortPfc(getPort(), pfcMask)) | ||
if (!gPortsOrch->setPortPfc(getPort(), pfcTxMask, pfcRxMask)) | ||
{ | ||
SWSS_LOG_ERROR("Failed to set PFC mask on port 0x%" PRIx64, getPort()); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,13 @@ struct SystemLagInfo | |
int32_t spa_id = 0; | ||
}; | ||
|
||
struct PfcInfo | ||
{ | ||
sai_port_priority_flow_control_mode_t pfc_mode = SAI_PORT_PRIORITY_FLOW_CONTROL_MODE_COMBINED; | ||
uint8_t pfc_tx_bitmask = 0; | ||
uint8_t pfc_rx_bitmask = 0; | ||
}; | ||
|
||
class Port | ||
{ | ||
public: | ||
|
@@ -134,6 +141,7 @@ class Port | |
std::vector<sai_object_id_t> m_priority_group_ids; | ||
sai_port_priority_flow_control_mode_t m_pfc_asym = SAI_PORT_PRIORITY_FLOW_CONTROL_MODE_COMBINED; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have two variable for save port priority flow control mode: |
||
uint8_t m_pfc_bitmask = 0; | ||
PfcInfo m_pfc_info; | ||
uint16_t m_tpid = DEFAULT_TPID; | ||
uint32_t m_nat_zone_id = 0; | ||
uint32_t m_vnid = VNID_NONE; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In normal mode, when pfcwd is triggered, we reset the bit corresponding to that queueId in the 'pfcMask'. The new logic in L404 does it only for 'pfcRxMask'. In 'setPortPfc' func, the new condition in L1076 (check if txmask and rxmask are not the same in combined mode) will evaluate to true and we will return false.
We will need to modify pfcTxMask as well here for combined mode
Also in asym mode, when any of the queues specified in the pfc_enable field of PORT_QOS_MAP is in storm, we need to disable pfc for that queue. so pfcTxMask needs to be updated for that case as well.