Home Home > GIT Browse > openSUSE-15.1
diff options
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2019-08-15 18:18:48 +0200
committerThomas Bogendoerfer <tbogendoerfer@suse.de>2019-08-15 18:18:52 +0200
commit83b2f7934612a6cb754828619de14509d7781761 (patch)
parent1c726d3fa7197474a18ab7fa8f4eec8862293cbc (diff)
net/mlx4_core: Zero out lkey field in SW2HW_MPT fw command
2 files changed, 43 insertions, 0 deletions
diff --git a/patches.drivers/net-mlx4_core-Zero-out-lkey-field-in-SW2HW_MPT-fw-co.patch b/patches.drivers/net-mlx4_core-Zero-out-lkey-field-in-SW2HW_MPT-fw-co.patch
new file mode 100644
index 0000000000..4e32fdf0fa
--- /dev/null
+++ b/patches.drivers/net-mlx4_core-Zero-out-lkey-field-in-SW2HW_MPT-fw-co.patch
@@ -0,0 +1,42 @@
+From: Jack Morgenstein <jackm@dev.mellanox.co.il>
+Date: Thu, 15 Nov 2018 18:05:13 +0200
+Subject: net/mlx4_core: Zero out lkey field in SW2HW_MPT fw command
+Patch-mainline: v4.20-rc4
+Git-commit: bd85fbc2038a1bbe84990b23ff69b6fc81a32b2c
+References: bsc#1145678
+When re-registering a user mr, the mpt information for the
+existing mr when running SRIOV is obtained via the QUERY_MPT
+fw command. The returned information includes the mpt's lkey.
+This retrieved mpt information is used to move the mpt back
+to hardware ownership in the rereg flow (via the SW2HW_MPT
+fw command when running SRIOV).
+The fw API spec states that for SW2HW_MPT, the lkey field
+must be zero. Any ConnectX-3 PF driver which checks for strict spec
+adherence will return failure for SW2HW_MPT if the lkey field is not
+zero (although the fw in practice ignores this field for SW2HW_MPT).
+Thus, in order to conform to the fw API spec, set the lkey field to zero
+before invoking SW2HW_MPT when running SRIOV.
+Fixes: e630664c8383 ("mlx4_core: Add helper functions to support MR re-registration")
+Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
+Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
+ drivers/net/ethernet/mellanox/mlx4/mr.c | 1 +
+ 1 file changed, 1 insertion(+)
+--- a/drivers/net/ethernet/mellanox/mlx4/mr.c
++++ b/drivers/net/ethernet/mellanox/mlx4/mr.c
+@@ -363,6 +363,7 @@ int mlx4_mr_hw_write_mpt(struct mlx4_dev
+ container_of((void *)mpt_entry, struct mlx4_cmd_mailbox,
+ buf);
++ (*mpt_entry)->lkey = 0;
+ err = mlx4_SW2HW_MPT(dev, mailbox, key);
+ }
diff --git a/series.conf b/series.conf
index f9796de1fe..2a38515db6 100644
--- a/series.conf
+++ b/series.conf
@@ -20334,6 +20334,7 @@
+ patches.drivers/net-mlx4_core-Zero-out-lkey-field-in-SW2HW_MPT-fw-co.patch