patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Viacheslav Ovsiienko <>
Subject: [dpdk-stable] [PATCH v2] net/mlx5: fix metadata item endianness conversion
Date: Fri, 17 Jan 2020 14:59:32 +0000
Message-ID: <> (raw)
In-Reply-To: <>

The mlx5 datapath does not implement any endianness conversions
for the metadata being sent and received to provide the better
performance (because these conversions would be performed for
each packet). These metadata are also involved into flow processing
(there might be some flows matching on metadata patterns or setting
the new metadata values) inside the NIC. It order to configure
hardware in correct way all necessary endianness conversions are
done by rte_flow handling code (only once on flow creation). This
patch fixes one of these conversions for the little-endian hosts
in case if META/MARK items are less than 32 bits.

Fixes: acfcd5c52f94 ("net/mlx5: update meta register matcher set")

Signed-off-by: Viacheslav Ovsiienko <>
Acked-by: Matan Azrad <>
v1: -
v2: - commit message is rewritten

 drivers/net/mlx5/mlx5_flow_dv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index dd21bc6..e8a764c 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -5909,8 +5909,12 @@ struct field_modify_info modify_tcp[] = {
 			struct mlx5_priv *priv = dev->data->dev_private;
 			uint32_t msk_c0 = priv->sh->dv_regc0_mask;
 			uint32_t shl_c0 = rte_bsf32(msk_c0);
+			uint32_t shr_c0 = __builtin_clz(priv->sh->dv_meta_mask);
-			msk_c0 = rte_cpu_to_be_32(msk_c0);
+			value >>= shr_c0;
+			mask >>= shr_c0;
 			value <<= shl_c0;
 			mask <<= shl_c0;

  parent reply	other threads:[~2020-01-17 14:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-24 14:20 [dpdk-stable] [PATCH] " Viacheslav Ovsiienko
2020-01-06 14:44 ` Matan Azrad
2020-01-08  9:03 ` Raslan Darawsheh
2020-01-17 14:59 ` Viacheslav Ovsiienko [this message]
2020-01-17 17:19   ` [dpdk-stable] [PATCH v2] " Ferruh Yigit

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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ \
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone