From: Amit Prakash Shukla <amitpraka...@marvell.com>

Increment nb_pattern count to include RTE_FLOW_ITEM_TYPE_END.

Fixes: aebe8cf310cc ("net/cnxk: create flow on representor ports")

Signed-off-by: Amit Prakash Shukla <amitpraka...@marvell.com>
---
V2:
 * Added fixes tag

 drivers/net/cnxk/cnxk_rep_flow.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/cnxk/cnxk_rep_flow.c b/drivers/net/cnxk/cnxk_rep_flow.c
index d26f5aa12c..f1cf81a90c 100644
--- a/drivers/net/cnxk/cnxk_rep_flow.c
+++ b/drivers/net/cnxk/cnxk_rep_flow.c
@@ -171,6 +171,9 @@ populate_vxlan_encap_action_conf(const struct 
rte_flow_action_vxlan_encap *vxlan
        for (; pattern->type != RTE_FLOW_ITEM_TYPE_END; pattern++)
                nb_patterns++;
 
+       /* +1 for RTE_FLOW_ITEM_TYPE_END */
+       nb_patterns++;
+
        len = sizeof(uint64_t);
        rte_memcpy(vxlan_encap_action_data, &nb_patterns, len);
        pattern = vxlan_conf->definition;
-- 
2.18.0

Reply via email to