netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH mlx5-next 0/4] mlx5 next updates 2020-07-14
@ 2020-07-15  4:28 Saeed Mahameed
  2020-07-15  4:28 ` [PATCH mlx5-next 1/4] net/mlx5: Support setting access rights of dma addresses Saeed Mahameed
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Saeed Mahameed @ 2020-07-15  4:28 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky; +Cc: netdev, linux-rdma

Hi,

This patchset introduces some updates to mlx5 next shared branch.

1) Eli Cohen, Adds HW and mlx5_core driver definitions and bits for
upcoming mlx5 VDPA driver support.
2) Michael Guralnik Enables count actions for simple allow steering
rule.

In case of no objections this patchset will be applied to mlx5-next and
later sent to rdma and net-next trees.

Thanks,
Saeed.

Eli Cohen (3):
  net/mlx5: Support setting access rights of dma addresses
  net/mlx5: Add VDPA interface type to supported enumerations
  net/mlx5: Add interface changes required for VDPA

Michael Guralnik (1):
  net/mlx5: Enable count action for rules with allow action

 .../net/ethernet/mellanox/mlx5/core/alloc.c   |  11 +-
 .../net/ethernet/mellanox/mlx5/core/fs_core.c |   1 +
 include/linux/mlx5/device.h                   |   4 +-
 include/linux/mlx5/driver.h                   |   2 +
 include/linux/mlx5/mlx5_ifc.h                 | 118 +++++++++++++++---
 5 files changed, 118 insertions(+), 18 deletions(-)

-- 
2.26.2


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

* [PATCH mlx5-next 1/4] net/mlx5: Support setting access rights of dma addresses
  2020-07-15  4:28 [PATCH mlx5-next 0/4] mlx5 next updates 2020-07-14 Saeed Mahameed
@ 2020-07-15  4:28 ` Saeed Mahameed
  2020-07-15  4:28 ` [PATCH mlx5-next 2/4] net/mlx5: Add VDPA interface type to supported enumerations Saeed Mahameed
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Saeed Mahameed @ 2020-07-15  4:28 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky
  Cc: netdev, linux-rdma, Eli Cohen, Parav Pandit

From: Eli Cohen <eli@mellanox.com>

mlx5_fill_page_frag_array() is used to populate dma addresses to
resources that require it, such as QPs, RQs etc. When the resource is
used, PA list permissions are ignored. For resources that use MTT list,
the user is required to provide the access rights. Subsequent patches
use resources that require MTT lists, so modify API and implementation
to support that.

Signed-off-by: Eli Cohen <eli@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 11 +++++++++--
 include/linux/mlx5/driver.h                     |  1 +
 include/linux/mlx5/mlx5_ifc.h                   |  6 ++++++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
index 42198e64a7f49..8db4b5f0f963b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
@@ -299,11 +299,18 @@ void mlx5_fill_page_array(struct mlx5_frag_buf *buf, __be64 *pas)
 }
 EXPORT_SYMBOL_GPL(mlx5_fill_page_array);
 
-void mlx5_fill_page_frag_array(struct mlx5_frag_buf *buf, __be64 *pas)
+void mlx5_fill_page_frag_array_perm(struct mlx5_frag_buf *buf, __be64 *pas, u8 perm)
 {
 	int i;
 
+	WARN_ON(perm & 0xfc);
 	for (i = 0; i < buf->npages; i++)
-		pas[i] = cpu_to_be64(buf->frags[i].map);
+		pas[i] = cpu_to_be64(buf->frags[i].map | perm);
+}
+EXPORT_SYMBOL_GPL(mlx5_fill_page_frag_array_perm);
+
+void mlx5_fill_page_frag_array(struct mlx5_frag_buf *buf, __be64 *pas)
+{
+	mlx5_fill_page_frag_array_perm(buf, pas, 0);
 }
 EXPORT_SYMBOL_GPL(mlx5_fill_page_frag_array);
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 13c0e4556eda9..f2557d7e1355c 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -971,6 +971,7 @@ void mlx5_register_debugfs(void);
 void mlx5_unregister_debugfs(void);
 
 void mlx5_fill_page_array(struct mlx5_frag_buf *buf, __be64 *pas);
+void mlx5_fill_page_frag_array_perm(struct mlx5_frag_buf *buf, __be64 *pas, u8 perm);
 void mlx5_fill_page_frag_array(struct mlx5_frag_buf *frag_buf, __be64 *pas);
 int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn,
 		    unsigned int *irqn);
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 3786888cb1bac..5890e5c9da779 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -10653,4 +10653,10 @@ struct mlx5_ifc_tls_progress_params_bits {
 	u8         hw_offset_record_number[0x18];
 };
 
+enum {
+	MLX5_MTT_PERM_READ	= 1 << 0,
+	MLX5_MTT_PERM_WRITE	= 1 << 1,
+	MLX5_MTT_PERM_RW	= MLX5_MTT_PERM_READ | MLX5_MTT_PERM_WRITE,
+};
+
 #endif /* MLX5_IFC_H */
-- 
2.26.2


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

* [PATCH mlx5-next 2/4] net/mlx5: Add VDPA interface type to supported enumerations
  2020-07-15  4:28 [PATCH mlx5-next 0/4] mlx5 next updates 2020-07-14 Saeed Mahameed
  2020-07-15  4:28 ` [PATCH mlx5-next 1/4] net/mlx5: Support setting access rights of dma addresses Saeed Mahameed
