All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-next v1 0/4] Expose ENCAP mode to mlx5_ib
@ 2019-06-12 12:20 ` Leon Romanovsky
  0 siblings, 0 replies; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-12 12:20 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Maor Gottlieb, Mark Bloch,
	Parav Pandit, Petr Vorel, Saeed Mahameed, linux-netdev,
	Jiri Pirko

From: Leon Romanovsky <leonro@mellanox.com>

Changelog v0->v1:
 * Added patch to devlink to use declared enum for encap mode instead of u8
 * Constify input argumetn to encap mode function
 * fix encap variable type to be boolean

---------------------------------------------------------------------
Hi,

This is short series from Maor to expose and use enacap mode inside mlx5_ib.

Thanks

Leon Romanovsky (1):
  net/mlx5: Declare more strictly devlink encap mode

Maor Gottlieb (3):
  net/mlx5: Expose eswitch encap mode
  RDMA/mlx5: Consider eswitch encap mode
  RDMA/mlx5: Enable decap and packet reformat on FDB

 drivers/infiniband/hw/mlx5/main.c             | 25 ++++++++++++++-----
 .../net/ethernet/mellanox/mlx5/core/eswitch.c | 11 ++++++++
 .../net/ethernet/mellanox/mlx5/core/eswitch.h |  8 +++---
 .../mellanox/mlx5/core/eswitch_offloads.c     |  6 +++--
 include/linux/mlx5/eswitch.h                  | 12 +++++++++
 include/net/devlink.h                         |  6 +++--
 net/core/devlink.c                            |  6 +++--
 7 files changed, 59 insertions(+), 15 deletions(-)

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

* [PATCH rdma-next v1 0/4] Expose ENCAP mode to mlx5_ib
@ 2019-06-12 12:20 ` Leon Romanovsky
  0 siblings, 0 replies; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-12 12:20 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Maor Gottlieb, Mark Bloch,
	Parav Pandit, Petr Vorel, Saeed Mahameed, linux-netdev,
	Jiri Pirko

From: Leon Romanovsky <leonro@mellanox.com>

Changelog v0->v1:
 * Added patch to devlink to use declared enum for encap mode instead of u8
 * Constify input argumetn to encap mode function
 * fix encap variable type to be boolean

---------------------------------------------------------------------
Hi,

This is short series from Maor to expose and use enacap mode inside mlx5_ib.

Thanks

Leon Romanovsky (1):
  net/mlx5: Declare more strictly devlink encap mode

Maor Gottlieb (3):
  net/mlx5: Expose eswitch encap mode
  RDMA/mlx5: Consider eswitch encap mode
  RDMA/mlx5: Enable decap and packet reformat on FDB

 drivers/infiniband/hw/mlx5/main.c             | 25 ++++++++++++++-----
 .../net/ethernet/mellanox/mlx5/core/eswitch.c | 11 ++++++++
 .../net/ethernet/mellanox/mlx5/core/eswitch.h |  8 +++---
 .../mellanox/mlx5/core/eswitch_offloads.c     |  6 +++--
 include/linux/mlx5/eswitch.h                  | 12 +++++++++
 include/net/devlink.h                         |  6 +++--
 net/core/devlink.c                            |  6 +++--
 7 files changed, 59 insertions(+), 15 deletions(-)

--
2.20.1


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

* [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode
  2019-06-12 12:20 ` Leon Romanovsky
@ 2019-06-12 12:20   ` Leon Romanovsky
  -1 siblings, 0 replies; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-12 12:20 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Maor Gottlieb, Mark Bloch,
	Parav Pandit, Petr Vorel, Saeed Mahameed, linux-netdev,
	Jiri Pirko

From: Leon Romanovsky <leonro@mellanox.com>

Devlink has UAPI declaration for encap mode, so there is no
need to be loose on the data get/set by drivers.

Update call sites to use enum devlink_eswitch_encap_mode
instead of plain u8.

Suggested-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.h         | 8 +++++---
 .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c    | 6 ++++--
 include/net/devlink.h                                     | 6 ++++--
 net/core/devlink.c                                        | 6 ++++--
 4 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index ed3fad689ec9..e264dfc64a6e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -175,7 +175,7 @@ struct mlx5_esw_offload {
 	DECLARE_HASHTABLE(mod_hdr_tbl, 8);
 	u8 inline_mode;
 	u64 num_flows;
-	u8 encap;
+	enum devlink_eswitch_encap_mode encap;
 };

 /* E-Switch MC FDB table hash node */
@@ -356,9 +356,11 @@ int mlx5_devlink_eswitch_inline_mode_set(struct devlink *devlink, u8 mode,
 					 struct netlink_ext_ack *extack);
 int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8 *mode);
 int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, int nvfs, u8 *mode);
-int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8 encap,
+int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
+					enum devlink_eswitch_encap_mode encap,
 					struct netlink_ext_ack *extack);
-int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8 *encap);
+int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
+					enum devlink_eswitch_encap_mode *encap);
 void *mlx5_eswitch_get_uplink_priv(struct mlx5_eswitch *esw, u8 rep_type);

 int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index e09ae27485ee..f1571163143d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -2137,7 +2137,8 @@ int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, int nvfs, u8 *mode)
 	return 0;
 }

-int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8 encap,
+int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
+					enum devlink_eswitch_encap_mode encap,
 					struct netlink_ext_ack *extack)
 {
 	struct mlx5_core_dev *dev = devlink_priv(devlink);
@@ -2186,7 +2187,8 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8 encap,
 	return err;
 }

-int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8 *encap)
+int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
+					enum devlink_eswitch_encap_mode *encap)
 {
 	struct mlx5_core_dev *dev = devlink_priv(devlink);
 	struct mlx5_eswitch *esw = dev->priv.eswitch;
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 1c4adfb4195a..7a34fc586def 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -530,8 +530,10 @@ struct devlink_ops {
 	int (*eswitch_inline_mode_get)(struct devlink *devlink, u8 *p_inline_mode);
 	int (*eswitch_inline_mode_set)(struct devlink *devlink, u8 inline_mode,
 				       struct netlink_ext_ack *extack);
-	int (*eswitch_encap_mode_get)(struct devlink *devlink, u8 *p_encap_mode);
-	int (*eswitch_encap_mode_set)(struct devlink *devlink, u8 encap_mode,
+	int (*eswitch_encap_mode_get)(struct devlink *devlink,
+				      enum devlink_eswitch_encap_mode *p_encap_mode);
+	int (*eswitch_encap_mode_set)(struct devlink *devlink,
+				      enum devlink_eswitch_encap_mode encap_mode,
 				      struct netlink_ext_ack *extack);
 	int (*info_get)(struct devlink *devlink, struct devlink_info_req *req,
 			struct netlink_ext_ack *extack);
diff --git a/net/core/devlink.c b/net/core/devlink.c
index d43bc52b8840..47ae69363b07 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -1552,7 +1552,8 @@ static int devlink_nl_eswitch_fill(struct sk_buff *msg, struct devlink *devlink,
 				   u32 seq, int flags)
 {
 	const struct devlink_ops *ops = devlink->ops;
-	u8 inline_mode, encap_mode;
+	enum devlink_eswitch_encap_mode encap_mode;
+	u8 inline_mode;
 	void *hdr;
 	int err = 0;
 	u16 mode;
@@ -1628,7 +1629,8 @@ static int devlink_nl_cmd_eswitch_set_doit(struct sk_buff *skb,
 {
 	struct devlink *devlink = info->user_ptr[0];
 	const struct devlink_ops *ops = devlink->ops;
-	u8 inline_mode, encap_mode;
+	enum devlink_eswitch_encap_mode encap_mode;
+	u8 inline_mode;
 	int err = 0;
 	u16 mode;

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

* [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode
@ 2019-06-12 12:20   ` Leon Romanovsky
  0 siblings, 0 replies; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-12 12:20 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Maor Gottlieb, Mark Bloch,
	Parav Pandit, Petr Vorel, Saeed Mahameed, linux-netdev,
	Jiri Pirko

From: Leon Romanovsky <leonro@mellanox.com>

Devlink has UAPI declaration for encap mode, so there is no
need to be loose on the data get/set by drivers.

Update call sites to use enum devlink_eswitch_encap_mode
instead of plain u8.

Suggested-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.h         | 8 +++++---
 .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c    | 6 ++++--
 include/net/devlink.h                                     | 6 ++++--
 net/core/devlink.c                                        | 6 ++++--
 4 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index ed3fad689ec9..e264dfc64a6e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -175,7 +175,7 @@ struct mlx5_esw_offload {
 	DECLARE_HASHTABLE(mod_hdr_tbl, 8);
 	u8 inline_mode;
 	u64 num_flows;
-	u8 encap;
+	enum devlink_eswitch_encap_mode encap;
 };

 /* E-Switch MC FDB table hash node */
@@ -356,9 +356,11 @@ int mlx5_devlink_eswitch_inline_mode_set(struct devlink *devlink, u8 mode,
 					 struct netlink_ext_ack *extack);
 int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8 *mode);
 int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, int nvfs, u8 *mode);
-int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8 encap,
+int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
+					enum devlink_eswitch_encap_mode encap,
 					struct netlink_ext_ack *extack);
-int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8 *encap);
+int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
+					enum devlink_eswitch_encap_mode *encap);
 void *mlx5_eswitch_get_uplink_priv(struct mlx5_eswitch *esw, u8 rep_type);

 int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index e09ae27485ee..f1571163143d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -2137,7 +2137,8 @@ int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, int nvfs, u8 *mode)
 	return 0;
 }

-int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8 encap,
+int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
+					enum devlink_eswitch_encap_mode encap,
 					struct netlink_ext_ack *extack)
 {
 	struct mlx5_core_dev *dev = devlink_priv(devlink);
@@ -2186,7 +2187,8 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8 encap,
 	return err;
 }

-int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8 *encap)
+int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
+					enum devlink_eswitch_encap_mode *encap)
 {
 	struct mlx5_core_dev *dev = devlink_priv(devlink);
 	struct mlx5_eswitch *esw = dev->priv.eswitch;
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 1c4adfb4195a..7a34fc586def 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -530,8 +530,10 @@ struct devlink_ops {
 	int (*eswitch_inline_mode_get)(struct devlink *devlink, u8 *p_inline_mode);
 	int (*eswitch_inline_mode_set)(struct devlink *devlink, u8 inline_mode,
 				       struct netlink_ext_ack *extack);
-	int (*eswitch_encap_mode_get)(struct devlink *devlink, u8 *p_encap_mode);
-	int (*eswitch_encap_mode_set)(struct devlink *devlink, u8 encap_mode,
+	int (*eswitch_encap_mode_get)(struct devlink *devlink,
+				      enum devlink_eswitch_encap_mode *p_encap_mode);
+	int (*eswitch_encap_mode_set)(struct devlink *devlink,
+				      enum devlink_eswitch_encap_mode encap_mode,
 				      struct netlink_ext_ack *extack);
 	int (*info_get)(struct devlink *devlink, struct devlink_info_req *req,
 			struct netlink_ext_ack *extack);
diff --git a/net/core/devlink.c b/net/core/devlink.c
index d43bc52b8840..47ae69363b07 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -1552,7 +1552,8 @@ static int devlink_nl_eswitch_fill(struct sk_buff *msg, struct devlink *devlink,
 				   u32 seq, int flags)
 {
 	const struct devlink_ops *ops = devlink->ops;
-	u8 inline_mode, encap_mode;
+	enum devlink_eswitch_encap_mode encap_mode;
+	u8 inline_mode;
 	void *hdr;
 	int err = 0;
 	u16 mode;
@@ -1628,7 +1629,8 @@ static int devlink_nl_cmd_eswitch_set_doit(struct sk_buff *skb,
 {
 	struct devlink *devlink = info->user_ptr[0];
 	const struct devlink_ops *ops = devlink->ops;
-	u8 inline_mode, encap_mode;
+	enum devlink_eswitch_encap_mode encap_mode;
+	u8 inline_mode;
 	int err = 0;
 	u16 mode;

--
2.20.1


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

* [PATCH mlx5-next v1 2/4] net/mlx5: Expose eswitch encap mode
  2019-06-12 12:20 ` Leon Romanovsky
@ 2019-06-12 12:20   ` Leon Romanovsky
  -1 siblings, 0 replies; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-12 12:20 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Maor Gottlieb, Mark Bloch,
	Parav Pandit, Petr Vorel, Saeed Mahameed, linux-netdev,
	Jiri Pirko

From: Maor Gottlieb <maorg@mellanox.com>

Add API to get the current Eswitch encap mode.
It will be used in downstream patches to check if
flow table can be created with encap support or not.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 11 +++++++++++
 include/linux/mlx5/eswitch.h                      | 12 ++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 9ea0ccfe5ef5..0c68d93bea79 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -2452,6 +2452,17 @@ u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw)
 }
 EXPORT_SYMBOL_GPL(mlx5_eswitch_mode);

+enum devlink_eswitch_encap_mode
+mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev)
+{
+	struct mlx5_eswitch *esw;
+
+	esw = dev->priv.eswitch;
+	return ESW_ALLOWED(esw) ? esw->offloads.encap :
+		DEVLINK_ESWITCH_ENCAP_MODE_NONE;
+}
+EXPORT_SYMBOL(mlx5_eswitch_get_encap_mode);
+
 bool mlx5_esw_lag_prereq(struct mlx5_core_dev *dev0, struct mlx5_core_dev *dev1)
 {
 	if ((dev0->priv.eswitch->mode == SRIOV_NONE &&
diff --git a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h
index 0ca77dd1429c..f57c73e81267 100644
--- a/include/linux/mlx5/eswitch.h
+++ b/include/linux/mlx5/eswitch.h
@@ -7,6 +7,7 @@
 #define _MLX5_ESWITCH_

 #include <linux/mlx5/driver.h>
+#include <net/devlink.h>

 #define MLX5_ESWITCH_MANAGER(mdev) MLX5_CAP_GEN(mdev, eswitch_manager)

@@ -60,4 +61,15 @@ u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw);
 struct mlx5_flow_handle *
 mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw,
 				    int vport, u32 sqn);
+
+#ifdef CONFIG_MLX5_ESWITCH
+enum devlink_eswitch_encap_mode
+mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev);
+#else  /* CONFIG_MLX5_ESWITCH */
+static inline enum devlink_eswitch_encap_mode
+mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev)
+{
+	return DEVLINK_ESWITCH_ENCAP_MODE_NONE;
+}
+#endif /* CONFIG_MLX5_ESWITCH */
 #endif

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

* [PATCH mlx5-next v1 2/4] net/mlx5: Expose eswitch encap mode
@ 2019-06-12 12:20   ` Leon Romanovsky
  0 siblings, 0 replies; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-12 12:20 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Maor Gottlieb, Mark Bloch,
	Parav Pandit, Petr Vorel, Saeed Mahameed, linux-netdev,
	Jiri Pirko

From: Maor Gottlieb <maorg@mellanox.com>

Add API to get the current Eswitch encap mode.
It will be used in downstream patches to check if
flow table can be created with encap support or not.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 11 +++++++++++
 include/linux/mlx5/eswitch.h                      | 12 ++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 9ea0ccfe5ef5..0c68d93bea79 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -2452,6 +2452,17 @@ u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw)
 }
 EXPORT_SYMBOL_GPL(mlx5_eswitch_mode);

+enum devlink_eswitch_encap_mode
+mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev)
+{
+	struct mlx5_eswitch *esw;
+
+	esw = dev->priv.eswitch;
+	return ESW_ALLOWED(esw) ? esw->offloads.encap :
+		DEVLINK_ESWITCH_ENCAP_MODE_NONE;
+}
+EXPORT_SYMBOL(mlx5_eswitch_get_encap_mode);
+
 bool mlx5_esw_lag_prereq(struct mlx5_core_dev *dev0, struct mlx5_core_dev *dev1)
 {
 	if ((dev0->priv.eswitch->mode == SRIOV_NONE &&
diff --git a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h
index 0ca77dd1429c..f57c73e81267 100644
--- a/include/linux/mlx5/eswitch.h
+++ b/include/linux/mlx5/eswitch.h
@@ -7,6 +7,7 @@
 #define _MLX5_ESWITCH_

 #include <linux/mlx5/driver.h>
+#include <net/devlink.h>

 #define MLX5_ESWITCH_MANAGER(mdev) MLX5_CAP_GEN(mdev, eswitch_manager)

@@ -60,4 +61,15 @@ u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw);
 struct mlx5_flow_handle *
 mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw,
 				    int vport, u32 sqn);
+
+#ifdef CONFIG_MLX5_ESWITCH
+enum devlink_eswitch_encap_mode
+mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev);
+#else  /* CONFIG_MLX5_ESWITCH */
+static inline enum devlink_eswitch_encap_mode
+mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev)
+{
+	return DEVLINK_ESWITCH_ENCAP_MODE_NONE;
+}
+#endif /* CONFIG_MLX5_ESWITCH */
 #endif
--
2.20.1


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

* [PATCH rdma-next v1 3/4] RDMA/mlx5: Consider eswitch encap mode
  2019-06-12 12:20 ` Leon Romanovsky
@ 2019-06-12 12:20   ` Leon Romanovsky
  -1 siblings, 0 replies; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-12 12:20 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Maor Gottlieb, Mark Bloch,
	Parav Pandit, Petr Vorel, Saeed Mahameed, linux-netdev,
	Jiri Pirko

From: Maor Gottlieb <maorg@mellanox.com>

When flow steering is created, then the encap support should
consider the eswitch encap mode. If the eswitch flow table (FDB)
supports encap then it shouldn't be supported on NIC RX flow tables.

Fixes: 4adda1122c490 ('RDMA/mlx5: Enable decap and packet reformat on flow tables')
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/main.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index e832ac6c83a4..a6e2e0210ebb 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -52,6 +52,7 @@
 #include <linux/mlx5/port.h>
 #include <linux/mlx5/vport.h>
 #include <linux/mlx5/fs.h>
+#include <linux/mlx5/eswitch.h>
 #include <linux/list.h>
 #include <rdma/ib_smi.h>
 #include <rdma/ib_umem.h>
@@ -3245,11 +3246,14 @@ static struct mlx5_ib_flow_prio *get_flow_table(struct mlx5_ib_dev *dev,
 	int max_table_size;
 	int num_entries;
 	int num_groups;
+	bool esw_encap;
 	u32 flags = 0;
 	int priority;

 	max_table_size = BIT(MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev,
 						       log_max_ft_size));
+	esw_encap = mlx5_eswitch_get_encap_mode(dev->mdev) !=
+		DEVLINK_ESWITCH_ENCAP_MODE_NONE;
 	if (flow_attr->type == IB_FLOW_ATTR_NORMAL) {
 		enum mlx5_flow_namespace_type fn_type;

@@ -3262,10 +3266,10 @@ static struct mlx5_ib_flow_prio *get_flow_table(struct mlx5_ib_dev *dev,
 		if (ft_type == MLX5_IB_FT_RX) {
 			fn_type = MLX5_FLOW_NAMESPACE_BYPASS;
 			prio = &dev->flow_db->prios[priority];
-			if (!dev->is_rep &&
+			if (!dev->is_rep && !esw_encap &&
 			    MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev, decap))
 				flags |= MLX5_FLOW_TABLE_TUNNEL_EN_DECAP;
-			if (!dev->is_rep &&
+			if (!dev->is_rep && !esw_encap &&
 			    MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev,
 					reformat_l3_tunnel_to_l2))
 				flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
@@ -3275,7 +3279,7 @@ static struct mlx5_ib_flow_prio *get_flow_table(struct mlx5_ib_dev *dev,
 							      log_max_ft_size));
 			fn_type = MLX5_FLOW_NAMESPACE_EGRESS;
 			prio = &dev->flow_db->egress_prios[priority];
-			if (!dev->is_rep &&
+			if (!dev->is_rep && !esw_encap &&
 			    MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, reformat))
 				flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
 		}
@@ -3885,6 +3889,7 @@ _get_flow_table(struct mlx5_ib_dev *dev,
 	struct mlx5_flow_namespace *ns = NULL;
 	struct mlx5_ib_flow_prio *prio = NULL;
 	int max_table_size = 0;
+	bool esw_encap;
 	u32 flags = 0;
 	int priority;

@@ -3893,18 +3898,21 @@ _get_flow_table(struct mlx5_ib_dev *dev,
 	else
 		priority = ib_prio_to_core_prio(fs_matcher->priority, false);

+	esw_encap = mlx5_eswitch_get_encap_mode(dev->mdev) !=
+		DEVLINK_ESWITCH_ENCAP_MODE_NONE;
 	if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_BYPASS) {
 		max_table_size = BIT(MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev,
 					log_max_ft_size));
-		if (MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev, decap))
+		if (MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev, decap) && !esw_encap)
 			flags |= MLX5_FLOW_TABLE_TUNNEL_EN_DECAP;
 		if (MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev,
-					      reformat_l3_tunnel_to_l2))
+					      reformat_l3_tunnel_to_l2) &&
+		    !esw_encap)
 			flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
 	} else if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_EGRESS) {
 		max_table_size = BIT(
 			MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, log_max_ft_size));
