Blame SOURCES/0160-netdrv-net-mlx5e-Fix-endianness-handling-in-pedit-ma.patch

d8f823
From e1ab0b9cf6e66899078f6c7b44a32c3322f0b4b4 Mon Sep 17 00:00:00 2001
d8f823
From: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Date: Tue, 12 May 2020 10:54:29 -0400
d8f823
Subject: [PATCH 160/312] [netdrv] net/mlx5e: Fix endianness handling in pedit
d8f823
 mask
d8f823
d8f823
Message-id: <20200512105530.4207-64-ahleihel@redhat.com>
d8f823
Patchwork-id: 306935
d8f823
Patchwork-instance: patchwork
d8f823
O-Subject: [RHEL8.3 BZ 1789382 063/124] net/mlx5e: Fix endianness handling in pedit mask
d8f823
Bugzilla: 1789382
d8f823
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
d8f823
RH-Acked-by: Kamal Heib <kheib@redhat.com>
d8f823
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
d8f823
d8f823
Bugzilla: http://bugzilla.redhat.com/1789382
d8f823
Upstream: v5.6
d8f823
d8f823
commit 404402abd5f90aa90a134eb9604b1750c1941529
d8f823
Author: Sebastian Hense <sebastian.hense1@ibm.com>
d8f823
Date:   Thu Feb 20 08:11:36 2020 +0100
d8f823
d8f823
    net/mlx5e: Fix endianness handling in pedit mask
d8f823
d8f823
    The mask value is provided as 64 bit and has to be casted in
d8f823
    either 32 or 16 bit. On big endian systems the wrong half was
d8f823
    casted which resulted in an all zero mask.
d8f823
d8f823
    Fixes: 2b64beba0251 ("net/mlx5e: Support header re-write of partial fields in TC pedit offload")
d8f823
    Signed-off-by: Sebastian Hense <sebastian.hense1@ibm.com>
d8f823
    Reviewed-by: Roi Dayan <roid@mellanox.com>
d8f823
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
d8f823
d8f823
Signed-off-by: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
d8f823
---
d8f823
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 5 +++--
d8f823
 1 file changed, 3 insertions(+), 2 deletions(-)
d8f823
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
d8f823
index 5f56830ab709..2c89f1251354 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
d8f823
@@ -2463,10 +2463,11 @@ static int offload_pedit_fields(struct pedit_headers_action *hdrs,
d8f823
 			continue;
d8f823
 
d8f823
 		if (f->field_bsize == 32) {
d8f823
-			mask_be32 = *(__be32 *)&mas;;
d8f823
+			mask_be32 = (__be32)mask;
d8f823
 			mask = (__force unsigned long)cpu_to_le32(be32_to_cpu(mask_be32));
d8f823
 		} else if (f->field_bsize == 16) {
d8f823
-			mask_be16 = *(__be16 *)&mas;;
d8f823
+			mask_be32 = (__be32)mask;
d8f823
+			mask_be16 = *(__be16 *)&mask_be32;
d8f823
 			mask = (__force unsigned long)cpu_to_le16(be16_to_cpu(mask_be16));
d8f823
 		}
d8f823
 
d8f823
-- 
d8f823
2.13.6
d8f823