@ 2020-07-15  4:28 ` Saeed Mahameed
  2020-07-15  4:28 ` [PATCH mlx5-next 3/4] net/mlx5: Add interface changes required for VDPA Saeed Mahameed
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Saeed Mahameed @ 2020-07-15  4:28 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky
  Cc: netdev, linux-rdma, Eli Cohen, Parav Pandit

From: Eli Cohen <eli@mellanox.com>

VDPA is a new interface that will be added in subsequent patches. It
uses mlx5 core devices and resources. Add an interface type for it.

Signed-off-by: Eli Cohen <eli@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 include/linux/mlx5/driver.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index f2557d7e1355c..5ecc48831ae8b 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -1054,6 +1054,7 @@ enum {
 enum {
 	MLX5_INTERFACE_PROTOCOL_IB  = 0,
 	MLX5_INTERFACE_PROTOCOL_ETH = 1,
+	MLX5_INTERFACE_PROTOCOL_VDPA = 2,
 };
 
 struct mlx5_interface {
-- 
2.26.2


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

* [PATCH mlx5-next 3/4] net/mlx5: Add interface changes required for VDPA
  2020-07-15  4:28 [PATCH mlx5-next 0/4] mlx5 next updates 2020-07-14 Saeed Mahameed
  2020-07-15  4:28 ` [PATCH mlx5-next 1/4] net/mlx5: Support setting access rights of dma addresses Saeed Mahameed
  2020-07-15  4:28 ` [PATCH mlx5-next 2/4] net/mlx5: Add VDPA interface type to supported enumerations Saeed Mahameed
@ 2020-07-15  4:28 ` Saeed Mahameed
  2020-07-15  4:28 ` [PATCH mlx5-next 4/4] net/mlx5: Enable count action for rules with allow action Saeed Mahameed
  2020-07-16  6:01 ` [PATCH mlx5-next 0/4] mlx5 next updates 2020-07-14 Saeed Mahameed
  4 siblings, 0 replies; 6+ messages in thread
From: Saeed Mahameed @ 2020-07-15  4:28 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky
  Cc: netdev, linux-rdma, Eli Cohen, Parav Pandit

From: Eli Cohen <eli@mellanox.com>

Rename mlx5_ifc_device_virtio_emulation_cap_bits to
mlx5_ifc_virtio_emulation_cap_bits to match names produced by the
tools producing these auto generated files.

In addition missing capabilities that will be required by VDPA
implementation.

Signed-off-by: Eli Cohen <eli@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 include/linux/mlx5/device.h   |   4 +-
 include/linux/mlx5/mlx5_ifc.h | 112 +++++++++++++++++++++++++++++-----
 2 files changed, 100 insertions(+), 16 deletions(-)

diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 57db125e58021..2aacf9a8ee4df 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -1361,11 +1361,11 @@ enum mlx5_qcam_feature_groups {
 	MLX5_ADDR_OF(device_event_cap, (mdev)->caps.hca_cur[MLX5_CAP_DEV_EVENT], cap)
 
 #define MLX5_CAP_DEV_VDPA_EMULATION(mdev, cap)\
-	MLX5_GET(device_virtio_emulation_cap, \
+	MLX5_GET(virtio_emulation_cap, \
 		(mdev)->caps.hca_cur[MLX5_CAP_VDPA_EMULATION], cap)
 
 #define MLX5_CAP64_DEV_VDPA_EMULATION(mdev, cap)\
-	MLX5_GET64(device_virtio_emulation_cap, \
+	MLX5_GET64(virtio_emulation_cap, \
 		(mdev)->caps.hca_cur[MLX5_CAP_VDPA_EMULATION], cap)
 
 #define MLX5_CAP_IPSEC(mdev, cap)\
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 5890e5c9da779..435ab47d53620 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -93,6 +93,7 @@ enum {
 
 enum {
 	MLX5_OBJ_TYPE_GENEVE_TLV_OPT = 0x000b,
+	MLX5_OBJ_TYPE_VIRTIO_NET_Q = 0x000d,
 	MLX5_OBJ_TYPE_MKEY = 0xff01,
 	MLX5_OBJ_TYPE_QP = 0xff02,
 	MLX5_OBJ_TYPE_PSV = 0xff03,
@@ -981,17 +982,40 @@ struct mlx5_ifc_device_event_cap_bits {
 	u8         user_unaffiliated_events[4][0x40];
 };
 
-struct mlx5_ifc_device_virtio_emulation_cap_bits {
-	u8         reserved_at_0[0x20];
+struct mlx5_ifc_virtio_emulation_cap_bits {
+	u8         desc_tunnel_offload_type[0x1];
+	u8         eth_frame_offload_type[0x1];
+	u8         virtio_version_1_0[0x1];
+	u8         device_features_bits_mask[0xd];
+	u8         event_mode[0x8];
+	u8         virtio_queue_type[0x8];
 
-	u8         reserved_at_20[0x13];
+	u8         max_tunnel_desc[0x10];
+	u8         reserved_at_30[0x3];
 	u8         log_doorbell_stride[0x5];
 	u8         reserved_at_38[0x3];
 	u8         log_doorbell_bar_size[0x5];
 
 	u8         doorbell_bar_offset[0x40];
 
-	u8         reserved_at_80[0x780];
+	u8         max_emulated_devices[0x8];
+	u8         max_num_virtio_queues[0x18];
+
+	u8         reserved_at_a0[0x60];
+
+	u8         umem_1_buffer_param_a[0x20];
+
+	u8         umem_1_buffer_param_b[0x20];
+
+	u8         umem_2_buffer_param_a[0x20];
+
+	u8         umem_2_buffer_param_b[0x20];
+
+	u8         umem_3_buffer_param_a[0x20];
+
+	u8         umem_3_buffer_param_b[0x20];
+
+	u8         reserved_at_1c0[0x640];
 };
 
 enum {
@@ -1216,7 +1240,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {
 
 	u8         max_sgl_for_optimized_performance[0x8];
 	u8         log_max_cq_sz[0x8];
-	u8         reserved_at_d0[0xb];
+	u8         reserved_at_d0[0x9];
+	u8         virtio_net_device_emualtion_manager[0x1];
+	u8         virtio_blk_device_emualtion_manager[0x1];
 	u8         log_max_cq[0x5];
 
 	u8         log_max_eq_sz[0x8];
@@ -2952,7 +2978,7 @@ union mlx5_ifc_hca_cap_union_bits {
 	struct mlx5_ifc_fpga_cap_bits fpga_cap;
 	struct mlx5_ifc_tls_cap_bits tls_cap;
 	struct mlx5_ifc_device_mem_cap_bits device_mem_cap;
-	struct mlx5_ifc_device_virtio_emulation_cap_bits virtio_emulation_cap;
+	struct mlx5_ifc_virtio_emulation_cap_bits virtio_emulation_cap;
 	u8         reserved_at_0[0x8000];
 };
 
@@ -3298,15 +3324,18 @@ struct mlx5_ifc_scheduling_context_bits {
 };
 
 struct mlx5_ifc_rqtc_bits {
-	u8         reserved_at_0[0xa0];
+	u8    reserved_at_0[0xa0];
 
-	u8         reserved_at_a0[0x10];
-	u8         rqt_max_size[0x10];
+	u8    reserved_at_a0[0x5];
+	u8    list_q_type[0x3];
+	u8    reserved_at_a8[0x8];
+	u8    rqt_max_size[0x10];
 
-	u8         reserved_at_c0[0x10];
-	u8         rqt_actual_size[0x10];
+	u8    rq_vhca_id_format[0x1];
+	u8    reserved_at_c1[0xf];
+	u8    rqt_actual_size[0x10];
 
-	u8         reserved_at_e0[0x6a0];
+	u8    reserved_at_e0[0x6a0];
 
 	struct mlx5_ifc_rq_num_bits rq_num[];
 };
@@ -7084,7 +7113,7 @@ struct mlx5_ifc_destroy_mkey_out_bits {
 
 struct mlx5_ifc_destroy_mkey_in_bits {
 	u8         opcode[0x10];
-	u8         reserved_at_10[0x10];
+	u8         uid[0x10];
 
 	u8         reserved_at_20[0x10];
 	u8         op_mod[0x10];
@@ -7782,7 +7811,7 @@ struct mlx5_ifc_create_mkey_out_bits {
 
 struct mlx5_ifc_create_mkey_in_bits {
 	u8         opcode[0x10];
-	u8         reserved_at_10[0x10];
+	u8         uid[0x10];
 
 	u8         reserved_at_20[0x10];
 	u8         op_mod[0x10];
@@ -10312,6 +10341,40 @@ struct mlx5_ifc_create_umem_in_bits {
 	struct mlx5_ifc_umem_bits  umem;
 };
 
+struct mlx5_ifc_create_umem_out_bits {
+	u8         status[0x8];
+	u8         reserved_at_8[0x18];
+
+	u8         syndrome[0x20];
+
+	u8         reserved_at_40[0x8];
+	u8         umem_id[0x18];
+
+	u8         reserved_at_60[0x20];
+};
+
+struct mlx5_ifc_destroy_umem_in_bits {
+	u8        opcode[0x10];
+	u8        uid[0x10];
+
+	u8        reserved_at_20[0x10];
+	u8        op_mod[0x10];
+
+	u8        reserved_at_40[0x8];
+	u8        umem_id[0x18];
+
+	u8        reserved_at_60[0x20];
+};
+
+struct mlx5_ifc_destroy_umem_out_bits {
+	u8        status[0x8];
+	u8        reserved_at_8[0x18];
+
+	u8        syndrome[0x20];
+
+	u8        reserved_at_40[0x40];
+};
+
 struct mlx5_ifc_create_uctx_in_bits {
 	u8         opcode[0x10];
 	u8         reserved_at_10[0x10];
@@ -10324,6 +10387,18 @@ struct mlx5_ifc_create_uctx_in_bits {
 	struct mlx5_ifc_uctx_bits  uctx;
 };
 
+struct mlx5_ifc_create_uctx_out_bits {
+	u8         status[0x8];
+	u8         reserved_at_8[0x18];
+
+	u8         syndrome[0x20];
+
+	u8         reserved_at_40[0x10];
+	u8         uid[0x10];
+
+	u8         reserved_at_60[0x20];
+};
+
 struct mlx5_ifc_destroy_uctx_in_bits {
 	u8         opcode[0x10];
 	u8         reserved_at_10[0x10];
@@ -10337,6 +10412,15 @@ struct mlx5_ifc_destroy_uctx_in_bits {
 	u8         reserved_at_60[0x20];
 };
 
+struct mlx5_ifc_destroy_uctx_out_bits {
+	u8         status[0x8];
+	u8         reserved_at_8[0x18];
+
+	u8         syndrome[0x20];
+
+	u8          reserved_at_40[0x40];
+};
+
 struct mlx5_ifc_create_sw_icm_in_bits {
 	struct mlx5_ifc_general_obj_in_cmd_hdr_bits   hdr;
 	struct mlx5_ifc_sw_icm_bits		      sw_icm;
-- 
2.26.2


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

* [PATCH mlx5-next 4/4] net/mlx5: Enable count action for rules with allow action
  2020-07-15  4:28 [PATCH mlx5-next 0/4] mlx5 next updates 2020-07-14 Saeed Mahameed
                   ` (2 preceding siblings ...)
  2020-07-15  4:28 ` [PATCH mlx5-next 3/4] net/mlx5: Add interface changes required for VDPA Saeed Mahameed
@ 2020-07-15  4:28 ` Saeed Mahameed
  2020-07-16  6:01 ` [PATCH mlx5-next 0/4] mlx5 next updates 2020-07-14 Saeed Mahameed
  4 siblings, 0 replies; 6+ messages in thread
From: Saeed Mahameed @ 2020-07-15  4:28 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky
  Cc: netdev, linux-rdma, Michael Guralnik, Mark Bloch

From: Michael Guralnik <michaelgur@mellanox.com>

Enable the creation of rules with allow and count actions.
This enables using counters on egress flow tables.

Signed-off-by: Michael Guralnik <michaelgur@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index e47a669839356..644fe4c2f0fa0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1598,6 +1598,7 @@ static struct mlx5_flow_handle *add_rule_fg(struct mlx5_flow_group *fg,
 static bool counter_is_valid(u32 action)
 {
 	return (action & (MLX5_FLOW_CONTEXT_ACTION_DROP |
+			  MLX5_FLOW_CONTEXT_ACTION_ALLOW |
 			  MLX5_FLOW_CONTEXT_ACTION_FWD_DEST));
 }
 
-- 
2.26.2


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

* Re: [PATCH mlx5-next 0/4] mlx5 next updates 2020-07-14
  2020-07-15  4:28 [PATCH mlx5-next 0/4] mlx5 next updates 2020-07-14 Saeed Mahameed
                   ` (3 preceding siblings ...)
  2020-07-15  4:28 ` [PATCH mlx5-next 4/4] net/mlx5: Enable count action for rules with allow action Saeed Mahameed
@ 2020-07-16  6:01 ` Saeed Mahameed
  4 siblings, 0 replies; 6+ messages in thread
From: Saeed Mahameed @ 2020-07-16  6:01 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: netdev, linux-rdma

On Tue, 2020-07-14 at 21:28 -0700, Saeed Mahameed wrote:
> Hi,
> 
> This patchset introduces some updates to mlx5 next shared branch.
> 
> 1) Eli Cohen, Adds HW and mlx5_core driver definitions and bits for
> upcoming mlx5 VDPA driver support.
> 2) Michael Guralnik Enables count actions for simple allow steering
> rule.
> 
> In case of no objections this patchset will be applied to mlx5-next
> and
> later sent to rdma and net-next trees.

Patches applied to mlx5-next.
Thanks !


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

end of thread, other threads:[~2020-07-16  6:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15  4:28 [PATCH mlx5-next 0/4] mlx5 next updates 2020-07-14 Saeed Mahameed
2020-07-15  4:28 ` [PATCH mlx5-next 1/4] net/mlx5: Support setting access rights of dma addresses Saeed Mahameed
2020-07-15  4:28 ` [PATCH mlx5-next 2/4] net/mlx5: Add VDPA interface type to supported enumerations Saeed Mahameed
2020-07-15  4:28 ` [PATCH mlx5-next 3/4] net/mlx5: Add interface changes required for VDPA Saeed Mahameed
2020-07-15  4:28 ` [PATCH mlx5-next 4/4] net/mlx5: Enable count action for rules with allow action Saeed Mahameed
2020-07-16  6:01 ` [PATCH mlx5-next 0/4] mlx5 next updates 2020-07-14 Saeed Mahameed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).