X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_core%2Ftf_identifier.c;h=9f27a41fcff369dde99f21c7ecc4100199f29fb8;hb=c87bd543a8d42ba820870ececa76f1d98057d3ad;hp=ebb975562dd1e13913773eacd173e13fd3f25424;hpb=b97763fc9b28ec5e9c5d7bed7e6244c47476a240;p=dpdk.git diff --git a/drivers/net/bnxt/tf_core/tf_identifier.c b/drivers/net/bnxt/tf_core/tf_identifier.c index ebb975562d..9f27a41fcf 100644 --- a/drivers/net/bnxt/tf_core/tf_identifier.c +++ b/drivers/net/bnxt/tf_core/tf_identifier.c @@ -30,6 +30,7 @@ tf_ident_bind(struct tf *tfp, struct tf_ident_cfg_parms *parms) { int rc; + int db_rc[TF_DIR_MAX] = { 0 }; int i; struct tf_rm_create_db_parms db_cfg = { 0 }; struct tf_shadow_ident_cfg_parms shadow_cfg = { 0 }; @@ -70,16 +71,9 @@ tf_ident_bind(struct tf *tfp, db_cfg.alloc_cnt = parms->resources->ident_cnt[i].cnt; if (tf_session_is_shared_session(tfs) && (!tf_session_is_shared_session_creator(tfs))) - rc = tf_rm_create_db_no_reservation(tfp, &db_cfg); + db_rc[i] = tf_rm_create_db_no_reservation(tfp, &db_cfg); else - rc = tf_rm_create_db(tfp, &db_cfg); - if (rc) { - TFP_DRV_LOG(ERR, - "%s: Identifier DB creation failed\n", - tf_dir_2_str(i)); - - return rc; - } + db_rc[i] = tf_rm_create_db(tfp, &db_cfg); if (parms->shadow_copy) { shadow_cfg.alloc_cnt = @@ -99,6 +93,12 @@ tf_ident_bind(struct tf *tfp, } } + /* No db created */ + if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX]) { + TFP_DRV_LOG(ERR, "No Identifier DB created\n"); + return db_rc[TF_DIR_RX]; + } + TFP_DRV_LOG(INFO, "Identifier - initialized\n"); @@ -118,12 +118,8 @@ tf_ident_unbind(struct tf *tfp) TF_CHECK_PARMS1(tfp); rc = tf_session_get_db(tfp, TF_MODULE_TYPE_IDENTIFIER, &ident_db_ptr); - if (rc) { - TFP_DRV_LOG(INFO, - "Ident_db is not initialized, rc:%s\n", - strerror(-rc)); + if (rc) return 0; - } ident_db = (struct ident_rm_db *)ident_db_ptr; for (i = 0; i < TF_DIR_MAX; i++) {