-		if (MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, reformat))
+		if (MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, reformat) && !esw_encap)
 			flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
 	} else if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_FDB) {
 		max_table_size = BIT(

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

* [PATCH rdma-next v1 3/4] RDMA/mlx5: Consider eswitch encap mode
@ 2019-06-12 12:20   ` Leon Romanovsky
  0 siblings, 0 replies; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-12 12:20 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Maor Gottlieb, Mark Bloch,
	Parav Pandit, Petr Vorel, Saeed Mahameed, linux-netdev,
	Jiri Pirko

From: Maor Gottlieb <maorg@mellanox.com>

When flow steering is created, then the encap support should
consider the eswitch encap mode. If the eswitch flow table (FDB)
supports encap then it shouldn't be supported on NIC RX flow tables.

Fixes: 4adda1122c490 ('RDMA/mlx5: Enable decap and packet reformat on flow tables')
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/main.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index e832ac6c83a4..a6e2e0210ebb 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -52,6 +52,7 @@
 #include <linux/mlx5/port.h>
 #include <linux/mlx5/vport.h>
 #include <linux/mlx5/fs.h>
+#include <linux/mlx5/eswitch.h>
 #include <linux/list.h>
 #include <rdma/ib_smi.h>
 #include <rdma/ib_umem.h>
@@ -3245,11 +3246,14 @@ static struct mlx5_ib_flow_prio *get_flow_table(struct mlx5_ib_dev *dev,
 	int max_table_size;
 	int num_entries;
 	int num_groups;
+	bool esw_encap;
 	u32 flags = 0;
 	int priority;

 	max_table_size = BIT(MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev,
 						       log_max_ft_size));
+	esw_encap = mlx5_eswitch_get_encap_mode(dev->mdev) !=
+		DEVLINK_ESWITCH_ENCAP_MODE_NONE;
 	if (flow_attr->type == IB_FLOW_ATTR_NORMAL) {
 		enum mlx5_flow_namespace_type fn_type;

@@ -3262,10 +3266,10 @@ static struct mlx5_ib_flow_prio *get_flow_table(struct mlx5_ib_dev *dev,
 		if (ft_type == MLX5_IB_FT_RX) {
 			fn_type = MLX5_FLOW_NAMESPACE_BYPASS;
 			prio = &dev->flow_db->prios[priority];
-			if (!dev->is_rep &&
+			if (!dev->is_rep && !esw_encap &&
 			    MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev, decap))
 				flags |= MLX5_FLOW_TABLE_TUNNEL_EN_DECAP;
-			if (!dev->is_rep &&
+			if (!dev->is_rep && !esw_encap &&
 			    MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev,
 					reformat_l3_tunnel_to_l2))
 				flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
@@ -3275,7 +3279,7 @@ static struct mlx5_ib_flow_prio *get_flow_table(struct mlx5_ib_dev *dev,
 							      log_max_ft_size));
 			fn_type = MLX5_FLOW_NAMESPACE_EGRESS;
 			prio = &dev->flow_db->egress_prios[priority];
-			if (!dev->is_rep &&
+			if (!dev->is_rep && !esw_encap &&
 			    MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, reformat))
 				flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
 		}
@@ -3885,6 +3889,7 @@ _get_flow_table(struct mlx5_ib_dev *dev,
 	struct mlx5_flow_namespace *ns = NULL;
 	struct mlx5_ib_flow_prio *prio = NULL;
 	int max_table_size = 0;
+	bool esw_encap;
 	u32 flags = 0;
 	int priority;

@@ -3893,18 +3898,21 @@ _get_flow_table(struct mlx5_ib_dev *dev,
 	else
 		priority = ib_prio_to_core_prio(fs_matcher->priority, false);

+	esw_encap = mlx5_eswitch_get_encap_mode(dev->mdev) !=
+		DEVLINK_ESWITCH_ENCAP_MODE_NONE;
 	if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_BYPASS) {
 		max_table_size = BIT(MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev,
 					log_max_ft_size));
-		if (MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev, decap))
+		if (MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev, decap) && !esw_encap)
 			flags |= MLX5_FLOW_TABLE_TUNNEL_EN_DECAP;
 		if (MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev,
-					      reformat_l3_tunnel_to_l2))
+					      reformat_l3_tunnel_to_l2) &&
+		    !esw_encap)
 			flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
 	} else if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_EGRESS) {
 		max_table_size = BIT(
 			MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, log_max_ft_size));
-		if (MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, reformat))
+		if (MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, reformat) && !esw_encap)
 			flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
 	} else if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_FDB) {
 		max_table_size = BIT(
--
2.20.1


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

* [PATCH rdma-next v1 4/4] RDMA/mlx5: Enable decap and packet reformat on FDB
  2019-06-12 12:20 ` Leon Romanovsky
@ 2019-06-12 12:20   ` Leon Romanovsky
  -1 siblings, 0 replies; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-12 12:20 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Maor Gottlieb, Mark Bloch,
	Parav Pandit, Petr Vorel, Saeed Mahameed, linux-netdev,
	Jiri Pirko

From: Maor Gottlieb <maorg@mellanox.com>

If FDB flow tables support decap operation, enable it on creation,
This allows to perform decapsulation of tunnelled packets by steering
rules. If FDB flow tables support reformat operation, enable it on
creation as well.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index a6e2e0210ebb..33709fd93ab2 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -3917,6 +3917,11 @@ _get_flow_table(struct mlx5_ib_dev *dev,
 	} else if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_FDB) {
 		max_table_size = BIT(
 			MLX5_CAP_ESW_FLOWTABLE_FDB(dev->mdev, log_max_ft_size));
+		if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev->mdev, decap) && esw_encap)
+			flags |= MLX5_FLOW_TABLE_TUNNEL_EN_DECAP;
+		if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev->mdev, reformat_l3_tunnel_to_l2) &&
+		    esw_encap)
+			flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
 		priority = FDB_BYPASS_PATH;
 	}

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

* [PATCH rdma-next v1 4/4] RDMA/mlx5: Enable decap and packet reformat on FDB
@ 2019-06-12 12:20   ` Leon Romanovsky
  0 siblings, 0 replies; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-12 12:20 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Maor Gottlieb, Mark Bloch,
	Parav Pandit, Petr Vorel, Saeed Mahameed, linux-netdev,
	Jiri Pirko

From: Maor Gottlieb <maorg@mellanox.com>

If FDB flow tables support decap operation, enable it on creation,
This allows to perform decapsulation of tunnelled packets by steering
rules. If FDB flow tables support reformat operation, enable it on
creation as well.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index a6e2e0210ebb..33709fd93ab2 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -3917,6 +3917,11 @@ _get_flow_table(struct mlx5_ib_dev *dev,
 	} else if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_FDB) {
 		max_table_size = BIT(
 			MLX5_CAP_ESW_FLOWTABLE_FDB(dev->mdev, log_max_ft_size));
+		if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev->mdev, decap) && esw_encap)
+			flags |= MLX5_FLOW_TABLE_TUNNEL_EN_DECAP;
+		if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev->mdev, reformat_l3_tunnel_to_l2) &&
+		    esw_encap)
+			flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
 		priority = FDB_BYPASS_PATH;
 	}

--
2.20.1


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

* Re: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode
  2019-06-12 12:20   ` Leon Romanovsky
  (?)
@ 2019-06-12 12:36   ` Petr Vorel
  -1 siblings, 0 replies; 21+ messages in thread
From: Petr Vorel @ 2019-06-12 12:36 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Jason Gunthorpe, Leon Romanovsky,
	RDMA mailing list, Maor Gottlieb, Mark Bloch, Parav Pandit,
	Saeed Mahameed, linux-netdev, Jiri Pirko

Hi Leon,

> From: Leon Romanovsky <leonro@mellanox.com>

> Devlink has UAPI declaration for encap mode, so there is no
> need to be loose on the data get/set by drivers.

> Update call sites to use enum devlink_eswitch_encap_mode
> instead of plain u8.

> Suggested-by: Parav Pandit <parav@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

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

* RE: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode
  2019-06-12 12:20   ` Leon Romanovsky
  (?)
  (?)
@ 2019-06-13  4:32   ` Parav Pandit
  2019-06-13  5:59     ` Leon Romanovsky
  -1 siblings, 1 reply; 21+ messages in thread
From: Parav Pandit @ 2019-06-13  4:32 UTC (permalink / raw)
  To: Leon Romanovsky, Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Maor Gottlieb, Mark Bloch,
	Petr Vorel, Saeed Mahameed, linux-netdev, Jiri Pirko



> -----Original Message-----
> From: Leon Romanovsky <leon@kernel.org>
> Sent: Wednesday, June 12, 2019 5:50 PM
> To: Doug Ledford <dledford@redhat.com>; Jason Gunthorpe
> <jgg@mellanox.com>
> Cc: Leon Romanovsky <leonro@mellanox.com>; RDMA mailing list <linux-
> rdma@vger.kernel.org>; Maor Gottlieb <maorg@mellanox.com>; Mark Bloch
> <markb@mellanox.com>; Parav Pandit <parav@mellanox.com>; Petr Vorel
> <pvorel@suse.cz>; Saeed Mahameed <saeedm@mellanox.com>; linux-
> netdev <netdev@vger.kernel.org>; Jiri Pirko <jiri@mellanox.com>
> Subject: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink
> encap mode
> 
> From: Leon Romanovsky <leonro@mellanox.com>
> 
> Devlink has UAPI declaration for encap mode, so there is no need to be
> loose on the data get/set by drivers.
> 
> Update call sites to use enum devlink_eswitch_encap_mode instead of plain
> u8.
> 
> Suggested-by: Parav Pandit <parav@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/eswitch.h         | 8 +++++---
>  .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c    | 6 ++++--
>  include/net/devlink.h                                     | 6 ++++--
>  net/core/devlink.c                                        | 6 ++++--
>  4 files changed, 17 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> index ed3fad689ec9..e264dfc64a6e 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> @@ -175,7 +175,7 @@ struct mlx5_esw_offload {
>  	DECLARE_HASHTABLE(mod_hdr_tbl, 8);
>  	u8 inline_mode;
>  	u64 num_flows;
> -	u8 encap;
> +	enum devlink_eswitch_encap_mode encap;
>  };
> 
>  /* E-Switch MC FDB table hash node */
> @@ -356,9 +356,11 @@ int mlx5_devlink_eswitch_inline_mode_set(struct
> devlink *devlink, u8 mode,
>  					 struct netlink_ext_ack *extack);
>  int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8
> *mode);  int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, int
> nvfs, u8 *mode); -int mlx5_devlink_eswitch_encap_mode_set(struct devlink
> *devlink, u8 encap,
> +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
> +					enum devlink_eswitch_encap_mode
> encap,
>  					struct netlink_ext_ack *extack);
> -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
> *encap);
> +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
> +					enum devlink_eswitch_encap_mode
> *encap);
>  void *mlx5_eswitch_get_uplink_priv(struct mlx5_eswitch *esw, u8
> rep_type);
> 
>  int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw, diff --git
> a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> index e09ae27485ee..f1571163143d 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> @@ -2137,7 +2137,8 @@ int mlx5_eswitch_inline_mode_get(struct
> mlx5_eswitch *esw, int nvfs, u8 *mode)
>  	return 0;
>  }
> 
> -int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8
> encap,
> +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
> +					enum devlink_eswitch_encap_mode
> encap,
>  					struct netlink_ext_ack *extack)
>  {
>  	struct mlx5_core_dev *dev = devlink_priv(devlink); @@ -2186,7
> +2187,8 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink
> *devlink, u8 encap,
>  	return err;
>  }
> 
> -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
> *encap)
> +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
> +					enum devlink_eswitch_encap_mode
> *encap)
>  {
>  	struct mlx5_core_dev *dev = devlink_priv(devlink);
>  	struct mlx5_eswitch *esw = dev->priv.eswitch; diff --git
> a/include/net/devlink.h b/include/net/devlink.h index
> 1c4adfb4195a..7a34fc586def 100644
> --- a/include/net/devlink.h
> +++ b/include/net/devlink.h
> @@ -530,8 +530,10 @@ struct devlink_ops {
>  	int (*eswitch_inline_mode_get)(struct devlink *devlink, u8
> *p_inline_mode);
>  	int (*eswitch_inline_mode_set)(struct devlink *devlink, u8
> inline_mode,
>  				       struct netlink_ext_ack *extack);
> -	int (*eswitch_encap_mode_get)(struct devlink *devlink, u8
> *p_encap_mode);
> -	int (*eswitch_encap_mode_set)(struct devlink *devlink, u8
> encap_mode,
> +	int (*eswitch_encap_mode_get)(struct devlink *devlink,
> +				      enum devlink_eswitch_encap_mode
> *p_encap_mode);
> +	int (*eswitch_encap_mode_set)(struct devlink *devlink,
> +				      enum devlink_eswitch_encap_mode
> encap_mode,
>  				      struct netlink_ext_ack *extack);
>  	int (*info_get)(struct devlink *devlink, struct devlink_info_req *req,
>  			struct netlink_ext_ack *extack);
> diff --git a/net/core/devlink.c b/net/core/devlink.c index
> d43bc52b8840..47ae69363b07 100644
> --- a/net/core/devlink.c
> +++ b/net/core/devlink.c
> @@ -1552,7 +1552,8 @@ static int devlink_nl_eswitch_fill(struct sk_buff
> *msg, struct devlink *devlink,
>  				   u32 seq, int flags)
>  {
>  	const struct devlink_ops *ops = devlink->ops;
> -	u8 inline_mode, encap_mode;
> +	enum devlink_eswitch_encap_mode encap_mode;
> +	u8 inline_mode;
>  	void *hdr;
>  	int err = 0;
>  	u16 mode;
> @@ -1628,7 +1629,8 @@ static int devlink_nl_cmd_eswitch_set_doit(struct
> sk_buff *skb,  {
>  	struct devlink *devlink = info->user_ptr[0];
>  	const struct devlink_ops *ops = devlink->ops;
> -	u8 inline_mode, encap_mode;
> +	enum devlink_eswitch_encap_mode encap_mode;
> +	u8 inline_mode;
>  	int err = 0;
>  	u16 mode;
> 
> --
> 2.20.1

Netdev follows reverse Christmas tree, but otherwise,
Reviewed-by: Parav Pandit <parav@mellanox.com>

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

* RE: [PATCH mlx5-next v1 2/4] net/mlx5: Expose eswitch encap mode
  2019-06-12 12:20   ` Leon Romanovsky
  (?)
