Instead of relying on value of Flow counter ID to determine validity
have an explicit boolean flag for the same to check and set.
Fixes:
306c2d28e247 ("net/bnxt: support count action in flow query")
Fixes:
9cf9c8385df7 ("net/bnxt: add ULP flow counter manager")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
ulp_fc_info = bnxt_ulp_cntxt_ptr2_fc_info_get(ctxt);
- /* Assuming start_idx of 0 is invalid */
- return (ulp_fc_info->shadow_hw_tbl[dir].start_idx != 0);
+ return ulp_fc_info->shadow_hw_tbl[dir].start_idx_is_set;
}
/*
if (!ulp_fc_info)
return -EIO;
- /* Assuming that 0 is an invalid counter ID ? */
- if (ulp_fc_info->shadow_hw_tbl[dir].start_idx == 0)
+ if (!ulp_fc_info->shadow_hw_tbl[dir].start_idx_is_set) {
ulp_fc_info->shadow_hw_tbl[dir].start_idx = start_idx;
+ ulp_fc_info->shadow_hw_tbl[dir].start_idx_is_set = true;
+ }
return 0;
}
*/
void *mem_pa;
uint32_t start_idx;
+ bool start_idx_is_set;
};
struct bnxt_ulp_fc_info {