net/ice/base: init flag redirect table for parser
[dpdk.git] / drivers / net / bnxt / tf_ulp / ulp_mark_mgr.c
index 8b8dccf..271520e 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2014-2020 Broadcom
+ * Copyright(c) 2014-2021 Broadcom
  * All rights reserved.
  */
 
@@ -73,6 +73,12 @@ ulp_mark_db_init(struct bnxt_ulp_context *ctxt)
                return -EINVAL;
        }
 
+       if (!dparms->mark_db_lfid_entries || !dparms->mark_db_gfid_entries) {
+               BNXT_TF_DBG(DEBUG, "mark Table is not allocated\n");
+               bnxt_ulp_cntxt_ptr2_mark_db_set(ctxt, NULL);
+               return 0;
+       }
+
        mark_tbl = rte_zmalloc("ulp_rx_mark_tbl_ptr",
                               sizeof(struct bnxt_ulp_mark_tbl), 0);
        if (!mark_tbl)
@@ -182,10 +188,8 @@ ulp_mark_db_mark_get(struct bnxt_ulp_context *ctxt,
                return -EINVAL;
 
        mtbl = bnxt_ulp_cntxt_ptr2_mark_db_get(ctxt);
-       if (!mtbl) {
-               BNXT_TF_DBG(ERR, "Unable to get Mark Table\n");
+       if (!mtbl)
                return -EINVAL;
-       }
 
        idx = ulp_mark_db_idx_get(is_gfid, fid, mtbl);