@ 2019-06-13  4:34   ` Parav Pandit
  -1 siblings, 0 replies; 21+ messages in thread
From: Parav Pandit @ 2019-06-13  4:34 UTC (permalink / raw)
  To: Leon Romanovsky, Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, RDMA mailing list, Maor Gottlieb, Mark Bloch,
	Petr Vorel, Saeed Mahameed, linux-netdev, Jiri Pirko



> -----Original Message-----
> From: Leon Romanovsky <leon@kernel.org>
> Sent: Wednesday, June 12, 2019 5:50 PM
> To: Doug Ledford <dledford@redhat.com>; Jason Gunthorpe
> <jgg@mellanox.com>
> Cc: Leon Romanovsky <leonro@mellanox.com>; RDMA mailing list <linux-
> rdma@vger.kernel.org>; Maor Gottlieb <maorg@mellanox.com>; Mark Bloch
> <markb@mellanox.com>; Parav Pandit <parav@mellanox.com>; Petr Vorel
> <pvorel@suse.cz>; Saeed Mahameed <saeedm@mellanox.com>; linux-
> netdev <netdev@vger.kernel.org>; Jiri Pirko <jiri@mellanox.com>
> Subject: [PATCH mlx5-next v1 2/4] net/mlx5: Expose eswitch encap mode
> 
> From: Maor Gottlieb <maorg@mellanox.com>
> 
> Add API to get the current Eswitch encap mode.
> It will be used in downstream patches to check if flow table can be created
> with encap support or not.
> 
> Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 11 +++++++++++
>  include/linux/mlx5/eswitch.h                      | 12 ++++++++++++
>  2 files changed, 23 insertions(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> index 9ea0ccfe5ef5..0c68d93bea79 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> @@ -2452,6 +2452,17 @@ u8 mlx5_eswitch_mode(struct mlx5_eswitch
> *esw)  }  EXPORT_SYMBOL_GPL(mlx5_eswitch_mode);
> 
> +enum devlink_eswitch_encap_mode
> +mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev) {
> +	struct mlx5_eswitch *esw;
> +
> +	esw = dev->priv.eswitch;
> +	return ESW_ALLOWED(esw) ? esw->offloads.encap :
> +		DEVLINK_ESWITCH_ENCAP_MODE_NONE;
> +}
> +EXPORT_SYMBOL(mlx5_eswitch_get_encap_mode);
> +
>  bool mlx5_esw_lag_prereq(struct mlx5_core_dev *dev0, struct
> mlx5_core_dev *dev1)  {
>  	if ((dev0->priv.eswitch->mode == SRIOV_NONE && diff --git
> a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h index
> 0ca77dd1429c..f57c73e81267 100644
> --- a/include/linux/mlx5/eswitch.h
> +++ b/include/linux/mlx5/eswitch.h
> @@ -7,6 +7,7 @@
>  #define _MLX5_ESWITCH_
> 
>  #include <linux/mlx5/driver.h>
> +#include <net/devlink.h>
> 
>  #define MLX5_ESWITCH_MANAGER(mdev) MLX5_CAP_GEN(mdev,
> eswitch_manager)
> 
> @@ -60,4 +61,15 @@ u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw);
> struct mlx5_flow_handle *  mlx5_eswitch_add_send_to_vport_rule(struct
> mlx5_eswitch *esw,
>  				    int vport, u32 sqn);
> +
> +#ifdef CONFIG_MLX5_ESWITCH
> +enum devlink_eswitch_encap_mode
> +mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev); #else  /*
> +CONFIG_MLX5_ESWITCH */ static inline enum
> devlink_eswitch_encap_mode
> +mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev) {
> +	return DEVLINK_ESWITCH_ENCAP_MODE_NONE; } #endif /*
> +CONFIG_MLX5_ESWITCH */
>  #endif
> --
> 2.20.1
Reviewed-by: Parav Pandit <parav@mellanox.com>

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

* Re: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode
  2019-06-13  4:32   ` Parav Pandit
@ 2019-06-13  5:59     ` Leon Romanovsky
  2019-06-16 10:07       ` Jiri Pirko
  0 siblings, 1 reply; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-13  5:59 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Doug Ledford, Jason Gunthorpe, RDMA mailing list, Maor Gottlieb,
	Mark Bloch, Petr Vorel, Saeed Mahameed, linux-netdev, Jiri Pirko

