if (!vfs)
                return 0;
 
+       /* LBK channel number 63 is used for switching packets between
+        * CGX mapped VFs. Hence limit LBK pairs till 62 only.
+        */
+       if (vfs > 62)
+               vfs = 62;
+
        /* Save VFs number for reference in VF interrupts handlers.
         * Since interrupts might start arriving during SRIOV enablement
         * ordinary API cannot be used to get number of enabled VFs.
 
        size_t                          kpus;
 };
 
+#define RVU_SWITCH_LBK_CHAN    63
+
 struct rvu {
        void __iomem            *afreg_base;
        void __iomem            *pfreg_base;
 
        pfvf_map[schq] = TXSCH_SET_FLAG(pfvf_map[schq], NIX_TXSCHQ_CFG_DONE);
 }
 
+static void rvu_nix_tx_tl2_cfg(struct rvu *rvu, int blkaddr,
+                              u16 pcifunc, struct nix_txsch *txsch)
+{
+       struct rvu_hwinfo *hw = rvu->hw;
+       int lbk_link_start, lbk_links;
+       u8 pf = rvu_get_pf(pcifunc);
+       int schq;
+
+       if (!is_pf_cgxmapped(rvu, pf))
+               return;
+
+       lbk_link_start = hw->cgx_links;
+
+       for (schq = 0; schq < txsch->schq.max; schq++) {
+               if (TXSCH_MAP_FUNC(txsch->pfvf_map[schq]) != pcifunc)
+                       continue;
+               /* Enable all LBK links with channel 63 by default so that
+                * packets can be sent to LBK with a NPC TX MCAM rule
+                */
+               lbk_links = hw->lbk_links;
+               while (lbk_links--)
+                       rvu_write64(rvu, blkaddr,
+                                   NIX_AF_TL3_TL2X_LINKX_CFG(schq,
+                                                             lbk_link_start +
+                                                             lbk_links),
+                                   BIT_ULL(12) | RVU_SWITCH_LBK_CHAN);
+       }
+}
+
 int rvu_mbox_handler_nix_txschq_cfg(struct rvu *rvu,
                                    struct nix_txschq_config *req,
                                    struct msg_rsp *rsp)
                rvu_write64(rvu, blkaddr, reg, regval);
        }
 
+       rvu_nix_tx_tl2_cfg(rvu, blkaddr, pcifunc,
+                          &nix_hw->txsch[NIX_TXSCH_LVL_TL2]);
+
        return 0;
 }
 
 
 {
        int bank = npc_get_bank(mcam, index);
        int kw = 0, actbank, actindex;
+       u8 tx_intf_mask = ~intf & 0x3;
+       u8 tx_intf = intf;
        u64 cam0, cam1;
 
        actbank = bank; /* Save bank id, to set action later on */
         */
        for (; bank < (actbank + mcam->banks_per_entry); bank++, kw = kw + 2) {
                /* Interface should be set in all banks */
+               if (is_npc_intf_tx(intf)) {
+                       /* Last bit must be set and rest don't care
+                        * for TX interfaces
+                        */
+                       tx_intf_mask = 0x1;
+                       tx_intf = intf & tx_intf_mask;
+                       tx_intf_mask = ~tx_intf & tx_intf_mask;
+               }
+
                rvu_write64(rvu, blkaddr,
                            NPC_AF_MCAMEX_BANKX_CAMX_INTF(index, bank, 1),
-                           intf);
+                           tx_intf);
                rvu_write64(rvu, blkaddr,
                            NPC_AF_MCAMEX_BANKX_CAMX_INTF(index, bank, 0),
-                           ~intf & 0x3);
+                           tx_intf_mask);
 
                /* Set the match key */
                npc_get_keyword(entry, kw, &cam0, &cam1);
 
                                struct npc_install_flow_req *req, u16 target)
 {
        struct nix_tx_action action;
+       u64 mask = ~0ULL;
+
+       /* If AF is installing then do not care about
+        * PF_FUNC in Send Descriptor
+        */
+       if (is_pffunc_af(req->hdr.pcifunc))
+               mask = 0;
 
        npc_update_entry(rvu, NPC_PF_FUNC, entry, (__force u16)htons(target),
-                        0, ~0ULL, 0, NIX_INTF_TX);
+                        0, mask, 0, NIX_INTF_TX);
 
        *(u64 *)&action = 0x00;
        action.op = req->op;