size_t copy_nbytes;
uint32_t ulp_dev_id = BNXT_ULP_DEVICE_ID_LAST;
int32_t rc = 0;
+ uint8_t app_id;
/* only perform this if shared session is enabled. */
if (!bnxt_ulp_cntxt_shared_session_enabled(bp->ulp_ctx))
if (rc)
return rc;
+ rc = bnxt_ulp_cntxt_app_id_get(bp->ulp_ctx, &app_id);
+ if (rc) {
+ BNXT_TF_DBG(ERR, "Unable to get the app id from ulp.\n");
+ return -EINVAL;
+ }
+
rc = bnxt_ulp_cntxt_dev_id_get(bp->ulp_ctx, &ulp_dev_id);
if (rc) {
BNXT_TF_DBG(ERR, "Unable to get device id from ulp.\n");
parms.shadow_copy = true;
parms.bp = bp;
+ if (app_id == 0 || app_id == 3)
+ parms.wc_num_slices = TF_WC_TCAM_2_SLICE_PER_ROW;
+ else
+ parms.wc_num_slices = TF_WC_TCAM_1_SLICE_PER_ROW;
/*
* Open the session here, but the collect the resources during the
struct tf_open_session_parms params;
struct tf_session_resources *resources;
uint32_t ulp_dev_id = BNXT_ULP_DEVICE_ID_LAST;
+ uint8_t app_id;
memset(¶ms, 0, sizeof(params));
params.shadow_copy = true;
+ rc = bnxt_ulp_cntxt_app_id_get(bp->ulp_ctx, &app_id);
+ if (rc) {
+ BNXT_TF_DBG(ERR, "Unable to get the app id from ulp.\n");
+ return -EINVAL;
+ }
+
rc = bnxt_ulp_cntxt_dev_id_get(bp->ulp_ctx, &ulp_dev_id);
if (rc) {
BNXT_TF_DBG(ERR, "Unable to get device id from ulp.\n");
return rc;
params.bp = bp;
+ if (app_id == 0 || app_id == 3)
+ params.wc_num_slices = TF_WC_TCAM_2_SLICE_PER_ROW;
+ else
+ params.wc_num_slices = TF_WC_TCAM_1_SLICE_PER_ROW;
+
rc = tf_open_session(&bp->tfp, ¶ms);
if (rc) {
BNXT_TF_DBG(ERR, "Failed to open TF session - %s, rc = %d\n",
BNXT_TF_DBG(ERR, "Unable to set app_id for ULP init.\n");
goto error_deinit;
}
+ BNXT_TF_DBG(DEBUG, "Ulp initialized with app id %d\n", bp->app_id);
rc = bnxt_ulp_cntxt_app_caps_init(bp->ulp_ctx, bp->app_id, devid);
if (rc) {
if (rc)
goto error_deinit;
- ulp_tun_tbl_init(ulp_data->tun_tbl);
-
bnxt_ulp_cntxt_tfp_set(bp->ulp_ctx, &bp->tfp);
return rc;
dparms->ext_flow_db_num_entries = bp->max_num_kflows * 1024;
/* GFID = 2 * num_flows */
dparms->mark_db_gfid_entries = dparms->ext_flow_db_num_entries * 2;
- BNXT_TF_DBG(DEBUG, "Set the number of flows = %"PRIu64"\n",
+ BNXT_TF_DBG(DEBUG, "Set the number of flows = %" PRIu64 "\n",
dparms->ext_flow_db_num_entries);
return 0;
}
if (!BNXT_TRUFLOW_EN(bp)) {
- BNXT_TF_DBG(DEBUG,
+ BNXT_TF_DBG(ERR,
"Skip ulp init for port: %d, truflow is not enabled\n",
bp->eth_dev->data->port_id);
return rc;
}
if (!BNXT_TRUFLOW_EN(bp)) {
- BNXT_TF_DBG(DEBUG,
+ BNXT_TF_DBG(ERR,
"Skip ULP deinit for port:%d, truflow is not enabled\n",
bp->eth_dev->data->port_id);
return;
struct ulp_context_list_entry *entry, *temp;
rte_spinlock_lock(&bnxt_ulp_ctxt_lock);
- TAILQ_FOREACH_SAFE(entry, &ulp_cntx_list, next, temp) {
+ RTE_TAILQ_FOREACH_SAFE(entry, &ulp_cntx_list, next, temp) {
if (entry->ulp_ctx == ulp_ctx) {
TAILQ_REMOVE(&ulp_cntx_list, entry, next);
rte_free(entry);
{
rte_spinlock_unlock(&bnxt_ulp_ctxt_lock);
}
+
+/* Function to get the app tunnel details from the ulp context. */
+struct bnxt_flow_app_tun_ent *
+bnxt_ulp_cntxt_ptr2_app_tun_list_get(struct bnxt_ulp_context *ulp)
+{
+ if (!ulp || !ulp->cfg_data)
+ return NULL;
+
+ return ulp->cfg_data->app_tun;
+}