net/cnxk: allow FC on LBK and enable TM BP on Rx pause

Allow flow control on LBK VF's and enable TM to listen on
backpressure when Rx pause is enabled.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Nithin Dabilpuram 2021-11-02 21:24:19 +05:30 committed by Jerin Jacob
parent 3c3ea76cff
commit dfe5f0a1f5
2 changed files with 19 additions and 7 deletions

View File

@ -332,7 +332,7 @@ nix_update_flow_ctrl_config(struct rte_eth_dev *eth_dev)
struct cnxk_fc_cfg *fc = &dev->fc_cfg;
struct rte_eth_fc_conf fc_cfg = {0};
if (roc_nix_is_vf_or_sdp(&dev->nix))
if (roc_nix_is_vf_or_sdp(&dev->nix) && !roc_nix_is_lbk(&dev->nix))
return 0;
fc_cfg.mode = fc->mode;
@ -1233,6 +1233,11 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)
goto cq_fini;
}
/* Setup Inline security support */
rc = nix_security_setup(dev);
if (rc)
goto cq_fini;
/* Init flow control configuration */
fc_cfg.type = ROC_NIX_FC_RXCHAN_CFG;
fc_cfg.rxchan_cfg.enable = true;
@ -1249,11 +1254,6 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)
goto cq_fini;
}
/* Setup Inline security support */
rc = nix_security_setup(dev);
if (rc)
goto cq_fini;
/*
* Restore queue config when reconfigure followed by
* reconfigure and no queue configure invoked from application case.

View File

@ -251,7 +251,7 @@ cnxk_nix_flow_ctrl_set(struct rte_eth_dev *eth_dev,
uint8_t rx_pause, tx_pause;
int rc, i;
if (roc_nix_is_vf_or_sdp(nix)) {
if (roc_nix_is_vf_or_sdp(nix) && !roc_nix_is_lbk(nix)) {
plt_err("Flow control configuration is not allowed on VFs");
return -ENOTSUP;
}
@ -288,6 +288,18 @@ cnxk_nix_flow_ctrl_set(struct rte_eth_dev *eth_dev,
}
}
/* Check if RX pause frame is enabled or not */
if (fc->rx_pause ^ rx_pause) {
struct roc_nix_fc_cfg fc_cfg;
memset(&fc_cfg, 0, sizeof(struct roc_nix_fc_cfg));
fc_cfg.type = ROC_NIX_FC_TM_CFG;
fc_cfg.tm_cfg.enable = !!rx_pause;
rc = roc_nix_fc_config_set(nix, &fc_cfg);
if (rc)
return rc;
}
rc = roc_nix_fc_mode_set(nix, mode_map[fc_conf->mode]);
if (rc)
return rc;