+
+ /* If this is counter table, clear the entry on free */
+ if (parms->type == TF_TBL_TYPE_ACT_STATS_64) {
+ uint8_t data[8] = { 0 };
+ uint16_t hcapi_type = 0;
+ struct tf_rm_get_hcapi_parms hparms = { 0 };
+
+ /* Get the hcapi type */
+ hparms.rm_db = tbl_db->tbl_db[parms->dir];
+ hparms.subtype = parms->type;
+ hparms.hcapi_type = &hcapi_type;
+ rc = tf_rm_get_hcapi_type(&hparms);
+ if (rc) {
+ TFP_DRV_LOG(ERR,
+ "%s, Failed type lookup, type:%d, rc:%s\n",
+ tf_dir_2_str(parms->dir),
+ parms->type,
+ strerror(-rc));
+ return rc;
+ }
+ /* Clear the counter
+ */
+ rc = tf_msg_set_tbl_entry(tfp,
+ parms->dir,
+ hcapi_type,
+ sizeof(data),
+ data,
+ parms->idx);
+ if (rc) {
+ TFP_DRV_LOG(ERR,
+ "%s, Set failed, type:%d, rc:%s\n",
+ tf_dir_2_str(parms->dir),
+ parms->type,
+ strerror(-rc));
+ return rc;
+ }
+ }
+