DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matan Azrad <matan@nvidia.com>
To: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Cc: dev@dpdk.org, Dekel Peled <dekelp@nvidia.com>
Subject: [dpdk-dev] [PATCH v2 1/9] common/mlx5: add DevX API to create ASO flow hit object
Date: Sun,  1 Nov 2020 17:57:44 +0000
Message-ID: <1604253472-213766-2-git-send-email-matan@nvidia.com> (raw)
In-Reply-To: <1604253472-213766-1-git-send-email-matan@nvidia.com>

From: Dekel Peled <dekelp@nvidia.com>

Add DevX API to create ASO flow hit object.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 45 ++++++++++++++++++++++++++++++++++++
 drivers/common/mlx5/mlx5_devx_cmds.h |  4 ++++
 drivers/common/mlx5/mlx5_prm.h       | 14 +++++++++++
 drivers/common/mlx5/version.map      |  1 +
 4 files changed, 64 insertions(+)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index a13febe..a87b624 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -1995,3 +1995,48 @@ struct mlx5_devx_obj *
 					invalid_buffer);
 	return ret;
 }
+
+/**
+ * Create general object of type FLOW_HIT_ASO using DevX API.
+ *
+ * @param[in] ctx
+ *   Context returned from mlx5 open_device() glue function.
+ * @param [in] pd
+ *   PD value to associate the FLOW_HIT_ASO object with.
+ *
+ * @return
+ *   The DevX object created, NULL otherwise and rte_errno is set.
+ */
+struct mlx5_devx_obj *
+mlx5_devx_cmd_create_flow_hit_aso_obj(void *ctx, uint32_t pd)
+{
+	uint32_t in[MLX5_ST_SZ_DW(create_flow_hit_aso_in)] = {0};
+	uint32_t out[MLX5_ST_SZ_DW(general_obj_out_cmd_hdr)] = {0};
+	struct mlx5_devx_obj *flow_hit_aso_obj = NULL;
+	void *ptr = NULL;
+
+	flow_hit_aso_obj = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*flow_hit_aso_obj),
+				       0, SOCKET_ID_ANY);
+	if (!flow_hit_aso_obj) {
+		DRV_LOG(ERR, "Failed to allocate FLOW_HIT_ASO object data");
+		rte_errno = ENOMEM;
+		return NULL;
+	}
+	ptr = MLX5_ADDR_OF(create_flow_hit_aso_in, in, hdr);
+	MLX5_SET(general_obj_in_cmd_hdr, ptr, opcode,
+		 MLX5_CMD_OP_CREATE_GENERAL_OBJECT);
+	MLX5_SET(general_obj_in_cmd_hdr, ptr, obj_type,
+		 MLX5_GENERAL_OBJ_TYPE_FLOW_HIT_ASO);
+	ptr = MLX5_ADDR_OF(create_flow_hit_aso_in, in, flow_hit_aso);
+	MLX5_SET(flow_hit_aso, ptr, access_pd, pd);
+	flow_hit_aso_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in),
+							   out, sizeof(out));
+	if (!flow_hit_aso_obj->obj) {
+		rte_errno = errno;
+		DRV_LOG(ERR, "Failed to create FLOW_HIT_ASO obj using DevX.");
+		mlx5_free(flow_hit_aso_obj);
+		return NULL;
+	}
+	flow_hit_aso_obj->id = MLX5_GET(general_obj_out_cmd_hdr, out, obj_id);
+	return flow_hit_aso_obj;
+}
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index 472d1cb..c3bbc01 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -485,4 +485,8 @@ int mlx5_devx_cmd_register_read(void *ctx, uint16_t reg_id,
 int mlx5_devx_cmd_query_virtio_q_counters(struct mlx5_devx_obj *couners_obj,
 				  struct mlx5_devx_virtio_q_couners_attr *attr);
 
+__rte_internal
+struct mlx5_devx_obj *mlx5_devx_cmd_create_flow_hit_aso_obj(void *ctx,
+							    uint32_t pd);
+
 #endif /* RTE_PMD_MLX5_DEVX_CMDS_H_ */
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 7d671a3..c2cdd78 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -2211,6 +2211,7 @@ enum {
 	MLX5_GENERAL_OBJ_TYPE_VIRTQ = 0x000d,
 	MLX5_GENERAL_OBJ_TYPE_VIRTIO_Q_COUNTERS = 0x001c,
 	MLX5_GENERAL_OBJ_TYPE_FLEX_PARSE_GRAPH = 0x0022,
+	MLX5_GENERAL_OBJ_TYPE_FLOW_HIT_ASO = 0x0025,
 };
 
 struct mlx5_ifc_general_obj_in_cmd_hdr_bits {
@@ -2330,6 +2331,19 @@ struct mlx5_ifc_query_virtq_out_bits {
 	struct mlx5_ifc_virtio_net_q_bits virtq;
 };
 
+struct mlx5_ifc_flow_hit_aso_bits {
+	u8 modify_field_select[0x40];
+	u8 reserved_at_40[0x48];
+	u8 access_pd[0x18];
+	u8 reserved_at_a0[0x160];
+	u8 flag[0x200];
+};
+
+struct mlx5_ifc_create_flow_hit_aso_in_bits {
+	struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
+	struct mlx5_ifc_flow_hit_aso_bits flow_hit_aso;
+};
+
 enum {
 	MLX5_EVENT_TYPE_OBJECT_CHANGE = 0x27,
 };
diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map
index 884001c..ec8d96c 100644
--- a/drivers/common/mlx5/version.map
+++ b/drivers/common/mlx5/version.map
@@ -21,6 +21,7 @@ INTERNAL {
 	mlx5_devx_cmd_create_tis;
 	mlx5_devx_cmd_create_virtio_q_counters;
 	mlx5_devx_cmd_create_virtq;
+        mlx5_devx_cmd_create_flow_hit_aso_obj;
 	mlx5_devx_cmd_destroy;
 	mlx5_devx_cmd_flow_counter_alloc;
 	mlx5_devx_cmd_flow_counter_query;
-- 
1.8.3.1


  reply	other threads:[~2020-11-01 17:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 21:57 [dpdk-dev] [PATCH 0/8] net/mlx5: support flow hit steering action Matan Azrad
2020-10-29 21:57 ` [dpdk-dev] [PATCH 1/8] common/mlx5: add DevX API to create ASO flow hit object Matan Azrad
2020-10-29 21:57 ` [dpdk-dev] [PATCH 2/8] common/mlx5: use general object type for cap index Matan Azrad
2020-10-29 21:57 ` [dpdk-dev] [PATCH 3/8] common/mlx5: add read ASO flow hit HCA capability Matan Azrad
2020-10-29 21:57 ` [dpdk-dev] [PATCH 4/8] common/mlx5: add glue func create flow hit action Matan Azrad
2020-10-29 21:57 ` [dpdk-dev] [PATCH 5/8] common/mlx5: add definitions for ASO flow hit Matan Azrad
2020-10-29 21:57 ` [dpdk-dev] [PATCH 6/8] net/mlx5: support flow hit action for aging Matan Azrad
2020-10-29 21:58 ` [dpdk-dev] [PATCH 7/8] net/mlx5: optimize shared RSS action memory Matan Azrad
2020-10-29 21:58 ` [dpdk-dev] [PATCH 8/8] net/mlx5: support shared age action Matan Azrad
2020-11-01 17:57 ` [dpdk-dev] [PATCH v2 0/9] net/mlx5: support flow hit steering action Matan Azrad
2020-11-01 17:57   ` Matan Azrad [this message]
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 2/9] common/mlx5: use general object type for cap index Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 3/9] common/mlx5: add read ASO flow hit HCA capability Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 4/9] common/mlx5: add glue func create flow hit action Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 5/9] common/mlx5: add definitions for ASO flow hit Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 6/9] net/mlx5: support flow hit action for aging Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 7/9] net/mlx5: optimize shared RSS action memory Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 8/9] net/mlx5: support shared age action Matan Azrad
2020-11-02  6:16     ` Matan Azrad
2020-11-02  9:33       ` Raslan Darawsheh
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 9/9] net/mlx5: allow age modes combination Matan Azrad
2020-11-02 11:10   ` [dpdk-dev] [PATCH v2 0/9] net/mlx5: support flow hit steering action Raslan Darawsheh

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=1604253472-213766-2-git-send-email-matan@nvidia.com \
    --to=matan@nvidia.com \
    --cc=dekelp@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git