Skip to content

Commit 818ed89

Browse files
Naveen Mamindlapallidavem330
authored andcommitted
octeontx2-af: Re-enable MAC TX in otx2_stop processing
During QoS scheduling testing with multiple strict priority flows, the netdev tx watchdog timeout routine is invoked when a low priority QoS queue doesn't get a chance to transmit the packets because other high priority flows are completely subscribing the transmit link. The netdev tx watchdog timeout routine will stop MAC RX and TX functionality in otx2_stop() routine before cleanup of HW TX queues which results in SMQ flush errors because the packets belonging to low priority queues will never gets flushed since MAC TX is disabled. This patch fixes the issue by re-enabling MAC TX to ensure the packets in HW pipeline gets flushed properly. Fixes: a7faa68 ("octeontx2-af: Start/Stop traffic in CGX along with NPC") Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a0d9528 commit 818ed89

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

drivers/net/ethernet/marvell/octeontx2/af/rvu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,7 @@ u32 rvu_cgx_get_fifolen(struct rvu *rvu);
905905
void *rvu_first_cgx_pdata(struct rvu *rvu);
906906
int cgxlmac_to_pf(struct rvu *rvu, int cgx_id, int lmac_id);
907907
int rvu_cgx_config_tx(void *cgxd, int lmac_id, bool enable);
908+
int rvu_cgx_tx_enable(struct rvu *rvu, u16 pcifunc, bool enable);
908909
int rvu_cgx_prio_flow_ctrl_cfg(struct rvu *rvu, u16 pcifunc, u8 tx_pause, u8 rx_pause,
909910
u16 pfc_en);
910911
int rvu_cgx_cfg_pause_frm(struct rvu *rvu, u16 pcifunc, u8 tx_pause, u8 rx_pause);

drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,23 @@ int rvu_cgx_config_rxtx(struct rvu *rvu, u16 pcifunc, bool start)
465465
return mac_ops->mac_rx_tx_enable(cgxd, lmac_id, start);
466466
}
467467

468+
int rvu_cgx_tx_enable(struct rvu *rvu, u16 pcifunc, bool enable)
469+
{
470+
int pf = rvu_get_pf(pcifunc);
471+
struct mac_ops *mac_ops;
472+
u8 cgx_id, lmac_id;
473+
void *cgxd;
474+
475+
if (!is_cgx_config_permitted(rvu, pcifunc))
476+
return LMAC_AF_ERR_PERM_DENIED;
477+
478+
rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
479+
cgxd = rvu_cgx_pdata(cgx_id, rvu);
480+
mac_ops = get_mac_ops(cgxd);
481+
482+
return mac_ops->mac_tx_enable(cgxd, lmac_id, enable);
483+
}
484+
468485
int rvu_cgx_config_tx(void *cgxd, int lmac_id, bool enable)
469486
{
470487
struct mac_ops *mac_ops;

drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4737,7 +4737,13 @@ int rvu_mbox_handler_nix_lf_stop_rx(struct rvu *rvu, struct msg_req *req,
47374737
pfvf = rvu_get_pfvf(rvu, pcifunc);
47384738
clear_bit(NIXLF_INITIALIZED, &pfvf->flags);
47394739

4740-
return rvu_cgx_start_stop_io(rvu, pcifunc, false);
4740+
err = rvu_cgx_start_stop_io(rvu, pcifunc, false);
4741+
if (err)
4742+
return err;
4743+
4744+
rvu_cgx_tx_enable(rvu, pcifunc, true);
4745+
4746+
return 0;
47414747
}
47424748

47434749
#define RX_SA_BASE GENMASK_ULL(52, 7)

0 commit comments

Comments
 (0)