octeontx2-pf: Fix coverity and klockwork issues in octeon PF driver
PATCH 1/1 octeontx2-pf: Fix coverity and klockwork issues in octeon PF driver
From: Ratheesh Kannoth <[email protected]>
Fix unintended sign extension and klockwork issues. These are not real issue but for sanity checks.
Signed-off-by Ratheesh Kannoth <[email protected]>
Signed-off-by Suman Ghosh <[email protected]>
--- .../marvell/octeontx2/nic/otx2_common.c | 10 ++-- .../ethernet/marvell/octeontx2/nic/otx2_reg.h | 55 ++++++++++--------- .../marvell/octeontx2/nic/otx2_txrx.c | 2 +- .../net/ethernet/marvell/octeontx2/nic/qos.c | 3 +- 4 files changed, 35 insertions(+), 35 deletions(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +5 -5
@@ -648,14 +648,14 @@ int otx2_txschq_config(struct otx2_nic *pfvf, int lvl, int prio, bool txschq_for }else if (lvl ==NIX_TXSCH_LVL_TL4 ) { parent = schq_list[NIX_TXSCH_LVL_TL3 ][prio]; req->reg[0 ] =NIX_AF_TL4X_PARENT (schq); - req->regval[0 ] = parent <<16 ; + req->regval[0 ] = (u64 )parent <<16 ; req->num_regs++; req->reg[1 ] =NIX_AF_TL4X_SCHEDULE (schq); req->regval[1 ] = dwrr_val; }else if (lvl ==NIX_TXSCH_LVL_TL3 ) { parent = schq_list[NIX_TXSCH_LVL_TL2 ][prio]; req->reg[0 ] =NIX_AF_TL3X_PARENT (schq); - req->regval[0 ] = parent <<16 ; + req->regval[0 ] = (u64 )parent <<16 ; req->num_regs++; req->reg[1 ] =NIX_AF_TL3X_SCHEDULE (schq); req->regval[1 ] = dwrr_val;
@@ -670,11 +670,11 @@ int otx2_txschq_config(struct otx2_nic *pfvf, int lvl, int prio, bool txschq_for }else if (lvl ==NIX_TXSCH_LVL_TL2 ) { parent = schq_list[NIX_TXSCH_LVL_TL1 ][prio]; req->reg[0 ] =NIX_AF_TL2X_PARENT (schq); - req->regval[0 ] = parent <<16 ; + req->regval[0 ] = (u64 )parent <<16 ; req->num_regs++; req->reg[1 ] =NIX_AF_TL2X_SCHEDULE (schq); - req->regval[1 ] =TXSCH_TL1_DFLT_RR_PRIO <<24 | dwrr_val; + req->regval[1 ] = (u64 )hw->txschq_aggr_lvl_rr_prio <<24 | dwrr_val;if (lvl == hw->txschq_link_cfg_lvl) { req->num_regs++;
@@ -698,7 +698,7 @@ int otx2_txschq_config(struct otx2_nic *pfvf, int lvl, int prio, bool txschq_for req->num_regs++; req->reg[1 ] =NIX_AF_TL1X_TOPOLOGY (schq); - req->regval[1 ] = (TXSCH_TL1_DFLT_RR_PRIO <<1 ); + req->regval[1 ] = hw->txschq_aggr_lvl_rr_prio <<1 ; req->num_regs++; req->reg[2 ] =NIX_AF_TL1X_CIR (schq);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_reg.h +28 -27
61 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +1 -1
@@ -513,7 +513,7 @@ static int otx2_tx_napi_handler(struct otx2_nic *pfvf,static void otx2_adjust_adaptive_coalese (struct otx2_nic *pfvf,struct otx2_cq_poll *cq_poll) { -struct dim_sample dim_sample; +struct dim_sample dim_sample = {0 };u64 rx_frames, rx_bytes;u64 tx_frames, tx_bytes;
drivers/net/ethernet/marvell/octeontx2/nic/qos.c +1 -2
@@ -153,7 +153,6 @@ static void __otx2_qos_txschq_cfg(struct otx2_nic *pfvf, num_regs++;otx2_config_sched_shaping (pfvf, node, cfg, &num_regs); - }else if (level ==NIX_TXSCH_LVL_TL4 ) {otx2_config_sched_shaping (pfvf, node, cfg, &num_regs); }else if (level ==NIX_TXSCH_LVL_TL3 ) {
@@ -176,7 +175,7 @@ static void __otx2_qos_txschq_cfg(struct otx2_nic *pfvf,/* check if node is root */ if (node->qid ==OTX2_QOS_QID_INNER && !node->parent) { cfg->reg[num_regs] =NIX_AF_TL2X_SCHEDULE (node->schq); - cfg->regval[num_regs] =TXSCH_TL1_DFLT_RR_PRIO <<24 | + cfg->regval[num_regs] = (u64 )hw->txschq_aggr_lvl_rr_prio <<24 |mtu_to_dwrr_weight (pfvf, pfvf->tx_max_pktlen); num_regs++;
Signature · 1 line
2.25.1
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:
Quoted 9 lines · On Sat, 22 Jun 2024 12:14:37 +0530 you wrote:
From: Ratheesh Kannoth <[email protected]>
Fix unintended sign extension and klockwork issues. These are not real issue but for sanity checks.
Signed-off-by Ratheesh Kannoth <[email protected]>Signed-off-by Suman Ghosh <[email protected]>[...]
Here is the summary with links:
- [net] octeontx2-pf: Fix coverity and klockwork issues in octeon PF driver
https://git.kernel.org/netdev/net/c/02ea312055da
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html