]> git.droids-corp.org - dpdk.git/commitdiff
common/cnxk: enable backpressure on CPT with inline inbound
authorNithin Dabilpuram <ndabilpuram@marvell.com>
Tue, 2 Nov 2021 15:54:16 +0000 (21:24 +0530)
committerJerin Jacob <jerinj@marvell.com>
Wed, 3 Nov 2021 15:05:47 +0000 (16:05 +0100)
Enable backpressure on CPT with inline inbound enabled.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/common/cnxk/roc_mbox.h
drivers/common/cnxk/roc_nix_fc.c

index 5dcb4459a6b83856bab9715ae25e0295727a3ade..bf5495dc4906902a3d809d264860df0e18a1a875 100644 (file)
@@ -239,6 +239,10 @@ struct mbox_msghdr {
        M(NIX_BANDPROF_ALLOC, 0x801d, nix_bandprof_alloc,                      \
          nix_bandprof_alloc_req, nix_bandprof_alloc_rsp)                      \
        M(NIX_BANDPROF_FREE, 0x801e, nix_bandprof_free, nix_bandprof_free_req, \
+         msg_rsp)                                                             \
+       M(NIX_CPT_BP_ENABLE, 0x8020, nix_cpt_bp_enable, nix_bp_cfg_req,        \
+         nix_bp_cfg_rsp)                                                      \
+       M(NIX_CPT_BP_DISABLE, 0x8021, nix_cpt_bp_disable, nix_bp_cfg_req,      \
          msg_rsp)
 
 /* Messages initiated by AF (range 0xC00 - 0xDFF) */
index 645325813a7e321cf025bf7a1e268f870f19b045..ca29cd2bf9638f20fc319c659a62f671b425372b 100644 (file)
@@ -70,6 +70,34 @@ nix_fc_rxchan_bpid_set(struct roc_nix *roc_nix, bool enable)
                nix->chan_cnt = 0;
        }
 
+       if (roc_model_is_cn9k())
+               goto exit;
+
+       /* Enable backpressure on CPT if inline inb is enabled */
+       if (enable && roc_nix_inl_inb_is_enabled(roc_nix)) {
+               req = mbox_alloc_msg_nix_cpt_bp_enable(mbox);
+               if (req == NULL)
+                       return rc;
+               req->chan_base = 0;
+               req->chan_cnt = 1;
+               req->bpid_per_chan = 0;
+
+               rc = mbox_process_msg(mbox, (void *)&rsp);
+               if (rc)
+                       goto exit;
+       } else {
+               req = mbox_alloc_msg_nix_cpt_bp_disable(mbox);
+               if (req == NULL)
+                       return rc;
+               req->chan_base = 0;
+               req->chan_cnt = 1;
+               req->bpid_per_chan = 0;
+
+               rc = mbox_process_msg(mbox, (void *)&rsp);
+               if (rc)
+                       goto exit;
+       }
+
 exit:
        return rc;
 }