net/cnxk: enable 3DES-CBC capability
[dpdk.git] / drivers / common / cnxk / roc_nix_tm.c
index ecf3edf..5b70c7b 100644 (file)
@@ -325,14 +325,17 @@ nix_tm_bp_config_set(struct roc_nix *roc_nix, uint16_t sq, uint16_t tc,
        struct mbox *mbox = (&nix->dev)->mbox;
        struct nix_txschq_config *req = NULL;
        struct nix_tm_node_list *list;
+       uint16_t link = nix->tx_link;
        struct nix_tm_node *sq_node;
        struct nix_tm_node *parent;
        struct nix_tm_node *node;
        uint8_t k = 0;
-       uint16_t link;
        int rc = 0;
 
        sq_node = nix_tm_node_search(nix, sq, nix->tm_tree);
+       if (!sq_node)
+               return -ENOENT;
+
        parent = sq_node->parent;
        while (parent) {
                if (parent->lvl == ROC_TM_LVL_SCH2)
@@ -340,9 +343,10 @@ nix_tm_bp_config_set(struct roc_nix *roc_nix, uint16_t sq, uint16_t tc,
 
                parent = parent->parent;
        }
+       if (!parent)
+               return -ENOENT;
 
        list = nix_tm_node_list(nix, tree);
-       link = nix->tx_link;
 
        if (parent->rel_chan != NIX_TM_CHAN_INVALID && parent->rel_chan != tc) {
                rc = -EINVAL;
@@ -1038,10 +1042,8 @@ nix_tm_assign_hw_id(struct nix *nix, struct nix_tm_node *parent,
                        return -EFAULT;
                }
 
-               if (!slab) {
-                       if (!plt_bitmap_scan(bmp, &pos, &slab))
-                               return -ENOENT;
-               }
+               if (!slab)
+                       plt_bitmap_scan(bmp, &pos, &slab);
 
                if (child->priority == parent->rr_prio && spare_schq != -1) {
                        /* Use spare schq first if present */
@@ -1692,6 +1694,10 @@ nix_tm_conf_init(struct roc_nix *roc_nix)
                bmp_mem = PLT_PTR_ADD(bmp_mem, bmp_sz);
        }
 
+       rc = nix_tm_mark_init(nix);
+       if (rc)
+               goto exit;
+
        /* Disable TL1 Static Priority when VF's are enabled
         * as otherwise VF's TL2 reallocation will be needed
         * runtime to support a specific topology of PF.