public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@nvidia•com>
To: Saeed Mahameed <saeedm@nvidia•com>,
	Leon Romanovsky <leonro@mellanox•com>
Cc: <netdev@vger•kernel.org>, <linux-rdma@vger•kernel.org>,
	Chris Mi <cmi@nvidia•com>, Oz Shlomo <ozsh@nvidia•com>
Subject: [PATCH mlx5-next 02/16] net/mlx5: Add sampler destination type
Date: Fri, 20 Nov 2020 15:03:25 -0800	[thread overview]
Message-ID: <20201120230339.651609-3-saeedm@nvidia.com> (raw)
In-Reply-To: <20201120230339.651609-1-saeedm@nvidia.com>

From: Chris Mi <cmi@nvidia•com>

The flow sampler object is a new destination type. Add a new member
for the flow destination.

Signed-off-by: Chris Mi <cmi@nvidia•com>
Reviewed-by: Oz Shlomo <ozsh@nvidia•com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia•com>
---
 drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c | 3 +++
 drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c             | 3 +++
 include/linux/mlx5/fs.h                                      | 1 +
 include/linux/mlx5/mlx5_ifc.h                                | 1 +
 4 files changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c
index a700f3c86899..87d65f6b5310 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c
@@ -247,6 +247,9 @@ const char *parse_fs_dst(struct trace_seq *p,
 	case MLX5_FLOW_DESTINATION_TYPE_TIR:
 		trace_seq_printf(p, "tir=%u\n", dst->tir_num);
 		break;
+	case MLX5_FLOW_DESTINATION_TYPE_FLOW_SAMPLER:
+		trace_seq_printf(p, "sampler_id=%u\n", dst->sampler_id);
+		break;
 	case MLX5_FLOW_DESTINATION_TYPE_COUNTER:
 		trace_seq_printf(p, "counter_id=%u\n", counter_id);
 		break;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c
index babe3405132a..c2fed9c3d75c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c
@@ -515,6 +515,9 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
 						 dst->dest_attr.vport.pkt_reformat->id);
 				}
 				break;
+			case MLX5_FLOW_DESTINATION_TYPE_FLOW_SAMPLER:
+				id = dst->dest_attr.sampler_id;
+				break;
 			default:
 				id = dst->dest_attr.tir_num;
 			}
diff --git a/include/linux/mlx5/fs.h b/include/linux/mlx5/fs.h
index 846d94ad04bc..35d2cc1646d3 100644
--- a/include/linux/mlx5/fs.h
+++ b/include/linux/mlx5/fs.h
@@ -132,6 +132,7 @@ struct mlx5_flow_destination {
 			struct mlx5_pkt_reformat *pkt_reformat;
 			u8		flags;
 		} vport;
+		u32			sampler_id;
 	};
 };
 
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 65ea35af0527..2f2add4bd5e1 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -1616,6 +1616,7 @@ enum mlx5_flow_destination_type {
 	MLX5_FLOW_DESTINATION_TYPE_VPORT        = 0x0,
 	MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE   = 0x1,
 	MLX5_FLOW_DESTINATION_TYPE_TIR          = 0x2,
+	MLX5_FLOW_DESTINATION_TYPE_FLOW_SAMPLER = 0x6,
 
 	MLX5_FLOW_DESTINATION_TYPE_PORT         = 0x99,
 	MLX5_FLOW_DESTINATION_TYPE_COUNTER      = 0x100,
-- 
2.26.2


  parent reply	other threads:[~2020-11-20 23:04 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 23:03 [PATCH mlx5-next 00/16] mlx5 next updates 2020-11-20 Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 01/16] net/mlx5: Add sample offload hardware bits and structures Saeed Mahameed
2020-11-20 23:03 ` Saeed Mahameed [this message]
2020-11-20 23:03 ` [PATCH mlx5-next 03/16] net/mlx5: Check dr mask size against mlx5_match_param size Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 04/16] net/mlx5: Add misc4 to mlx5_ifc_fte_match_param_bits Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 05/16] net/mlx5: Add ts_cqe_to_dest_cqn related bits Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 06/16] net/mlx5: Avoid exposing driver internal command helpers Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 07/16] net/mlx5: Update the list of the PCI supported devices Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 08/16] net/mlx5: Update the hardware interface definition for vhca state Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 09/16] net/mlx5: Expose IP-in-IP TX and RX capability bits Saeed Mahameed
2020-11-21 23:58   ` Jakub Kicinski
2020-11-22 15:17     ` Aya Levin
2020-11-23 21:15       ` Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 10/16] net/mlx5: Expose other function ifc bits Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 11/16] net/mlx5: Add VDPA priority to NIC RX namespace Saeed Mahameed
2020-11-22  0:01   ` Jakub Kicinski
2020-11-22  6:41     ` Eli Cohen
2020-11-24 17:12       ` Jakub Kicinski
2020-11-24 18:02         ` Jason Gunthorpe
2020-11-24 18:41           ` Jakub Kicinski
2020-11-24 19:44             ` Jason Gunthorpe
2020-11-25  6:19               ` Eli Cohen
2020-11-25 19:04                 ` Saeed Mahameed
2020-11-25 18:54               ` Jakub Kicinski
2020-11-25 19:28                 ` Saeed Mahameed
2020-11-25 21:22                 ` Jason Gunthorpe
2020-11-20 23:03 ` [PATCH mlx5-next 12/16] net/mlx5: Export steering related functions Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 13/16] net/mlx5: Make API mlx5_core_is_ecpf accept const pointer Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 14/16] net/mlx5: Rename peer_pf to host_pf Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 15/16] net/mlx5: Enable host PF HCA after eswitch is initialized Saeed Mahameed
2020-11-20 23:03 ` [PATCH mlx5-next 16/16] net/mlx5: Treat host PF vport as other (non eswitch manager) vport Saeed Mahameed
2020-11-30 18:42 ` [PATCH mlx5-next 00/16] mlx5 next updates 2020-11-20 Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201120230339.651609-3-saeedm@nvidia.com \
    --to=saeedm@nvidia$(echo .)com \
    --cc=cmi@nvidia$(echo .)com \
    --cc=leonro@mellanox$(echo .)com \
    --cc=linux-rdma@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=ozsh@nvidia$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox