Fix PFC related issues
Subsystems (4)
v4 cover Fix PFC related issues
This patchset fixes multiple PFC related issues related to Octeon.
Patch #1: octeontx2-pf: Fix PFC TX scheduler free
Patch #2: octeontx2-af: CN10KB: fix PFC configuration
Patch #3: octeonxt2-pf: Fix backpressure config for multiple PFC priorities to work simultaneously
Hariprasad Kelam (1):
octeontx2-af: CN10KB: fix PFC configuration
Suman Ghosh (2):
octeontx2-pf: Fix PFC TX scheduler free
cteonxt2-pf: Fix backpressure config for multiple PFC priorities to
work simultaneously
---
v4 changes:
Added detailed commit description for patch #2
v3 changes:
Removed patch #1 from v2 patchset due to review comment from Jakub. I will find a more accurate fix for that and will push a separate patch.
v2 changes:
1. Fixed compilation error in patch #2
ERROR: modpost: "otx2_txschq_free_one" [drivers/net/ethernet/marvell/octeontx2/nic/rvu_nicvf.ko] undefined!
2. Added new patch #4 to the patch set. This patch fixes another PFC related issue.
.../net/ethernet/marvell/octeontx2/af/rpm.c | 17 +++++++++-------- .../marvell/octeontx2/nic/otx2_common.c | 1 + .../marvell/octeontx2/nic/otx2_dcbnl.c | 19 ++++++------------- 3 files changed, 16 insertions(+), 21 deletions(-)
Signature · 1 line
2.25.1
PATCH v4 1/3 octeontx2-pf: Fix PFC TX scheduler free
During PFC TX schedulers free, flag TXSCHQ_FREE_ALL was being set which caused free up all schedulers other than the PFC schedulers. This patch fixes that to free only the PFC Tx schedulers.
--- .../ethernet/marvell/octeontx2/nic/otx2_common.c | 1 + .../ethernet/marvell/octeontx2/nic/otx2_dcbnl.c | 15 ++++----------- 2 files changed, 5 insertions(+), 11 deletions(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +1 -0
@@ -804,6 +804,7 @@ void otx2_txschq_free_one(struct otx2_nic *pfvf, u16 lvl, u16 schq)mutex_unlock (&pfvf->mbox.lock); } +EXPORT_SYMBOL (otx2_txschq_free_one);void otx2_txschq_stop (struct otx2_nic *pfvf) {
drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c +4 -11
@@ -125,19 +125,12 @@ int otx2_pfc_txschq_alloc(struct otx2_nic *pfvf)static int otx2_pfc_txschq_stop_one (struct otx2_nic *pfvf,u8 prio) { -struct nix_txsch_free_req *free_req; +int lvl; -mutex_lock (&pfvf->mbox.lock);/* free PFC TLx nodes */ - free_req =otx2_mbox_alloc_msg_nix_txsch_free (&pfvf->mbox); -if (!free_req) { -mutex_unlock (&pfvf->mbox.lock); -return -ENOMEM ; - } - - free_req->flags =TXSCHQ_FREE_ALL ; -otx2_sync_mbox_msg (&pfvf->mbox); -mutex_unlock (&pfvf->mbox.lock); +for (lvl =0 ; lvl < pfvf->hw.txschq_link_cfg_lvl; lvl++) +otx2_txschq_free_one (pfvf, lvl, + pfvf->pfc_schq_list[lvl][prio]); pfvf->pfc_alloc_status[prio] = false;return 0 ;
Signature · 1 line
2.25.1
PATCH v4 2/3 octeontx2-af: CN10KB: fix PFC configuration
In reply to Suman GhoshFrom: Hariprasad Kelam <[email protected]>
Suppose user has enabled pfc with prio 0,1 on a PF netdev(eth0)
dcb pfc set dev eth0 prio-pfc o:on 1:on
later user enabled pfc priorities 2 and 3 on the VF interface(eth1)
dcb pfc set dev eth1 prio-pfc 2:on 3:on
Instead of enabling pfc on all priorities (0..3), the driver only enables on priorities 2,3. This patch corrects the issue by using the proper CSR address.
--- drivers/net/ethernet/marvell/octeontx2/af/rpm.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rpm.c +9 -8
@@ -355,8 +355,8 @@ int rpm_lmac_enadis_pause_frm(void *rpmd, int lmac_id, u8 tx_pause,void rpm_lmac_pause_frm_config (void *rpmd,int lmac_id,bool enable) { +u64 cfg, pfc_class_mask_cfg;rpm_t *rpm = rpmd; -u64 cfg;/* ALL pause frames received are completely ignored */ cfg =rpm_read (rpm, lmac_id,RPMX_MTI_MAC100X_COMMAND_CONFIG );
@@ -380,9 +380,11 @@ void rpm_lmac_pause_frm_config(void *rpmd, int lmac_id, bool enable)rpm_write (rpm,0 ,RPMX_CMR_CHAN_MSK_OR , ~0ULL );/* Disable all PFC classes */ - cfg =rpm_read (rpm, lmac_id,RPMX_CMRX_PRT_CBFC_CTL ); + pfc_class_mask_cfg =is_dev_rpm2 (rpm) ?RPM2_CMRX_PRT_CBFC_CTL : +RPMX_CMRX_PRT_CBFC_CTL ; + cfg =rpm_read (rpm, lmac_id, pfc_class_mask_cfg); cfg =FIELD_SET (RPM_PFC_CLASS_MASK ,0 , cfg); -rpm_write (rpm, lmac_id,RPMX_CMRX_PRT_CBFC_CTL , cfg); +rpm_write (rpm, lmac_id, pfc_class_mask_cfg, cfg); }int rpm_get_rx_stats (void *rpmd,int lmac_id,int idx,u64 *rx_stat)
@@ -605,8 +607,11 @@ int rpm_lmac_pfc_config(void *rpmd, int lmac_id, u8 tx_pause, u8 rx_pause, u16 pif (!is_lmac_valid (rpm, lmac_id))return -ENODEV ; + pfc_class_mask_cfg =is_dev_rpm2 (rpm) ?RPM2_CMRX_PRT_CBFC_CTL : +RPMX_CMRX_PRT_CBFC_CTL ; + cfg =rpm_read (rpm, lmac_id,RPMX_MTI_MAC100X_COMMAND_CONFIG ); - class_en =rpm_read (rpm, lmac_id,RPMX_CMRX_PRT_CBFC_CTL ); + class_en =rpm_read (rpm, lmac_id, pfc_class_mask_cfg); pfc_en |=FIELD_GET (RPM_PFC_CLASS_MASK , class_en);if (rx_pause) {
@@ -635,10 +640,6 @@ int rpm_lmac_pfc_config(void *rpmd, int lmac_id, u8 tx_pause, u8 rx_pause, u16 p cfg |=RPMX_MTI_MAC100X_COMMAND_CONFIG_PFC_MODE ;rpm_write (rpm, lmac_id,RPMX_MTI_MAC100X_COMMAND_CONFIG , cfg); - - pfc_class_mask_cfg =is_dev_rpm2 (rpm) ?RPM2_CMRX_PRT_CBFC_CTL : -RPMX_CMRX_PRT_CBFC_CTL ; -rpm_write (rpm, lmac_id, pfc_class_mask_cfg, class_en);return 0 ;
Signature · 1 line
2.25.1
PATCH v4 3/3 cteonxt2-pf: Fix backpressure config for multiple PFC priorities to work simultaneously
In reply to Suman GhoshMAC (CGX or RPM) asserts backpressure at TL3 or TL2 node of the egress hierarchical scheduler tree depending on link level config done. If there are multiple PFC priorities enabled at a time and for all such flows to backoff, each priority will have to assert backpressure at different TL3/TL2 scheduler nodes and these flows will need to submit egress pkts to these nodes.
Current PFC configuration has an issue where in only one backpressure scheduler node is being allocated which is resulting in only one PFC priority to work. This patch fixes this issue.
--- drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c +3 -3
@@ -70,7 +70,7 @@ static int otx2_pfc_txschq_alloc_one(struct otx2_nic *pfvf, u8 prio)* link config level. These rest of the scheduler can be * same as hw.txschq_list. */ -for (lvl =0 ; lvl < pfvf->hw.txschq_link_cfg_lvl; lvl++) +for (lvl =0 ; lvl <= pfvf->hw.txschq_link_cfg_lvl; lvl++) req->schq[lvl] =1 ; rc =otx2_sync_mbox_msg (&pfvf->mbox);
@@ -83,7 +83,7 @@ static int otx2_pfc_txschq_alloc_one(struct otx2_nic *pfvf, u8 prio)return PTR_ERR (rsp);/* Setup transmit scheduler list */ -for (lvl =0 ; lvl < pfvf->hw.txschq_link_cfg_lvl; lvl++) { +for (lvl =0 ; lvl <= pfvf->hw.txschq_link_cfg_lvl; lvl++) {if (!rsp->schq[lvl])return -ENOSPC ;
@@ -128,7 +128,7 @@ static int otx2_pfc_txschq_stop_one(struct otx2_nic *pfvf, u8 prio)int lvl;/* free PFC TLx nodes */ -for (lvl =0 ; lvl < pfvf->hw.txschq_link_cfg_lvl; lvl++) +for (lvl =0 ; lvl <= pfvf->hw.txschq_link_cfg_lvl; lvl++)otx2_txschq_free_one (pfvf, lvl, pfvf->pfc_schq_list[lvl][prio]);
Signature · 1 line
2.25.1
Quoted 9 lines · Suman Ghosh
This patchset fixes multiple PFC related issues related to Octeon.
Patch #1: octeontx2-pf: Fix PFC TX scheduler free
Patch #2: octeontx2-af: CN10KB: fix PFC configuration
Patch #3: octeonxt2-pf: Fix backpressure config for multiple PFC priorities to work simultaneously
Quoted 7 lines
Hariprasad Kelam (1):
octeontx2-af: CN10KB: fix PFC configurationSuman Ghosh (2):
octeontx2-pf: Fix PFC TX scheduler free
cteonxt2-pf: Fix backpressure config for multiple PFC priorities to
work simultaneously
For series,
Jakub Kicinski
maintainerQuoted 8 lines · On Thu, 24 Aug 2023 13:40:29 +0530 Suman Ghosh wrote:
This patchset fixes multiple PFC related issues related to Octeon.
Patch #1: octeontx2-pf: Fix PFC TX scheduler free
Patch #2: octeontx2-af: CN10KB: fix PFC configuration
Patch #3: octeonxt2-pf: Fix backpressure config for multiple PFC priorities to work simultaneously
Minor note for the future, if you don't mind. Please add the prefix to the subject of the series as well (octeonxt2: ...), that way it's clear what the driver is in all the places which use the subject of the cover letter to identify the series.
Quoted 5 lines
Minor note for the future, if you don't mind.
Please add the prefix to the subject of the series as well (octeonxt2: ...), that way it's clear what the driver is in all the places which use the subject of the cover letter to identify the series.
[Suman] Sure Jakub.
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Thu, 24 Aug 2023 13:40:29 +0530 you wrote:
This patchset fixes multiple PFC related issues related to Octeon.
Patch #1: octeontx2-pf: Fix PFC TX scheduler free
Patch #2: octeontx2-af: CN10KB: fix PFC configuration
Patch #3: octeonxt2-pf: Fix backpressure config for multiple PFC priorities to work simultaneously
[...]
Here is the summary with links:
- [net,V4,1/3] octeontx2-pf: Fix PFC TX scheduler free
https://git.kernel.org/netdev/net/c/a9ac2e187795 - [net,V4,2/3] octeontx2-af: CN10KB: fix PFC configuration https://git.kernel.org/netdev/net/c/47bcc9c1cf6a - [net,V4,3/3] cteonxt2-pf: Fix backpressure config for multiple PFC priorities to work simultaneously https://git.kernel.org/netdev/net/c/597d0ec0e4ca
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html