uint16_t hcapi_type,
uint16_t size,
uint8_t *data,
- uint32_t index)
+ uint32_t index,
+ bool clear_on_read)
{
int rc;
struct hwrm_tf_tbl_type_get_input req = { 0 };
uint8_t fw_session_id;
struct tf_dev_info *dev;
struct tf_session *tfs;
+ uint32_t flags = 0;
/* Retrieve the session information */
rc = tf_session_get_session_internal(tfp, &tfs);
strerror(-rc));
return rc;
}
+ flags = (dir == TF_DIR_TX ?
+ HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX :
+ HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_RX);
+
+ if (clear_on_read)
+ flags |= HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_CLEAR_ON_READ;
/* Populate the request */
req.fw_session_id = tfp_cpu_to_le_32(fw_session_id);
- req.flags = tfp_cpu_to_le_16(dir);
+ req.flags = tfp_cpu_to_le_16(flags);
req.type = tfp_cpu_to_le_32(hcapi_type);
req.index = tfp_cpu_to_le_32(index);
uint32_t starting_idx,
uint16_t num_entries,
uint16_t entry_sz_in_bytes,
- uint64_t physical_mem_addr)
+ uint64_t physical_mem_addr,
+ bool clear_on_read)
{
int rc;
struct tfp_send_msg_parms parms = { 0 };
uint8_t fw_session_id;
struct tf_dev_info *dev;
struct tf_session *tfs;
+ uint32_t flags = 0;
/* Retrieve the session information */
rc = tf_session_get_session(tfp, &tfs);
strerror(-rc));
return rc;
}
+ flags = (dir == TF_DIR_TX ?
+ HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX :
+ HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_RX);
+
+ if (clear_on_read)
+ flags |= HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_CLEAR_ON_READ;
/* Populate the request */
req.fw_session_id = tfp_cpu_to_le_32(fw_session_id);
- req.flags = tfp_cpu_to_le_16(dir);
+ req.flags = tfp_cpu_to_le_16(flags);
req.type = tfp_cpu_to_le_32(hcapi_type);
req.start_index = tfp_cpu_to_le_32(starting_idx);
req.num_entries = tfp_cpu_to_le_32(num_entries);
uint16_t hcapi_type,
uint16_t size,
uint8_t *data,
- uint32_t index);
+ uint32_t index,
+ bool clear_on_read);
/* HWRM Tunneled messages */
uint32_t starting_idx,
uint16_t num_entries,
uint16_t entry_sz_in_bytes,
- uint64_t physical_mem_addr);
+ uint64_t physical_mem_addr,
+ bool clear_on_read);
/**
* Sends Set message of a IF Table Type element to the firmware.
hcapi_type,
parms->data_sz_in_bytes,
parms->data,
- parms->idx);
+ parms->idx,
+ false);
if (rc) {
TFP_DRV_LOG(ERR,
"%s, Get failed, type:%s, rc:%s\n",
parms->starting_idx,
parms->num_entries,
parms->entry_sz_in_bytes,
- parms->physical_mem_addr);
+ parms->physical_mem_addr,
+ false);
if (rc) {
TFP_DRV_LOG(ERR,
"%s, Bulk get failed, type:%s, rc:%s\n",
struct tf_tbl_sram_get_info_parms iparms = { 0 };
struct tf_sram_mgr_is_allocated_parms aparms = { 0 };
void *sram_handle = NULL;
+ bool clear_on_read = false;
TF_CHECK_PARMS3(tfp, parms, parms->data);
strerror(-rc));
return rc;
}
+ if (parms->type == TF_TBL_TYPE_ACT_STATS_64)
+ clear_on_read = true;
/* Get the entry */
rc = tf_msg_get_tbl_entry(tfp,
hcapi_type,
parms->data_sz_in_bytes,
parms->data,
- parms->idx);
+ parms->idx,
+ clear_on_read);
if (rc) {
TFP_DRV_LOG(ERR,
"%s, Get failed, type:%s, rc:%s\n",
struct tf_sram_mgr_is_allocated_parms aparms = { 0 };
bool allocated = false;
void *sram_handle = NULL;
+ bool clear_on_read = false;
TF_CHECK_PARMS2(tfp, parms);
return rc;
}
+ if (parms->type == TF_TBL_TYPE_ACT_STATS_64)
+ clear_on_read = true;
+
/* Get the entries */
rc = tf_msg_bulk_get_tbl_entry(tfp,
parms->dir,
parms->starting_idx,
parms->num_entries,
parms->entry_sz_in_bytes,
- parms->physical_mem_addr);
+ parms->physical_mem_addr,
+ clear_on_read);
if (rc) {
TFP_DRV_LOG(ERR,
"%s, Bulk get failed, type:%s, rc:%s\n",
goto jump_to_error;
}
- if (devid != BNXT_ULP_DEVICE_ID_THOR && BNXT_ACCUM_STATS_EN(bp))
+ /* set the accumulation of the stats */
+ if (BNXT_ACCUM_STATS_EN(bp))
bp->ulp_ctx->cfg_data->accum_stats = true;
BNXT_TF_DBG(DEBUG, "BNXT Port:%d ULP port init, accum_stats:%d\n",