All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-rc] IB/mlx5: Replace tunnel mpls capability bits for tunnel_offloads
@ 2020-03-05 12:38 Leon Romanovsky
  2020-03-07 23:20 ` Sasha Levin
  2020-03-10 18:10 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Leon Romanovsky @ 2020-03-05 12:38 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Alex Vesker, Ariel Levkovich, linux-rdma, Mark Bloch, netdev,
	Saeed Mahameed

From: Alex Vesker <valex@mellanox.com>

Until now flex parser was used in ib_query_device to indicate
tunnel_offloads_caps support for mpls_over_gre/mpls_over_udp.
These inaccurate capability bits will not work on newer devices.

This should not brake backward compatibility since tunnel_stateless
caps and flex_parser_protocols caps were added together.

Cc: <stable@vger.kernel.org> # 4.17
Fixes: e818e255a58d ("IB/mlx5: Expose MPLS related tunneling offloads")
Signed-off-by: Alex Vesker <valex@mellanox.com>
Reviewed-by: Ariel Levkovich <lariel@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/main.c | 6 ++----
 include/linux/mlx5/mlx5_ifc.h     | 6 +++++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index e4bcfa81b70a..4d0780d9114c 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -1192,12 +1192,10 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 		if (MLX5_CAP_ETH(mdev, tunnel_stateless_gre))
 			resp.tunnel_offloads_caps |=
 				MLX5_IB_TUNNELED_OFFLOADS_GRE;
-		if (MLX5_CAP_GEN(mdev, flex_parser_protocols) &
-		    MLX5_FLEX_PROTO_CW_MPLS_GRE)
+		if (MLX5_CAP_ETH(mdev, tunnel_stateless_mpls_over_gre))
 			resp.tunnel_offloads_caps |=
 				MLX5_IB_TUNNELED_OFFLOADS_MPLS_GRE;
-		if (MLX5_CAP_GEN(mdev, flex_parser_protocols) &
-		    MLX5_FLEX_PROTO_CW_MPLS_UDP)
+		if (MLX5_CAP_ETH(mdev, tunnel_stateless_mpls_over_udp))
 			resp.tunnel_offloads_caps |=
 				MLX5_IB_TUNNELED_OFFLOADS_MPLS_UDP;
 	}
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index ff8c9d527bb4..ac72c944c26d 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -872,7 +872,11 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_bits {
 	u8         swp_csum[0x1];
 	u8         swp_lso[0x1];
 	u8         cqe_checksum_full[0x1];
-	u8         reserved_at_24[0x5];
+	u8         tunnel_stateless_geneve_tx[0x1];
+	u8         tunnel_stateless_mpls_over_udp[0x1];
+	u8         tunnel_stateless_mpls_over_gre[0x1];
+	u8         tunnel_stateless_vxlan_gpe[0x1];
+	u8         tunnel_stateless_ipv4_over_vxlan[0x1];
 	u8         tunnel_stateless_ip_over_ip[0x1];
 	u8         reserved_at_2a[0x6];
 	u8         max_vxlan_udp_ports[0x8];
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH rdma-rc] IB/mlx5: Replace tunnel mpls capability bits for tunnel_offloads
  2020-03-05 12:38 [PATCH rdma-rc] IB/mlx5: Replace tunnel mpls capability bits for tunnel_offloads Leon Romanovsky
@ 2020-03-07 23:20 ` Sasha Levin
  2020-03-10 18:10 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2020-03-07 23:20 UTC (permalink / raw)
  To: Sasha Levin, Leon Romanovsky, Alex Vesker, Doug Ledford
  Cc: Alex Vesker, stable

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: e818e255a58d ("IB/mlx5: Expose MPLS related tunneling offloads").

The bot has tested the following trees: v5.5.8, v5.4.24, v4.19.108.

v5.5.8: Build OK!
v5.4.24: Build OK!
v4.19.108: Failed to apply! Possible dependencies:
    caa185473544 ("net/mlx5: Expose IP-in-IP capability bit")
    db849faa9bef ("net/mlx5e: Rx, Fix checksum calculation for new hardware")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH rdma-rc] IB/mlx5: Replace tunnel mpls capability bits for tunnel_offloads
  2020-03-05 12:38 [PATCH rdma-rc] IB/mlx5: Replace tunnel mpls capability bits for tunnel_offloads Leon Romanovsky
  2020-03-07 23:20 ` Sasha Levin
@ 2020-03-10 18:10 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2020-03-10 18:10 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Alex Vesker, Ariel Levkovich, linux-rdma,
	Mark Bloch, netdev, Saeed Mahameed

On Thu, Mar 05, 2020 at 02:38:41PM +0200, Leon Romanovsky wrote:
> From: Alex Vesker <valex@mellanox.com>
> 
> Until now flex parser was used in ib_query_device to indicate
> tunnel_offloads_caps support for mpls_over_gre/mpls_over_udp.
> These inaccurate capability bits will not work on newer devices.
> 
> This should not brake backward compatibility since tunnel_stateless
> caps and flex_parser_protocols caps were added together.
> 
> Cc: <stable@vger.kernel.org> # 4.17
> Fixes: e818e255a58d ("IB/mlx5: Expose MPLS related tunneling offloads")
> Signed-off-by: Alex Vesker <valex@mellanox.com>
> Reviewed-by: Ariel Levkovich <lariel@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  drivers/infiniband/hw/mlx5/main.c | 6 ++----
>  include/linux/mlx5/mlx5_ifc.h     | 6 +++++-
>  2 files changed, 7 insertions(+), 5 deletions(-)

Compatability with future devices is not really a -rc thing

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-10 18:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-05 12:38 [PATCH rdma-rc] IB/mlx5: Replace tunnel mpls capability bits for tunnel_offloads Leon Romanovsky
2020-03-07 23:20 ` Sasha Levin
2020-03-10 18:10 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.