From: Radha Mohan Chintakuntla <rad...@marvell.com>

The SDP interfaces also need to be configured for NIX receive channel
backpressure for packet receive.
Signed-off-by: Radha Mohan Chintakuntla <rad...@marvell.com>
---
 drivers/common/cnxk/roc_nix_fc.c | 11 +++++------
 drivers/net/cnxk/cnxk_ethdev.c   |  3 +++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/common/cnxk/roc_nix_fc.c b/drivers/common/cnxk/roc_nix_fc.c
index 8e31443..a0505bd 100644
--- a/drivers/common/cnxk/roc_nix_fc.c
+++ b/drivers/common/cnxk/roc_nix_fc.c
@@ -38,16 +38,13 @@ nix_fc_rxchan_bpid_set(struct roc_nix *roc_nix, bool enable)
        struct nix_bp_cfg_rsp *rsp;
        int rc = -ENOSPC, i;
 
-       if (roc_nix_is_sdp(roc_nix))
-               return 0;
-
        if (enable) {
                req = mbox_alloc_msg_nix_bp_enable(mbox);
                if (req == NULL)
                        return rc;
 
                req->chan_base = 0;
-               if (roc_nix_is_lbk(roc_nix))
+               if (roc_nix_is_lbk(roc_nix) || roc_nix_is_sdp(roc_nix))
                        req->chan_cnt = NIX_LBK_MAX_CHAN;
                else
                        req->chan_cnt = NIX_CGX_MAX_CHAN;
@@ -203,7 +200,8 @@ nix_fc_cq_config_set(struct roc_nix *roc_nix, struct 
roc_nix_fc_cfg *fc_cfg)
 int
 roc_nix_fc_config_get(struct roc_nix *roc_nix, struct roc_nix_fc_cfg *fc_cfg)
 {
-       if (roc_nix_is_vf_or_sdp(roc_nix) && !roc_nix_is_lbk(roc_nix))
+       if (!roc_nix_is_pf(roc_nix) && !roc_nix_is_lbk(roc_nix) &&
+           !roc_nix_is_sdp(roc_nix))
                return 0;
 
        if (fc_cfg->type == ROC_NIX_FC_CQ_CFG)
@@ -219,7 +217,8 @@ roc_nix_fc_config_get(struct roc_nix *roc_nix, struct 
roc_nix_fc_cfg *fc_cfg)
 int
 roc_nix_fc_config_set(struct roc_nix *roc_nix, struct roc_nix_fc_cfg *fc_cfg)
 {
-       if (roc_nix_is_vf_or_sdp(roc_nix) && !roc_nix_is_lbk(roc_nix))
+       if (!roc_nix_is_pf(roc_nix) && !roc_nix_is_lbk(roc_nix) &&
+           !roc_nix_is_sdp(roc_nix))
                return 0;
 
        if (fc_cfg->type == ROC_NIX_FC_CQ_CFG)
diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
index 1fa4131..bd31a9a 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -310,6 +310,9 @@ nix_init_flow_ctrl_config(struct rte_eth_dev *eth_dev)
        struct cnxk_fc_cfg *fc = &dev->fc_cfg;
        int rc;
 
+       if (roc_nix_is_sdp(&dev->nix))
+               return 0;
+
        /* To avoid Link credit deadlock on Ax, disable Tx FC if it's enabled */
        if (roc_model_is_cn96_ax() &&
            dev->npc.switch_header_type != ROC_PRIV_FLAGS_HIGIG)
-- 
2.8.4

Reply via email to