X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_ulp%2Fulp_mark_mgr.c;h=271520e1d3787e21fc58129a0f5ba6310af1527b;hb=f787952d13d20b7eceaf6d1742ea591239b63ba1;hp=8b8dccf9f147f77487c99ef0db81a0f1e1ba1993;hpb=69975a542616d60e31b324dfa2660b94a61f4a69;p=dpdk.git diff --git a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c index 8b8dccf9f1..271520e1d3 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c @@ -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);