From: Danylo Vodopianov <dvo-...@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-...@napatech.com>
---
 .../profile_inline/flow_api_profile_inline.c         | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git 
a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c 
b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c
index d12bd5a4af..70f9d751c9 100644
--- a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c
+++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c
@@ -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;
 }
-- 
2.47.1

Reply via email to