patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Suanming Mou <>
To: Matan Azrad <>,
	Shahaf Shuler <>,
	Viacheslav Ovsiienko <>
Subject: [dpdk-stable] [PATCH v2] net/mlx5: fix incorrect pointer operation in meter
Date: Wed,  8 Jan 2020 12:41:09 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

The meter suffix flow item pointer restore is not correct to decrease
a fixed value. The incorrect operation will cause incorrect match to
the meter suffix flow, the flow create will fail once the magic number
in the wrong offset memory start with RTE_FLOW_ITEM_TYPE_END.
The pointer should decrease the real offset it increases.

Set the decrease value to the real offset the pointer increases to fix
the issue.

Fixes: 9ea9b049a960 ("net/mlx5: split meter flow")

Signed-off-by: Suanming Mou <>
Reported-by: Tonghao Zhang <>

v2: commit message adjust.

 drivers/net/mlx5/mlx5_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index cb9d265..52ffcb2 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -4037,7 +4037,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,
 		sfx_items->type = RTE_FLOW_ITEM_TYPE_END;
-		sfx_items -= METER_SUFFIX_ITEM;
+		sfx_items -= sfx_port_id_item ? 2 : 1;
 		/* Setting the sfx group atrr. */ = sfx_attr.transfer ?

  parent reply	other threads:[~2020-01-08 10:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07  8:56 [dpdk-stable] [PATCH] net/mlx5: fix incorrect pointer operation Suanming Mou
2020-01-07 14:29 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
2020-01-08 10:41 ` Suanming Mou [this message]
2020-01-20 13:08   ` [dpdk-stable] [PATCH v2] net/mlx5: fix incorrect pointer operation in meter Slava Ovsiienko
2020-01-20 14:03   ` Raslan Darawsheh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).