Cleanup some of the log messages in the session open and close paths.
Signed-off-by: Farah Smith <farah.smith@broadcom.com>
Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
return -ENOMEM;
}
- if (!tf_session_is_shared_session(tfs)) {
- /*
- * IF_TBL
- */
- if_tbl_cfg.num_elements = TF_IF_TBL_TYPE_MAX;
- if_tbl_cfg.cfg = tf_if_tbl_p4;
- if_tbl_cfg.shadow_copy = shadow_copy;
- rc = tf_if_tbl_bind(tfp, &if_tbl_cfg);
- if (rc) {
- TFP_DRV_LOG(ERR,
- "IF Table initialization failure\n");
- goto fail;
- }
+ /*
+ * IF_TBL
+ */
+ if_tbl_cfg.num_elements = TF_IF_TBL_TYPE_MAX;
+ if_tbl_cfg.cfg = tf_if_tbl_p4;
+ if_tbl_cfg.shadow_copy = shadow_copy;
+ rc = tf_if_tbl_bind(tfp, &if_tbl_cfg);
+ if (rc) {
+ TFP_DRV_LOG(ERR,
+ "IF Table initialization failure\n");
+ goto fail;
+ }
+ if (!tf_session_is_shared_session(tfs)) {
/*
* GLOBAL_CFG
*/
{
int rc = 0;
bool fail = false;
+ struct tf_session *tfs;
+
+ /* Retrieve the session information */
+ rc = tf_session_get_session_internal(tfp, &tfs);
+ if (rc)
+ return rc;
/* Unbind all the support modules. As this is only done on
* close we only report errors as everything has to be cleaned
fail = true;
}
- rc = tf_if_tbl_unbind(tfp);
- if (rc) {
- TFP_DRV_LOG(INFO,
- "Device unbind failed, IF Table Type\n");
- fail = true;
- }
+ if (!tf_session_is_shared_session(tfs)) {
+ rc = tf_if_tbl_unbind(tfp);
+ if (rc) {
+ TFP_DRV_LOG(INFO,
+ "Device unbind failed, IF Table Type\n");
+ fail = true;
+ }
- rc = tf_global_cfg_unbind(tfp);
- if (rc) {
- TFP_DRV_LOG(INFO,
- "Device unbind failed, Global Cfg Type\n");
- fail = true;
+ rc = tf_global_cfg_unbind(tfp);
+ if (rc) {
+ TFP_DRV_LOG(INFO,
+ "Device unbind failed, Global Cfg Type\n");
+ fail = true;
+ }
}
if (fail)
/*
* IF_TBL
*/
- if (!tf_session_is_shared_session(tfs)) {
- if_tbl_cfg.num_elements = TF_IF_TBL_TYPE_MAX;
- if_tbl_cfg.cfg = tf_if_tbl_p58;
- if_tbl_cfg.shadow_copy = shadow_copy;
- rc = tf_if_tbl_bind(tfp, &if_tbl_cfg);
- if (rc) {
- TFP_DRV_LOG(ERR,
- "IF Table initialization failure\n");
- goto fail;
- }
+ if_tbl_cfg.num_elements = TF_IF_TBL_TYPE_MAX;
+ if_tbl_cfg.cfg = tf_if_tbl_p58;
+ if_tbl_cfg.shadow_copy = shadow_copy;
+ rc = tf_if_tbl_bind(tfp, &if_tbl_cfg);
+ if (rc) {
+ TFP_DRV_LOG(ERR,
+ "IF Table initialization failure\n");
+ goto fail;
+ }
+ if (!tf_session_is_shared_session(tfs)) {
/*
* GLOBAL_CFG
*/
fail = true;
}
- if (!tf_session_is_shared_session(tfs)) {
- rc = tf_if_tbl_unbind(tfp);
- if (rc) {
- TFP_DRV_LOG(ERR,
- "Device unbind failed, IF Table Type\n");
- fail = true;
- }
+ rc = tf_if_tbl_unbind(tfp);
+ if (rc) {
+ TFP_DRV_LOG(ERR,
+ "Device unbind failed, IF Table Type\n");
+ fail = true;
+ }
+ if (!tf_session_is_shared_session(tfs)) {
rc = tf_global_cfg_unbind(tfp);
if (rc) {
TFP_DRV_LOG(ERR,
db_rc[i] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
else
db_rc[i] = tf_rm_create_db(tfp, &db_cfg);
- if (db_rc[i]) {
- TFP_DRV_LOG(ERR,
- "%s: EM Int DB creation failed\n",
- tf_dir_2_str(i));
-
- }
}
/* No db created */
- if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX])
+ if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX]) {
+ TFP_DRV_LOG(ERR, "EM Int DB creation failed\n");
return db_rc[TF_DIR_RX];
+ }
if (!tf_session_is_shared_session(tfs)) {
rc = tf_session_get_db(tfp, TF_MODULE_TYPE_EM, &em_db_ptr);
if (rc) {
- TFP_DRV_LOG(INFO,
- "Em_db is not initialized, rc:%s\n",
- strerror(-rc));
return 0;
}
em_db = (struct em_rm_db *)em_db_ptr;
db_rc[i] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
else
db_rc[i] = tf_rm_create_db(tfp, &db_cfg);
- if (db_rc[i]) {
- TFP_DRV_LOG(INFO,
- "%s: No Identifier DB required\n",
- tf_dir_2_str(i));
- }
if (parms->shadow_copy) {
shadow_cfg.alloc_cnt =
}
/* No db created */
- if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX])
+ 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");
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++) {
/**
* IF Table DBs.
+ * TODO: Store this data in session db
*/
static void *if_tbl_db[TF_DIR_MAX];
-/**
- * IF Table Shadow DBs
- */
-/* static void *shadow_if_tbl_db[TF_DIR_MAX]; */
-
/**
* Init flag, set on bind and cleared on unbind
+ * TODO: Store this data in session db
*/
static uint8_t init;
-/**
- * Shadow init flag, set on bind and cleared on unbind
- */
-/* static uint8_t shadow_init; */
-
/**
* Convert if_tbl_type to hwrm type.
*
{
TF_CHECK_PARMS2(tfp, parms);
- if (init) {
- TFP_DRV_LOG(ERR,
- "IF TBL DB already initialized\n");
- return -EINVAL;
- }
-
if_tbl_db[TF_DIR_RX] = parms->cfg;
if_tbl_db[TF_DIR_TX] = parms->cfg;
}
TFP_DRV_LOG(INFO,
- "Session created, session_client_id:%d, session_id:%d\n",
+ "Session created, session_client_id:%d,"
+ "session_id:0x%08x, fw_session_id:%d\n",
parms->open_cfg->session_client_id.id,
- parms->open_cfg->session_id.id);
+ parms->open_cfg->session_id.id,
+ parms->open_cfg->session_id.internal.fw_session_id);
} else {
scparms.ctrl_chan_name = parms->open_cfg->ctrl_chan_name;
scparms.session_client_id = &parms->open_cfg->session_client_id;
rc = tf_session_client_create(tfp, &scparms);
if (rc) {
TFP_DRV_LOG(ERR,
- "Failed to create client on session %d, rc:%s\n",
+ "Failed to create client on session 0x%x, rc:%s\n",
parms->open_cfg->session_id.id,
strerror(-rc));
return rc;
}
TFP_DRV_LOG(INFO,
- "Session Client:%d created on session:%d\n",
- parms->open_cfg->session_client_id.id,
- parms->open_cfg->session_id.id);
+ "Session Client:%d registered on session:0x%8x\n",
+ scparms.session_client_id->internal.fw_session_client_id,
+ tfp->session->session_id.id);
}
return 0;
client->session_client_id.id);
TFP_DRV_LOG(INFO,
- "session_id:%d, ref_count:%d\n",
+ "session_id:0x%08x, ref_count:%d\n",
tfs->session_id.id,
tfs->ref_count);
tfs->ref_count--;
TFP_DRV_LOG(INFO,
- "Closed session, session_id:%d, ref_count:%d\n",
+ "Closed session, session_id:0x%08x, ref_count:%d\n",
tfs->session_id.id,
tfs->ref_count);
db_rc[d] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
else
db_rc[d] = tf_rm_create_db(tfp, &db_cfg);
- if (db_rc[d]) {
- TFP_DRV_LOG(ERR,
- "%s: No Table DB creation required\n",
- tf_dir_2_str(d));
-
- }
}
/* No db created */
- if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX])
+ if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX]) {
+ TFP_DRV_LOG(ERR,
+ "%s: No Table DB created\n",
+ tf_dir_2_str(d));
return db_rc[TF_DIR_RX];
+ }
TFP_DRV_LOG(INFO,
"Table Type - initialized\n");
TF_CHECK_PARMS1(tfp);
rc = tf_session_get_db(tfp, TF_MODULE_TYPE_TABLE, &tbl_db_ptr);
- if (rc) {
- TFP_DRV_LOG(INFO,
- "Tbl_db is not initialized, rc:%s\n",
- strerror(-rc));
+ if (rc)
return 0;
- }
tbl_db = (struct tbl_rm_db *)tbl_db_ptr;
for (i = 0; i < TF_DIR_MAX; i++) {
db_rc[d] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
else
db_rc[d] = tf_rm_create_db(tfp, &db_cfg);
- if (db_rc[d]) {
- TFP_DRV_LOG(INFO,
- "%s: no TCAM DB required\n",
- tf_dir_2_str(d));
- }
}
/* No db created */
- if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX])
+ if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX]) {
+ TFP_DRV_LOG(ERR, "No TCAM DB created\n");
return db_rc[TF_DIR_RX];
+ }
/* check if reserved resource for WC is multiple of num_slices */
for (d = 0; d < TF_DIR_MAX; d++) {
rc = tf_session_get_db(tfp, TF_MODULE_TYPE_TCAM, &tcam_db_ptr);
if (rc) {
- TFP_DRV_LOG(INFO,
- "Tcam_db is not initialized, rc:%s\n",
- strerror(-rc));
return 0;
}
tcam_db = (struct tcam_rm_db *)tcam_db_ptr;