]> git.droids-corp.org - dpdk.git/commitdiff
net/cnxk: allow FC on LBK and enable TM BP on Rx pause
authorNithin Dabilpuram <ndabilpuram@marvell.com>
Tue, 2 Nov 2021 15:54:19 +0000 (21:24 +0530)
committerJerin Jacob <jerinj@marvell.com>
Wed, 3 Nov 2021 15:05:47 +0000 (16:05 +0100)
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>
drivers/net/cnxk/cnxk_ethdev.c
drivers/net/cnxk/cnxk_ethdev_ops.c

index 5059fcaff42ce7c7129b33814e9513c7baca501e..a62ded6b47b7b46dd34cc8a33353743212d32b0c 100644 (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.
index e0696f1ae53d5b8eb675fdb0c982acd0acc1570a..ce5f1f7240297dbaabbba88000095e8c11cbbd7d 100644 (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;