From: Danylo Vodopianov <dvo-plv@napatech.com>
User should call rte_ring_dequeue_zc_elem_finish to complete the
dequeue operation. However this complete step if record absent.
This change rework queue read operation.
Fixes: 96c8249be53e ("net/ntnic: learn flow queue handling")
Signed-off-by: Danylo Vodopianov <dvo-plv@napatech.com>
---
.../profile_inline/flow_api_profile_inline.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
@@ -398,18 +398,14 @@ static uint32_t flm_lrn_update(struct flow_eth_dev *dev, uint32_t *inf_word_cnt,
uint32_t *sta_word_cnt)
{
read_record r = flm_lrn_queue_get_read_buffer(flm_lrn_queue_arr);
+ uint32_t handled_records = 0;
if (r.num) {
- uint32_t handled_records = 0;
-
- if (hw_mod_flm_lrn_data_set_flush(&dev->ndev->be, HW_FLM_FLOW_LRN_DATA, r.p, r.num,
- &handled_records, inf_word_cnt, sta_word_cnt)) {
+ if (hw_mod_flm_lrn_data_set_flush(&dev->ndev->be, HW_FLM_FLOW_LRN_DATA, r.p,
+ r.num, &handled_records, inf_word_cnt, sta_word_cnt))
NT_LOG(ERR, FILTER, "Flow programming failed");
-
- } else if (handled_records > 0) {
- flm_lrn_queue_release_read_buffer(flm_lrn_queue_arr, handled_records);
- }
}
+ flm_lrn_queue_release_read_buffer(flm_lrn_queue_arr, handled_records);
return r.num;
}