On Thu, Jun 13, 2019 at 04:32:25AM +0000, Parav Pandit wrote:
>
>
> > -----Original Message-----
> > From: Leon Romanovsky <leon@kernel.org>
> > Sent: Wednesday, June 12, 2019 5:50 PM
> > To: Doug Ledford <dledford@redhat.com>; Jason Gunthorpe
> > <jgg@mellanox.com>
> > Cc: Leon Romanovsky <leonro@mellanox.com>; RDMA mailing list <linux-
> > rdma@vger.kernel.org>; Maor Gottlieb <maorg@mellanox.com>; Mark Bloch
> > <markb@mellanox.com>; Parav Pandit <parav@mellanox.com>; Petr Vorel
> > <pvorel@suse.cz>; Saeed Mahameed <saeedm@mellanox.com>; linux-
> > netdev <netdev@vger.kernel.org>; Jiri Pirko <jiri@mellanox.com>
> > Subject: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink
> > encap mode
> >
> > From: Leon Romanovsky <leonro@mellanox.com>
> >
> > Devlink has UAPI declaration for encap mode, so there is no need to be
> > loose on the data get/set by drivers.
> >
> > Update call sites to use enum devlink_eswitch_encap_mode instead of plain
> > u8.
> >
> > Suggested-by: Parav Pandit <parav@mellanox.com>
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> > ---
> >  drivers/net/ethernet/mellanox/mlx5/core/eswitch.h         | 8 +++++---
> >  .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c    | 6 ++++--
> >  include/net/devlink.h                                     | 6 ++++--
> >  net/core/devlink.c                                        | 6 ++++--
> >  4 files changed, 17 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > index ed3fad689ec9..e264dfc64a6e 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > @@ -175,7 +175,7 @@ struct mlx5_esw_offload {
> >  	DECLARE_HASHTABLE(mod_hdr_tbl, 8);
> >  	u8 inline_mode;
> >  	u64 num_flows;
> > -	u8 encap;
> > +	enum devlink_eswitch_encap_mode encap;
> >  };
> >
> >  /* E-Switch MC FDB table hash node */
> > @@ -356,9 +356,11 @@ int mlx5_devlink_eswitch_inline_mode_set(struct
> > devlink *devlink, u8 mode,
> >  					 struct netlink_ext_ack *extack);
> >  int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8
> > *mode);  int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, int
> > nvfs, u8 *mode); -int mlx5_devlink_eswitch_encap_mode_set(struct devlink
> > *devlink, u8 encap,
> > +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
> > +					enum devlink_eswitch_encap_mode
> > encap,
> >  					struct netlink_ext_ack *extack);
> > -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
> > *encap);
> > +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
> > +					enum devlink_eswitch_encap_mode
> > *encap);
> >  void *mlx5_eswitch_get_uplink_priv(struct mlx5_eswitch *esw, u8
> > rep_type);
> >
> >  int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw, diff --git
> > a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > index e09ae27485ee..f1571163143d 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > @@ -2137,7 +2137,8 @@ int mlx5_eswitch_inline_mode_get(struct
> > mlx5_eswitch *esw, int nvfs, u8 *mode)
> >  	return 0;
> >  }
> >
> > -int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8
> > encap,
> > +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
> > +					enum devlink_eswitch_encap_mode
> > encap,
> >  					struct netlink_ext_ack *extack)
> >  {
> >  	struct mlx5_core_dev *dev = devlink_priv(devlink); @@ -2186,7
> > +2187,8 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink
> > *devlink, u8 encap,
> >  	return err;
> >  }
> >
> > -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
> > *encap)
> > +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
> > +					enum devlink_eswitch_encap_mode
> > *encap)
> >  {
> >  	struct mlx5_core_dev *dev = devlink_priv(devlink);
> >  	struct mlx5_eswitch *esw = dev->priv.eswitch; diff --git
> > a/include/net/devlink.h b/include/net/devlink.h index
> > 1c4adfb4195a..7a34fc586def 100644
> > --- a/include/net/devlink.h
> > +++ b/include/net/devlink.h
> > @@ -530,8 +530,10 @@ struct devlink_ops {
> >  	int (*eswitch_inline_mode_get)(struct devlink *devlink, u8
> > *p_inline_mode);
> >  	int (*eswitch_inline_mode_set)(struct devlink *devlink, u8
> > inline_mode,
> >  				       struct netlink_ext_ack *extack);
> > -	int (*eswitch_encap_mode_get)(struct devlink *devlink, u8
> > *p_encap_mode);
> > -	int (*eswitch_encap_mode_set)(struct devlink *devlink, u8
> > encap_mode,
> > +	int (*eswitch_encap_mode_get)(struct devlink *devlink,
> > +				      enum devlink_eswitch_encap_mode
> > *p_encap_mode);
> > +	int (*eswitch_encap_mode_set)(struct devlink *devlink,
> > +				      enum devlink_eswitch_encap_mode
> > encap_mode,
> >  				      struct netlink_ext_ack *extack);
> >  	int (*info_get)(struct devlink *devlink, struct devlink_info_req *req,
> >  			struct netlink_ext_ack *extack);
> > diff --git a/net/core/devlink.c b/net/core/devlink.c index
> > d43bc52b8840..47ae69363b07 100644
> > --- a/net/core/devlink.c
> > +++ b/net/core/devlink.c
> > @@ -1552,7 +1552,8 @@ static int devlink_nl_eswitch_fill(struct sk_buff
> > *msg, struct devlink *devlink,
> >  				   u32 seq, int flags)
> >  {
> >  	const struct devlink_ops *ops = devlink->ops;
> > -	u8 inline_mode, encap_mode;
> > +	enum devlink_eswitch_encap_mode encap_mode;
> > +	u8 inline_mode;
> >  	void *hdr;
> >  	int err = 0;
> >  	u16 mode;
> > @@ -1628,7 +1629,8 @@ static int devlink_nl_cmd_eswitch_set_doit(struct
> > sk_buff *skb,  {
> >  	struct devlink *devlink = info->user_ptr[0];
> >  	const struct devlink_ops *ops = devlink->ops;
> > -	u8 inline_mode, encap_mode;
> > +	enum devlink_eswitch_encap_mode encap_mode;
> > +	u8 inline_mode;
> >  	int err = 0;
> >  	u16 mode;
> >
> > --
> > 2.20.1
>
> Netdev follows reverse Christmas tree, but otherwise,

It was before this patch, if Jiri is ok with that, I'll change this
"const struct devlink_ops *ops = devlink->ops;" line while I'll apply
this patchset to mlx5-net. If not, I'll leave it as is.

> Reviewed-by: Parav Pandit <parav@mellanox.com>

Thanks

>

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

* Re: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode
  2019-06-13  5:59     ` Leon Romanovsky
@ 2019-06-16 10:07       ` Jiri Pirko
  2019-06-16 10:15         ` Leon Romanovsky
  0 siblings, 1 reply; 21+ messages in thread
From: Jiri Pirko @ 2019-06-16 10:07 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Parav Pandit, Doug Ledford, Jason Gunthorpe, RDMA mailing list,
	Maor Gottlieb, Mark Bloch, Petr Vorel, Saeed Mahameed,
	linux-netdev, Jiri Pirko

Thu, Jun 13, 2019 at 07:59:54AM CEST, leon@kernel.org wrote:
>On Thu, Jun 13, 2019 at 04:32:25AM +0000, Parav Pandit wrote:
>>
>>
>> > -----Original Message-----
>> > From: Leon Romanovsky <leon@kernel.org>
>> > Sent: Wednesday, June 12, 2019 5:50 PM
>> > To: Doug Ledford <dledford@redhat.com>; Jason Gunthorpe
>> > <jgg@mellanox.com>
>> > Cc: Leon Romanovsky <leonro@mellanox.com>; RDMA mailing list <linux-
>> > rdma@vger.kernel.org>; Maor Gottlieb <maorg@mellanox.com>; Mark Bloch
>> > <markb@mellanox.com>; Parav Pandit <parav@mellanox.com>; Petr Vorel
>> > <pvorel@suse.cz>; Saeed Mahameed <saeedm@mellanox.com>; linux-
>> > netdev <netdev@vger.kernel.org>; Jiri Pirko <jiri@mellanox.com>
>> > Subject: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink
>> > encap mode
>> >
>> > From: Leon Romanovsky <leonro@mellanox.com>
>> >
>> > Devlink has UAPI declaration for encap mode, so there is no need to be
>> > loose on the data get/set by drivers.
>> >
>> > Update call sites to use enum devlink_eswitch_encap_mode instead of plain
>> > u8.
>> >
>> > Suggested-by: Parav Pandit <parav@mellanox.com>
>> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
>> > ---
>> >  drivers/net/ethernet/mellanox/mlx5/core/eswitch.h         | 8 +++++---
>> >  .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c    | 6 ++++--
>> >  include/net/devlink.h                                     | 6 ++++--
>> >  net/core/devlink.c                                        | 6 ++++--
>> >  4 files changed, 17 insertions(+), 9 deletions(-)
>> >
>> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
>> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
>> > index ed3fad689ec9..e264dfc64a6e 100644
>> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
>> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
>> > @@ -175,7 +175,7 @@ struct mlx5_esw_offload {
>> >  	DECLARE_HASHTABLE(mod_hdr_tbl, 8);
>> >  	u8 inline_mode;
>> >  	u64 num_flows;
>> > -	u8 encap;
>> > +	enum devlink_eswitch_encap_mode encap;
>> >  };
>> >
>> >  /* E-Switch MC FDB table hash node */
>> > @@ -356,9 +356,11 @@ int mlx5_devlink_eswitch_inline_mode_set(struct
>> > devlink *devlink, u8 mode,
>> >  					 struct netlink_ext_ack *extack);
>> >  int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8
>> > *mode);  int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, int
>> > nvfs, u8 *mode); -int mlx5_devlink_eswitch_encap_mode_set(struct devlink
>> > *devlink, u8 encap,
>> > +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
>> > +					enum devlink_eswitch_encap_mode
>> > encap,
>> >  					struct netlink_ext_ack *extack);
>> > -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
>> > *encap);
>> > +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
>> > +					enum devlink_eswitch_encap_mode
>> > *encap);
>> >  void *mlx5_eswitch_get_uplink_priv(struct mlx5_eswitch *esw, u8
>> > rep_type);
>> >
>> >  int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw, diff --git
>> > a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>> > index e09ae27485ee..f1571163143d 100644
>> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>> > @@ -2137,7 +2137,8 @@ int mlx5_eswitch_inline_mode_get(struct
>> > mlx5_eswitch *esw, int nvfs, u8 *mode)
>> >  	return 0;
>> >  }
>> >
>> > -int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8
>> > encap,
>> > +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
>> > +					enum devlink_eswitch_encap_mode
>> > encap,
>> >  					struct netlink_ext_ack *extack)
>> >  {
>> >  	struct mlx5_core_dev *dev = devlink_priv(devlink); @@ -2186,7
>> > +2187,8 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink
>> > *devlink, u8 encap,
>> >  	return err;
>> >  }
>> >
>> > -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
>> > *encap)
>> > +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
>> > +					enum devlink_eswitch_encap_mode
>> > *encap)
>> >  {
>> >  	struct mlx5_core_dev *dev = devlink_priv(devlink);
>> >  	struct mlx5_eswitch *esw = dev->priv.eswitch; diff --git
>> > a/include/net/devlink.h b/include/net/devlink.h index
>> > 1c4adfb4195a..7a34fc586def 100644
>> > --- a/include/net/devlink.h
>> > +++ b/include/net/devlink.h
>> > @@ -530,8 +530,10 @@ struct devlink_ops {
>> >  	int (*eswitch_inline_mode_get)(struct devlink *devlink, u8
>> > *p_inline_mode);
>> >  	int (*eswitch_inline_mode_set)(struct devlink *devlink, u8
>> > inline_mode,
>> >  				       struct netlink_ext_ack *extack);
>> > -	int (*eswitch_encap_mode_get)(struct devlink *devlink, u8
>> > *p_encap_mode);
>> > -	int (*eswitch_encap_mode_set)(struct devlink *devlink, u8
>> > encap_mode,
>> > +	int (*eswitch_encap_mode_get)(struct devlink *devlink,
>> > +				      enum devlink_eswitch_encap_mode
>> > *p_encap_mode);
>> > +	int (*eswitch_encap_mode_set)(struct devlink *devlink,
>> > +				      enum devlink_eswitch_encap_mode
>> > encap_mode,
>> >  				      struct netlink_ext_ack *extack);
>> >  	int (*info_get)(struct devlink *devlink, struct devlink_info_req *req,
>> >  			struct netlink_ext_ack *extack);
>> > diff --git a/net/core/devlink.c b/net/core/devlink.c index
>> > d43bc52b8840..47ae69363b07 100644
>> > --- a/net/core/devlink.c
>> > +++ b/net/core/devlink.c
>> > @@ -1552,7 +1552,8 @@ static int devlink_nl_eswitch_fill(struct sk_buff
>> > *msg, struct devlink *devlink,
>> >  				   u32 seq, int flags)
>> >  {
>> >  	const struct devlink_ops *ops = devlink->ops;
>> > -	u8 inline_mode, encap_mode;
>> > +	enum devlink_eswitch_encap_mode encap_mode;
>> > +	u8 inline_mode;
>> >  	void *hdr;
>> >  	int err = 0;
>> >  	u16 mode;
>> > @@ -1628,7 +1629,8 @@ static int devlink_nl_cmd_eswitch_set_doit(struct
>> > sk_buff *skb,  {
>> >  	struct devlink *devlink = info->user_ptr[0];
>> >  	const struct devlink_ops *ops = devlink->ops;
>> > -	u8 inline_mode, encap_mode;
>> > +	enum devlink_eswitch_encap_mode encap_mode;
>> > +	u8 inline_mode;
>> >  	int err = 0;
>> >  	u16 mode;
>> >
>> > --
>> > 2.20.1
>>
>> Netdev follows reverse Christmas tree, but otherwise,
>
>It was before this patch, if Jiri is ok with that, I'll change this
>"const struct devlink_ops *ops = devlink->ops;" line while I'll apply
>this patchset to mlx5-net. If not, I'll leave it as is.

Change to what? I don't follow. The patch looks completely fine to me as
it is.

Acked-by: Jiri Pirko <jiri@mellanox.com>



>
>> Reviewed-by: Parav Pandit <parav@mellanox.com>
>
>Thanks
>
>>

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

* Re: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode
  2019-06-16 10:07       ` Jiri Pirko
@ 2019-06-16 10:15         ` Leon Romanovsky
  2019-06-16 10:39           ` Jiri Pirko
  0 siblings, 1 reply; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-16 10:15 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: Parav Pandit, Doug Ledford, Jason Gunthorpe, RDMA mailing list,
	Maor Gottlieb, Mark Bloch, Petr Vorel, Saeed Mahameed,
	linux-netdev, Jiri Pirko

On Sun, Jun 16, 2019 at 12:07:07PM +0200, Jiri Pirko wrote:
> Thu, Jun 13, 2019 at 07:59:54AM CEST, leon@kernel.org wrote:
> >On Thu, Jun 13, 2019 at 04:32:25AM +0000, Parav Pandit wrote:
> >>
> >>
> >> > -----Original Message-----
> >> > From: Leon Romanovsky <leon@kernel.org>
> >> > Sent: Wednesday, June 12, 2019 5:50 PM
> >> > To: Doug Ledford <dledford@redhat.com>; Jason Gunthorpe
> >> > <jgg@mellanox.com>
> >> > Cc: Leon Romanovsky <leonro@mellanox.com>; RDMA mailing list <linux-
> >> > rdma@vger.kernel.org>; Maor Gottlieb <maorg@mellanox.com>; Mark Bloch
> >> > <markb@mellanox.com>; Parav Pandit <parav@mellanox.com>; Petr Vorel
> >> > <pvorel@suse.cz>; Saeed Mahameed <saeedm@mellanox.com>; linux-
> >> > netdev <netdev@vger.kernel.org>; Jiri Pirko <jiri@mellanox.com>
> >> > Subject: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink
> >> > encap mode
> >> >
> >> > From: Leon Romanovsky <leonro@mellanox.com>
> >> >
> >> > Devlink has UAPI declaration for encap mode, so there is no need to be
> >> > loose on the data get/set by drivers.
> >> >
> >> > Update call sites to use enum devlink_eswitch_encap_mode instead of plain
> >> > u8.
> >> >
> >> > Suggested-by: Parav Pandit <parav@mellanox.com>
> >> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> >> > ---
> >> >  drivers/net/ethernet/mellanox/mlx5/core/eswitch.h         | 8 +++++---
> >> >  .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c    | 6 ++++--
> >> >  include/net/devlink.h                                     | 6 ++++--
> >> >  net/core/devlink.c                                        | 6 ++++--
> >> >  4 files changed, 17 insertions(+), 9 deletions(-)
> >> >
> >> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> >> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> >> > index ed3fad689ec9..e264dfc64a6e 100644
> >> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> >> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> >> > @@ -175,7 +175,7 @@ struct mlx5_esw_offload {
> >> >  	DECLARE_HASHTABLE(mod_hdr_tbl, 8);
> >> >  	u8 inline_mode;
> >> >  	u64 num_flows;
> >> > -	u8 encap;
> >> > +	enum devlink_eswitch_encap_mode encap;
> >> >  };
> >> >
> >> >  /* E-Switch MC FDB table hash node */
> >> > @@ -356,9 +356,11 @@ int mlx5_devlink_eswitch_inline_mode_set(struct
> >> > devlink *devlink, u8 mode,
> >> >  					 struct netlink_ext_ack *extack);
> >> >  int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8
> >> > *mode);  int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, int
> >> > nvfs, u8 *mode); -int mlx5_devlink_eswitch_encap_mode_set(struct devlink
> >> > *devlink, u8 encap,
> >> > +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
> >> > +					enum devlink_eswitch_encap_mode
> >> > encap,
> >> >  					struct netlink_ext_ack *extack);
> >> > -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
> >> > *encap);
> >> > +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
> >> > +					enum devlink_eswitch_encap_mode
> >> > *encap);
> >> >  void *mlx5_eswitch_get_uplink_priv(struct mlx5_eswitch *esw, u8
> >> > rep_type);
> >> >
> >> >  int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw, diff --git
> >> > a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> >> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> >> > index e09ae27485ee..f1571163143d 100644
> >> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> >> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> >> > @@ -2137,7 +2137,8 @@ int mlx5_eswitch_inline_mode_get(struct
> >> > mlx5_eswitch *esw, int nvfs, u8 *mode)
> >> >  	return 0;
> >> >  }
> >> >
> >> > -int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8
> >> > encap,
> >> > +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
> >> > +					enum devlink_eswitch_encap_mode
> >> > encap,
> >> >  					struct netlink_ext_ack *extack)
> >> >  {
> >> >  	struct mlx5_core_dev *dev = devlink_priv(devlink); @@ -2186,7
> >> > +2187,8 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink
> >> > *devlink, u8 encap,
> >> >  	return err;
> >> >  }
> >> >
> >> > -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
> >> > *encap)
> >> > +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
> >> > +					enum devlink_eswitch_encap_mode
> >> > *encap)
> >> >  {
> >> >  	struct mlx5_core_dev *dev = devlink_priv(devlink);
> >> >  	struct mlx5_eswitch *esw = dev->priv.eswitch; diff --git
> >> > a/include/net/devlink.h b/include/net/devlink.h index
> >> > 1c4adfb4195a..7a34fc586def 100644
> >> > --- a/include/net/devlink.h
> >> > +++ b/include/net/devlink.h
> >> > @@ -530,8 +530,10 @@ struct devlink_ops {
> >> >  	int (*eswitch_inline_mode_get)(struct devlink *devlink, u8
> >> > *p_inline_mode);
> >> >  	int (*eswitch_inline_mode_set)(struct devlink *devlink, u8
> >> > inline_mode,
> >> >  				       struct netlink_ext_ack *extack);
> >> > -	int (*eswitch_encap_mode_get)(struct devlink *devlink, u8
> >> > *p_encap_mode);
> >> > -	int (*eswitch_encap_mode_set)(struct devlink *devlink, u8
> >> > encap_mode,
> >> > +	int (*eswitch_encap_mode_get)(struct devlink *devlink,
> >> > +				      enum devlink_eswitch_encap_mode
> >> > *p_encap_mode);
> >> > +	int (*eswitch_encap_mode_set)(struct devlink *devlink,
> >> > +				      enum devlink_eswitch_encap_mode
> >> > encap_mode,
> >> >  				      struct netlink_ext_ack *extack);
> >> >  	int (*info_get)(struct devlink *devlink, struct devlink_info_req *req,
> >> >  			struct netlink_ext_ack *extack);
> >> > diff --git a/net/core/devlink.c b/net/core/devlink.c index
> >> > d43bc52b8840..47ae69363b07 100644
> >> > --- a/net/core/devlink.c
> >> > +++ b/net/core/devlink.c
> >> > @@ -1552,7 +1552,8 @@ static int devlink_nl_eswitch_fill(struct sk_buff
> >> > *msg, struct devlink *devlink,
> >> >  				   u32 seq, int flags)
> >> >  {
> >> >  	const struct devlink_ops *ops = devlink->ops;
> >> > -	u8 inline_mode, encap_mode;
> >> > +	enum devlink_eswitch_encap_mode encap_mode;
> >> > +	u8 inline_mode;
> >> >  	void *hdr;
> >> >  	int err = 0;
> >> >  	u16 mode;
> >> > @@ -1628,7 +1629,8 @@ static int devlink_nl_cmd_eswitch_set_doit(struct
> >> > sk_buff *skb,  {
> >> >  	struct devlink *devlink = info->user_ptr[0];
> >> >  	const struct devlink_ops *ops = devlink->ops;
> >> > -	u8 inline_mode, encap_mode;
> >> > +	enum devlink_eswitch_encap_mode encap_mode;
> >> > +	u8 inline_mode;
> >> >  	int err = 0;
> >> >  	u16 mode;
> >> >
> >> > --
> >> > 2.20.1
> >>
> >> Netdev follows reverse Christmas tree, but otherwise,
> >
> >It was before this patch, if Jiri is ok with that, I'll change this
> >"const struct devlink_ops *ops = devlink->ops;" line while I'll apply
> >this patchset to mlx5-net. If not, I'll leave it as is.
>
> Change to what? I don't follow. The patch looks completely fine to me as
> it is.

Thanks Jiri,

Parav mentioned that two lines above my change were already not in Christmas
tree format.

   struct devlink *devlink = info->user_ptr[0];
   const struct devlink_ops *ops = devlink->ops;

Thanks

>
> Acked-by: Jiri Pirko <jiri@mellanox.com>
>
>
>
> >
> >> Reviewed-by: Parav Pandit <parav@mellanox.com>
> >
> >Thanks
> >
> >>

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

* Re: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode
  2019-06-16 10:15         ` Leon Romanovsky
@ 2019-06-16 10:39           ` Jiri Pirko
  2019-06-16 10:53             ` Leon Romanovsky
  0 siblings, 1 reply; 21+ messages in thread
From: Jiri Pirko @ 2019-06-16 10:39 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Parav Pandit, Doug Ledford, Jason Gunthorpe, RDMA mailing list,
	Maor Gottlieb, Mark Bloch, Petr Vorel, Saeed Mahameed,
	linux-netdev, Jiri Pirko

Sun, Jun 16, 2019 at 12:15:07PM CEST, leon@kernel.org wrote:
>On Sun, Jun 16, 2019 at 12:07:07PM +0200, Jiri Pirko wrote:
>> Thu, Jun 13, 2019 at 07:59:54AM CEST, leon@kernel.org wrote:
>> >On Thu, Jun 13, 2019 at 04:32:25AM +0000, Parav Pandit wrote:
>> >>
>> >>
>> >> > -----Original Message-----
>> >> > From: Leon Romanovsky <leon@kernel.org>
>> >> > Sent: Wednesday, June 12, 2019 5:50 PM
>> >> > To: Doug Ledford <dledford@redhat.com>; Jason Gunthorpe
>> >> > <jgg@mellanox.com>
>> >> > Cc: Leon Romanovsky <leonro@mellanox.com>; RDMA mailing list <linux-
>> >> > rdma@vger.kernel.org>; Maor Gottlieb <maorg@mellanox.com>; Mark Bloch
>> >> > <markb@mellanox.com>; Parav Pandit <parav@mellanox.com>; Petr Vorel
>> >> > <pvorel@suse.cz>; Saeed Mahameed <saeedm@mellanox.com>; linux-
>> >> > netdev <netdev@vger.kernel.org>; Jiri Pirko <jiri@mellanox.com>
>> >> > Subject: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink
>> >> > encap mode
>> >> >
>> >> > From: Leon Romanovsky <leonro@mellanox.com>
>> >> >
>> >> > Devlink has UAPI declaration for encap mode, so there is no need to be
>> >> > loose on the data get/set by drivers.
>> >> >
>> >> > Update call sites to use enum devlink_eswitch_encap_mode instead of plain
>> >> > u8.
>> >> >
>> >> > Suggested-by: Parav Pandit <parav@mellanox.com>
>> >> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
>> >> > ---
>> >> >  drivers/net/ethernet/mellanox/mlx5/core/eswitch.h         | 8 +++++---
>> >> >  .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c    | 6 ++++--
>> >> >  include/net/devlink.h                                     | 6 ++++--
>> >> >  net/core/devlink.c                                        | 6 ++++--
>> >> >  4 files changed, 17 insertions(+), 9 deletions(-)
>> >> >
>> >> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
>> >> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
>> >> > index ed3fad689ec9..e264dfc64a6e 100644
>> >> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
>> >> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
>> >> > @@ -175,7 +175,7 @@ struct mlx5_esw_offload {
>> >> >  	DECLARE_HASHTABLE(mod_hdr_tbl, 8);
>> >> >  	u8 inline_mode;
>> >> >  	u64 num_flows;
>> >> > -	u8 encap;
>> >> > +	enum devlink_eswitch_encap_mode encap;
>> >> >  };
>> >> >
>> >> >  /* E-Switch MC FDB table hash node */
>> >> > @@ -356,9 +356,11 @@ int mlx5_devlink_eswitch_inline_mode_set(struct
>> >> > devlink *devlink, u8 mode,
>> >> >  					 struct netlink_ext_ack *extack);
>> >> >  int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8
>> >> > *mode);  int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, int
>> >> > nvfs, u8 *mode); -int mlx5_devlink_eswitch_encap_mode_set(struct devlink
>> >> > *devlink, u8 encap,
>> >> > +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
>> >> > +					enum devlink_eswitch_encap_mode
>> >> > encap,
>> >> >  					struct netlink_ext_ack *extack);
>> >> > -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
>> >> > *encap);
>> >> > +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
>> >> > +					enum devlink_eswitch_encap_mode
>> >> > *encap);
>> >> >  void *mlx5_eswitch_get_uplink_priv(struct mlx5_eswitch *esw, u8
>> >> > rep_type);
>> >> >
>> >> >  int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw, diff --git
>> >> > a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>> >> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>> >> > index e09ae27485ee..f1571163143d 100644
>> >> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>> >> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>> >> > @@ -2137,7 +2137,8 @@ int mlx5_eswitch_inline_mode_get(struct
>> >> > mlx5_eswitch *esw, int nvfs, u8 *mode)
>> >> >  	return 0;
>> >> >  }
>> >> >
>> >> > -int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8
>> >> > encap,
>> >> > +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
>> >> > +					enum devlink_eswitch_encap_mode
>> >> > encap,
>> >> >  					struct netlink_ext_ack *extack)
>> >> >  {
>> >> >  	struct mlx5_core_dev *dev = devlink_priv(devlink); @@ -2186,7
>> >> > +2187,8 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink
>> >> > *devlink, u8 encap,
>> >> >  	return err;
>> >> >  }
>> >> >
>> >> > -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
>> >> > *encap)
>> >> > +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
>> >> > +					enum devlink_eswitch_encap_mode
>> >> > *encap)
>> >> >  {
>> >> >  	struct mlx5_core_dev *dev = devlink_priv(devlink);
>> >> >  	struct mlx5_eswitch *esw = dev->priv.eswitch; diff --git
>> >> > a/include/net/devlink.h b/include/net/devlink.h index
>> >> > 1c4adfb4195a..7a34fc586def 100644
>> >> > --- a/include/net/devlink.h
>> >> > +++ b/include/net/devlink.h
>> >> > @@ -530,8 +530,10 @@ struct devlink_ops {
>> >> >  	int (*eswitch_inline_mode_get)(struct devlink *devlink, u8
>> >> > *p_inline_mode);
>> >> >  	int (*eswitch_inline_mode_set)(struct devlink *devlink, u8
>> >> > inline_mode,
>> >> >  				       struct netlink_ext_ack *extack);
>> >> > -	int (*eswitch_encap_mode_get)(struct devlink *devlink, u8
>> >> > *p_encap_mode);
>> >> > -	int (*eswitch_encap_mode_set)(struct devlink *devlink, u8
>> >> > encap_mode,
>> >> > +	int (*eswitch_encap_mode_get)(struct devlink *devlink,
>> >> > +				      enum devlink_eswitch_encap_mode
>> >> > *p_encap_mode);
>> >> > +	int (*eswitch_encap_mode_set)(struct devlink *devlink,
>> >> > +				      enum devlink_eswitch_encap_mode
>> >> > encap_mode,
>> >> >  				      struct netlink_ext_ack *extack);
>> >> >  	int (*info_get)(struct devlink *devlink, struct devlink_info_req *req,
>> >> >  			struct netlink_ext_ack *extack);
>> >> > diff --git a/net/core/devlink.c b/net/core/devlink.c index
>> >> > d43bc52b8840..47ae69363b07 100644
>> >> > --- a/net/core/devlink.c
>> >> > +++ b/net/core/devlink.c
>> >> > @@ -1552,7 +1552,8 @@ static int devlink_nl_eswitch_fill(struct sk_buff
>> >> > *msg, struct devlink *devlink,
>> >> >  				   u32 seq, int flags)
>> >> >  {
>> >> >  	const struct devlink_ops *ops = devlink->ops;
>> >> > -	u8 inline_mode, encap_mode;
>> >> > +	enum devlink_eswitch_encap_mode encap_mode;
>> >> > +	u8 inline_mode;
>> >> >  	void *hdr;
>> >> >  	int err = 0;
>> >> >  	u16 mode;
>> >> > @@ -1628,7 +1629,8 @@ static int devlink_nl_cmd_eswitch_set_doit(struct
>> >> > sk_buff *skb,  {
>> >> >  	struct devlink *devlink = info->user_ptr[0];
>> >> >  	const struct devlink_ops *ops = devlink->ops;
>> >> > -	u8 inline_mode, encap_mode;
>> >> > +	enum devlink_eswitch_encap_mode encap_mode;
>> >> > +	u8 inline_mode;
>> >> >  	int err = 0;
>> >> >  	u16 mode;
>> >> >
>> >> > --
>> >> > 2.20.1
>> >>
>> >> Netdev follows reverse Christmas tree, but otherwise,
>> >
>> >It was before this patch, if Jiri is ok with that, I'll change this
>> >"const struct devlink_ops *ops = devlink->ops;" line while I'll apply
>> >this patchset to mlx5-net. If not, I'll leave it as is.
>>
>> Change to what? I don't follow. The patch looks completely fine to me as
>> it is.
>
>Thanks Jiri,
>
>Parav mentioned that two lines above my change were already not in Christmas
>tree format.
>
>   struct devlink *devlink = info->user_ptr[0];
>   const struct devlink_ops *ops = devlink->ops;

As there is a dependency between those 2 lines, I don't see how you can
fix this.


>
>Thanks
>
>>
>> Acked-by: Jiri Pirko <jiri@mellanox.com>
>>
>>
>>
>> >
>> >> Reviewed-by: Parav Pandit <parav@mellanox.com>
>> >
>> >Thanks
>> >
>> >>

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

* Re: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode
  2019-06-16 10:39           ` Jiri Pirko
@ 2019-06-16 10:53             ` Leon Romanovsky
  2019-06-16 11:18               ` Jiri Pirko
  0 siblings, 1 reply; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-16 10:53 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: Parav Pandit, Doug Ledford, Jason Gunthorpe, RDMA mailing list,
	Maor Gottlieb, Mark Bloch, Petr Vorel, Saeed Mahameed,
	linux-netdev, Jiri Pirko

On Sun, Jun 16, 2019 at 12:39:40PM +0200, Jiri Pirko wrote:
> Sun, Jun 16, 2019 at 12:15:07PM CEST, leon@kernel.org wrote:
> >On Sun, Jun 16, 2019 at 12:07:07PM +0200, Jiri Pirko wrote:
> >> Thu, Jun 13, 2019 at 07:59:54AM CEST, leon@kernel.org wrote:
> >> >On Thu, Jun 13, 2019 at 04:32:25AM +0000, Parav Pandit wrote:
> >> >>
> >> >>
> >> >> > -----Original Message-----
> >> >> > From: Leon Romanovsky <leon@kernel.org>
> >> >> > Sent: Wednesday, June 12, 2019 5:50 PM
> >> >> > To: Doug Ledford <dledford@redhat.com>; Jason Gunthorpe
> >> >> > <jgg@mellanox.com>
> >> >> > Cc: Leon Romanovsky <leonro@mellanox.com>; RDMA mailing list <linux-
> >> >> > rdma@vger.kernel.org>; Maor Gottlieb <maorg@mellanox.com>; Mark Bloch
> >> >> > <markb@mellanox.com>; Parav Pandit <parav@mellanox.com>; Petr Vorel
> >> >> > <pvorel@suse.cz>; Saeed Mahameed <saeedm@mellanox.com>; linux-
> >> >> > netdev <netdev@vger.kernel.org>; Jiri Pirko <jiri@mellanox.com>
> >> >> > Subject: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink
> >> >> > encap mode
> >> >> >
> >> >> > From: Leon Romanovsky <leonro@mellanox.com>
> >> >> >
> >> >> > Devlink has UAPI declaration for encap mode, so there is no need to be
> >> >> > loose on the data get/set by drivers.
> >> >> >
> >> >> > Update call sites to use enum devlink_eswitch_encap_mode instead of plain
> >> >> > u8.
> >> >> >
> >> >> > Suggested-by: Parav Pandit <parav@mellanox.com>
> >> >> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> >> >> > ---
> >> >> >  drivers/net/ethernet/mellanox/mlx5/core/eswitch.h         | 8 +++++---
> >> >> >  .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c    | 6 ++++--
> >> >> >  include/net/devlink.h                                     | 6 ++++--
> >> >> >  net/core/devlink.c                                        | 6 ++++--
> >> >> >  4 files changed, 17 insertions(+), 9 deletions(-)
> >> >> >
> >> >> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> >> >> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> >> >> > index ed3fad689ec9..e264dfc64a6e 100644
> >> >> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> >> >> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> >> >> > @@ -175,7 +175,7 @@ struct mlx5_esw_offload {
> >> >> >  	DECLARE_HASHTABLE(mod_hdr_tbl, 8);
> >> >> >  	u8 inline_mode;
> >> >> >  	u64 num_flows;
> >> >> > -	u8 encap;
> >> >> > +	enum devlink_eswitch_encap_mode encap;
> >> >> >  };
> >> >> >
> >> >> >  /* E-Switch MC FDB table hash node */
> >> >> > @@ -356,9 +356,11 @@ int mlx5_devlink_eswitch_inline_mode_set(struct
> >> >> > devlink *devlink, u8 mode,
> >> >> >  					 struct netlink_ext_ack *extack);
> >> >> >  int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8
> >> >> > *mode);  int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, int
> >> >> > nvfs, u8 *mode); -int mlx5_devlink_eswitch_encap_mode_set(struct devlink
> >> >> > *devlink, u8 encap,
> >> >> > +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
> >> >> > +					enum devlink_eswitch_encap_mode
> >> >> > encap,
> >> >> >  					struct netlink_ext_ack *extack);
> >> >> > -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
> >> >> > *encap);
> >> >> > +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
> >> >> > +					enum devlink_eswitch_encap_mode
> >> >> > *encap);
> >> >> >  void *mlx5_eswitch_get_uplink_priv(struct mlx5_eswitch *esw, u8
> >> >> > rep_type);
> >> >> >
> >> >> >  int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw, diff --git
> >> >> > a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> >> >> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> >> >> > index e09ae27485ee..f1571163143d 100644
> >> >> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> >> >> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> >> >> > @@ -2137,7 +2137,8 @@ int mlx5_eswitch_inline_mode_get(struct
> >> >> > mlx5_eswitch *esw, int nvfs, u8 *mode)
> >> >> >  	return 0;
> >> >> >  }
> >> >> >
> >> >> > -int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8
> >> >> > encap,
> >> >> > +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
> >> >> > +					enum devlink_eswitch_encap_mode
> >> >> > encap,
> >> >> >  					struct netlink_ext_ack *extack)
> >> >> >  {
> >> >> >  	struct mlx5_core_dev *dev = devlink_priv(devlink); @@ -2186,7
> >> >> > +2187,8 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink
> >> >> > *devlink, u8 encap,
> >> >> >  	return err;
> >> >> >  }
> >> >> >
> >> >> > -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
> >> >> > *encap)
> >> >> > +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
> >> >> > +					enum devlink_eswitch_encap_mode
> >> >> > *encap)
> >> >> >  {
> >> >> >  	struct mlx5_core_dev *dev = devlink_priv(devlink);
> >> >> >  	struct mlx5_eswitch *esw = dev->priv.eswitch; diff --git
> >> >> > a/include/net/devlink.h b/include/net/devlink.h index
> >> >> > 1c4adfb4195a..7a34fc586def 100644
> >> >> > --- a/include/net/devlink.h
> >> >> > +++ b/include/net/devlink.h
> >> >> > @@ -530,8 +530,10 @@ struct devlink_ops {
> >> >> >  	int (*eswitch_inline_mode_get)(struct devlink *devlink, u8
> >> >> > *p_inline_mode);
> >> >> >  	int (*eswitch_inline_mode_set)(struct devlink *devlink, u8
> >> >> > inline_mode,
> >> >> >  				       struct netlink_ext_ack *extack);
> >> >> > -	int (*eswitch_encap_mode_get)(struct devlink *devlink, u8
> >> >> > *p_encap_mode);
> >> >> > -	int (*eswitch_encap_mode_set)(struct devlink *devlink, u8
> >> >> > encap_mode,
> >> >> > +	int (*eswitch_encap_mode_get)(struct devlink *devlink,
> >> >> > +				      enum devlink_eswitch_encap_mode
> >> >> > *p_encap_mode);
> >> >> > +	int (*eswitch_encap_mode_set)(struct devlink *devlink,
> >> >> > +				      enum devlink_eswitch_encap_mode
> >> >> > encap_mode,
> >> >> >  				      struct netlink_ext_ack *extack);
> >> >> >  	int (*info_get)(struct devlink *devlink, struct devlink_info_req *req,
> >> >> >  			struct netlink_ext_ack *extack);
> >> >> > diff --git a/net/core/devlink.c b/net/core/devlink.c index
> >> >> > d43bc52b8840..47ae69363b07 100644
> >> >> > --- a/net/core/devlink.c
> >> >> > +++ b/net/core/devlink.c
> >> >> > @@ -1552,7 +1552,8 @@ static int devlink_nl_eswitch_fill(struct sk_buff
> >> >> > *msg, struct devlink *devlink,
> >> >> >  				   u32 seq, int flags)
> >> >> >  {
> >> >> >  	const struct devlink_ops *ops = devlink->ops;
> >> >> > -	u8 inline_mode, encap_mode;
> >> >> > +	enum devlink_eswitch_encap_mode encap_mode;
> >> >> > +	u8 inline_mode;
> >> >> >  	void *hdr;
> >> >> >  	int err = 0;
> >> >> >  	u16 mode;
> >> >> > @@ -1628,7 +1629,8 @@ static int devlink_nl_cmd_eswitch_set_doit(struct
> >> >> > sk_buff *skb,  {
> >> >> >  	struct devlink *devlink = info->user_ptr[0];
> >> >> >  	const struct devlink_ops *ops = devlink->ops;
> >> >> > -	u8 inline_mode, encap_mode;
> >> >> > +	enum devlink_eswitch_encap_mode encap_mode;
> >> >> > +	u8 inline_mode;
> >> >> >  	int err = 0;
> >> >> >  	u16 mode;
> >> >> >
> >> >> > --
> >> >> > 2.20.1
> >> >>
> >> >> Netdev follows reverse Christmas tree, but otherwise,
> >> >
> >> >It was before this patch, if Jiri is ok with that, I'll change this
> >> >"const struct devlink_ops *ops = devlink->ops;" line while I'll apply
> >> >this patchset to mlx5-net. If not, I'll leave it as is.
> >>
> >> Change to what? I don't follow. The patch looks completely fine to me as
> >> it is.
> >
> >Thanks Jiri,
> >
> >Parav mentioned that two lines above my change were already not in Christmas
> >tree format.
> >
> >   struct devlink *devlink = info->user_ptr[0];
> >   const struct devlink_ops *ops = devlink->ops;
>
> As there is a dependency between those 2 lines, I don't see how you can
> fix this.

I don't want to do it, but this is possible solution:

	const struct devlink_ops *ops:
	struct devlink *devlink;
	..... extra declarations ....

	devlink = info->user_ptr[0];
	ops = devlink->ops;
	... rest of the code ...
>
>
> >
> >Thanks
> >
> >>
> >> Acked-by: Jiri Pirko <jiri@mellanox.com>
> >>
> >>
> >>
> >> >
> >> >> Reviewed-by: Parav Pandit <parav@mellanox.com>
> >> >
> >> >Thanks
> >> >
> >> >>

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

* Re: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode
  2019-06-16 10:53             ` Leon Romanovsky
@ 2019-06-16 11:18               ` Jiri Pirko
  0 siblings, 0 replies; 21+ messages in thread
From: Jiri Pirko @ 2019-06-16 11:18 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Parav Pandit, Doug Ledford, Jason Gunthorpe, RDMA mailing list,
	Maor Gottlieb, Mark Bloch, Petr Vorel, Saeed Mahameed,
	linux-netdev, Jiri Pirko

Sun, Jun 16, 2019 at 12:53:27PM CEST, leon@kernel.org wrote:
>On Sun, Jun 16, 2019 at 12:39:40PM +0200, Jiri Pirko wrote:
>> Sun, Jun 16, 2019 at 12:15:07PM CEST, leon@kernel.org wrote:
>> >On Sun, Jun 16, 2019 at 12:07:07PM +0200, Jiri Pirko wrote:
>> >> Thu, Jun 13, 2019 at 07:59:54AM CEST, leon@kernel.org wrote:
>> >> >On Thu, Jun 13, 2019 at 04:32:25AM +0000, Parav Pandit wrote:
>> >> >>
>> >> >>
>> >> >> > -----Original Message-----
>> >> >> > From: Leon Romanovsky <leon@kernel.org>
>> >> >> > Sent: Wednesday, June 12, 2019 5:50 PM
>> >> >> > To: Doug Ledford <dledford@redhat.com>; Jason Gunthorpe
>> >> >> > <jgg@mellanox.com>
>> >> >> > Cc: Leon Romanovsky <leonro@mellanox.com>; RDMA mailing list <linux-
>> >> >> > rdma@vger.kernel.org>; Maor Gottlieb <maorg@mellanox.com>; Mark Bloch
>> >> >> > <markb@mellanox.com>; Parav Pandit <parav@mellanox.com>; Petr Vorel
>> >> >> > <pvorel@suse.cz>; Saeed Mahameed <saeedm@mellanox.com>; linux-
>> >> >> > netdev <netdev@vger.kernel.org>; Jiri Pirko <jiri@mellanox.com>
>> >> >> > Subject: [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink
>> >> >> > encap mode
>> >> >> >
>> >> >> > From: Leon Romanovsky <leonro@mellanox.com>
>> >> >> >
>> >> >> > Devlink has UAPI declaration for encap mode, so there is no need to be
>> >> >> > loose on the data get/set by drivers.
>> >> >> >
>> >> >> > Update call sites to use enum devlink_eswitch_encap_mode instead of plain
>> >> >> > u8.
>> >> >> >
>> >> >> > Suggested-by: Parav Pandit <parav@mellanox.com>
>> >> >> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
>> >> >> > ---
>> >> >> >  drivers/net/ethernet/mellanox/mlx5/core/eswitch.h         | 8 +++++---
>> >> >> >  .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c    | 6 ++++--
>> >> >> >  include/net/devlink.h                                     | 6 ++++--
>> >> >> >  net/core/devlink.c                                        | 6 ++++--
>> >> >> >  4 files changed, 17 insertions(+), 9 deletions(-)
>> >> >> >
>> >> >> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
>> >> >> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
>> >> >> > index ed3fad689ec9..e264dfc64a6e 100644
>> >> >> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
>> >> >> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
>> >> >> > @@ -175,7 +175,7 @@ struct mlx5_esw_offload {
>> >> >> >  	DECLARE_HASHTABLE(mod_hdr_tbl, 8);
>> >> >> >  	u8 inline_mode;
>> >> >> >  	u64 num_flows;
>> >> >> > -	u8 encap;
>> >> >> > +	enum devlink_eswitch_encap_mode encap;
>> >> >> >  };
>> >> >> >
>> >> >> >  /* E-Switch MC FDB table hash node */
>> >> >> > @@ -356,9 +356,11 @@ int mlx5_devlink_eswitch_inline_mode_set(struct
>> >> >> > devlink *devlink, u8 mode,
>> >> >> >  					 struct netlink_ext_ack *extack);
>> >> >> >  int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8
>> >> >> > *mode);  int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, int
>> >> >> > nvfs, u8 *mode); -int mlx5_devlink_eswitch_encap_mode_set(struct devlink
>> >> >> > *devlink, u8 encap,
>> >> >> > +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
>> >> >> > +					enum devlink_eswitch_encap_mode
>> >> >> > encap,
>> >> >> >  					struct netlink_ext_ack *extack);
>> >> >> > -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
>> >> >> > *encap);
>> >> >> > +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
>> >> >> > +					enum devlink_eswitch_encap_mode
>> >> >> > *encap);
>> >> >> >  void *mlx5_eswitch_get_uplink_priv(struct mlx5_eswitch *esw, u8
>> >> >> > rep_type);
>> >> >> >
>> >> >> >  int mlx5_eswitch_add_vlan_action(struct mlx5_eswitch *esw, diff --git
>> >> >> > a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>> >> >> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>> >> >> > index e09ae27485ee..f1571163143d 100644
>> >> >> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>> >> >> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
>> >> >> > @@ -2137,7 +2137,8 @@ int mlx5_eswitch_inline_mode_get(struct
>> >> >> > mlx5_eswitch *esw, int nvfs, u8 *mode)
>> >> >> >  	return 0;
>> >> >> >  }
>> >> >> >
>> >> >> > -int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, u8
>> >> >> > encap,
>> >> >> > +int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
>> >> >> > +					enum devlink_eswitch_encap_mode
>> >> >> > encap,
>> >> >> >  					struct netlink_ext_ack *extack)
>> >> >> >  {
>> >> >> >  	struct mlx5_core_dev *dev = devlink_priv(devlink); @@ -2186,7
>> >> >> > +2187,8 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink
>> >> >> > *devlink, u8 encap,
>> >> >> >  	return err;
>> >> >> >  }
>> >> >> >
>> >> >> > -int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink, u8
>> >> >> > *encap)
>> >> >> > +int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
>> >> >> > +					enum devlink_eswitch_encap_mode
>> >> >> > *encap)
>> >> >> >  {
>> >> >> >  	struct mlx5_core_dev *dev = devlink_priv(devlink);
>> >> >> >  	struct mlx5_eswitch *esw = dev->priv.eswitch; diff --git
>> >> >> > a/include/net/devlink.h b/include/net/devlink.h index
>> >> >> > 1c4adfb4195a..7a34fc586def 100644
>> >> >> > --- a/include/net/devlink.h
>> >> >> > +++ b/include/net/devlink.h
>> >> >> > @@ -530,8 +530,10 @@ struct devlink_ops {
>> >> >> >  	int (*eswitch_inline_mode_get)(struct devlink *devlink, u8
>> >> >> > *p_inline_mode);
>> >> >> >  	int (*eswitch_inline_mode_set)(struct devlink *devlink, u8
>> >> >> > inline_mode,
>> >> >> >  				       struct netlink_ext_ack *extack);
>> >> >> > -	int (*eswitch_encap_mode_get)(struct devlink *devlink, u8
>> >> >> > *p_encap_mode);
>> >> >> > -	int (*eswitch_encap_mode_set)(struct devlink *devlink, u8
>> >> >> > encap_mode,
>> >> >> > +	int (*eswitch_encap_mode_get)(struct devlink *devlink,
>> >> >> > +				      enum devlink_eswitch_encap_mode
>> >> >> > *p_encap_mode);
>> >> >> > +	int (*eswitch_encap_mode_set)(struct devlink *devlink,
>> >> >> > +				      enum devlink_eswitch_encap_mode
>> >> >> > encap_mode,
>> >> >> >  				      struct netlink_ext_ack *extack);
>> >> >> >  	int (*info_get)(struct devlink *devlink, struct devlink_info_req *req,
>> >> >> >  			struct netlink_ext_ack *extack);
>> >> >> > diff --git a/net/core/devlink.c b/net/core/devlink.c index
>> >> >> > d43bc52b8840..47ae69363b07 100644
>> >> >> > --- a/net/core/devlink.c
>> >> >> > +++ b/net/core/devlink.c
>> >> >> > @@ -1552,7 +1552,8 @@ static int devlink_nl_eswitch_fill(struct sk_buff
>> >> >> > *msg, struct devlink *devlink,
>> >> >> >  				   u32 seq, int flags)
>> >> >> >  {
>> >> >> >  	const struct devlink_ops *ops = devlink->ops;
>> >> >> > -	u8 inline_mode, encap_mode;
>> >> >> > +	enum devlink_eswitch_encap_mode encap_mode;
>> >> >> > +	u8 inline_mode;
>> >> >> >  	void *hdr;
>> >> >> >  	int err = 0;
>> >> >> >  	u16 mode;
>> >> >> > @@ -1628,7 +1629,8 @@ static int devlink_nl_cmd_eswitch_set_doit(struct
>> >> >> > sk_buff *skb,  {
>> >> >> >  	struct devlink *devlink = info->user_ptr[0];
>> >> >> >  	const struct devlink_ops *ops = devlink->ops;
>> >> >> > -	u8 inline_mode, encap_mode;
>> >> >> > +	enum devlink_eswitch_encap_mode encap_mode;
>> >> >> > +	u8 inline_mode;
>> >> >> >  	int err = 0;
>> >> >> >  	u16 mode;
>> >> >> >
>> >> >> > --
>> >> >> > 2.20.1
>> >> >>
>> >> >> Netdev follows reverse Christmas tree, but otherwise,
>> >> >
>> >> >It was before this patch, if Jiri is ok with that, I'll change this
>> >> >"const struct devlink_ops *ops = devlink->ops;" line while I'll apply
>> >> >this patchset to mlx5-net. If not, I'll leave it as is.
>> >>
>> >> Change to what? I don't follow. The patch looks completely fine to me as
>> >> it is.
>> >
>> >Thanks Jiri,
>> >
>> >Parav mentioned that two lines above my change were already not in Christmas
>> >tree format.
>> >
>> >   struct devlink *devlink = info->user_ptr[0];
>> >   const struct devlink_ops *ops = devlink->ops;
>>
>> As there is a dependency between those 2 lines, I don't see how you can
>> fix this.
>
>I don't want to do it, but this is possible solution:
>
>	const struct devlink_ops *ops:
>	struct devlink *devlink;
>	..... extra declarations ....
>
>	devlink = info->user_ptr[0];
>	ops = devlink->ops;
>	... rest of the code ...

Please don't.


>>
>>
>> >
>> >Thanks
>> >
>> >>
>> >> Acked-by: Jiri Pirko <jiri@mellanox.com>
>> >>
>> >>
>> >>
>> >> >
>> >> >> Reviewed-by: Parav Pandit <parav@mellanox.com>
>> >> >
>> >> >Thanks
>> >> >
>> >> >>

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

* Re: [PATCH rdma-next v1 0/4] Expose ENCAP mode to mlx5_ib
  2019-06-12 12:20 ` Leon Romanovsky
                   ` (4 preceding siblings ...)
  (?)
@ 2019-06-16 12:44 ` Leon Romanovsky
  2019-06-17 20:18   ` Doug Ledford
  -1 siblings, 1 reply; 21+ messages in thread
From: Leon Romanovsky @ 2019-06-16 12:44 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: RDMA mailing list, Maor Gottlieb, Mark Bloch, Parav Pandit,
	Petr Vorel, Saeed Mahameed, linux-netdev, Jiri Pirko

On Wed, Jun 12, 2019 at 03:20:10PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
>
> Changelog v0->v1:
>  * Added patch to devlink to use declared enum for encap mode instead of u8
>  * Constify input argumetn to encap mode function
>  * fix encap variable type to be boolean
>
> ---------------------------------------------------------------------
> Hi,
>
> This is short series from Maor to expose and use enacap mode inside mlx5_ib.
>
> Thanks
>
> Leon Romanovsky (1):
>   net/mlx5: Declare more strictly devlink encap mode
>
> Maor Gottlieb (3):
>   net/mlx5: Expose eswitch encap mode

Those two applied to mlx5-next
82b11f071936 net/mlx5: Expose eswitch encap mode
98fdbea55037 net/mlx5: Declare more strictly devlink encap mode

>   RDMA/mlx5: Consider eswitch encap mode
>   RDMA/mlx5: Enable decap and packet reformat on FDB

Doug, Jason

Can you please take those two patches in addition to latest mlx5-next?

Thanks

>
>  drivers/infiniband/hw/mlx5/main.c             | 25 ++++++++++++++-----
>  .../net/ethernet/mellanox/mlx5/core/eswitch.c | 11 ++++++++
>  .../net/ethernet/mellanox/mlx5/core/eswitch.h |  8 +++---
>  .../mellanox/mlx5/core/eswitch_offloads.c     |  6 +++--
>  include/linux/mlx5/eswitch.h                  | 12 +++++++++
>  include/net/devlink.h                         |  6 +++--
>  net/core/devlink.c                            |  6 +++--
>  7 files changed, 59 insertions(+), 15 deletions(-)
>
> --
> 2.20.1
>

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

* Re: [PATCH rdma-next v1 0/4] Expose ENCAP mode to mlx5_ib
  2019-06-16 12:44 ` [PATCH rdma-next v1 0/4] Expose ENCAP mode to mlx5_ib Leon Romanovsky
@ 2019-06-17 20:18   ` Doug Ledford
  0 siblings, 0 replies; 21+ messages in thread
From: Doug Ledford @ 2019-06-17 20:18 UTC (permalink / raw)
  To: Leon Romanovsky, Jason Gunthorpe
  Cc: RDMA mailing list, Maor Gottlieb, Mark Bloch, Parav Pandit,
	Petr Vorel, Saeed Mahameed, linux-netdev, Jiri Pirko

[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]

On Sun, 2019-06-16 at 12:44 +0000, Leon Romanovsky wrote:
> On Wed, Jun 12, 2019 at 03:20:10PM +0300, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@mellanox.com>
> > 
> > Changelog v0->v1:
> >  * Added patch to devlink to use declared enum for encap mode
> > instead of u8
> >  * Constify input argumetn to encap mode function
> >  * fix encap variable type to be boolean
> > 
> > -----------------------------------------------------------------
> > ----
> > Hi,
> > 
> > This is short series from Maor to expose and use enacap mode inside
> > mlx5_ib.
> > 
> > Thanks
> > 
> > Leon Romanovsky (1):
> >   net/mlx5: Declare more strictly devlink encap mode
> > 
> > Maor Gottlieb (3):
> >   net/mlx5: Expose eswitch encap mode
> 
> Those two applied to mlx5-next
> 82b11f071936 net/mlx5: Expose eswitch encap mode
> 98fdbea55037 net/mlx5: Declare more strictly devlink encap mode
> 
> >   RDMA/mlx5: Consider eswitch encap mode
> >   RDMA/mlx5: Enable decap and packet reformat on FDB
> 
> Doug, Jason
> 
> Can you please take those two patches in addition to latest mlx5-
> next?

Done, thanks.


-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57
2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2019-06-17 20:18 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-12 12:20 [PATCH rdma-next v1 0/4] Expose ENCAP mode to mlx5_ib Leon Romanovsky
2019-06-12 12:20 ` Leon Romanovsky
2019-06-12 12:20 ` [PATCH mlx5-next v1 1/4] net/mlx5: Declare more strictly devlink encap mode Leon Romanovsky
2019-06-12 12:20   ` Leon Romanovsky
2019-06-12 12:36   ` Petr Vorel
2019-06-13  4:32   ` Parav Pandit
2019-06-13  5:59     ` Leon Romanovsky
2019-06-16 10:07       ` Jiri Pirko
2019-06-16 10:15         ` Leon Romanovsky
2019-06-16 10:39           ` Jiri Pirko
2019-06-16 10:53             ` Leon Romanovsky
2019-06-16 11:18               ` Jiri Pirko
2019-06-12 12:20 ` [PATCH mlx5-next v1 2/4] net/mlx5: Expose eswitch " Leon Romanovsky
2019-06-12 12:20   ` Leon Romanovsky
2019-06-13  4:34   ` Parav Pandit
2019-06-12 12:20 ` [PATCH rdma-next v1 3/4] RDMA/mlx5: Consider " Leon Romanovsky
2019-06-12 12:20   ` Leon Romanovsky
2019-06-12 12:20 ` [PATCH rdma-next v1 4/4] RDMA/mlx5: Enable decap and packet reformat on FDB Leon Romanovsky
2019-06-12 12:20   ` Leon Romanovsky
2019-06-16 12:44 ` [PATCH rdma-next v1 0/4] Expose ENCAP mode to mlx5_ib Leon Romanovsky
2019-06-17 20:18   ` Doug Ledford

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.