DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bing Zhao <bingz@mellanox.com>
To: orika@mellanox.com, viacheslavo@mellanox.com
Cc: rasland@mellanox.com, matan@mellanox.com, dev@dpdk.org
Subject: [dpdk-dev] [PATCH 3/5] net/mlx5: add flex parser devx structures
Date: Wed,  8 Jul 2020 22:43:05 +0800	[thread overview]
Message-ID: <1594219387-240274-4-git-send-email-bingz@mellanox.com> (raw)
In-Reply-To: <1594219387-240274-1-git-send-email-bingz@mellanox.com>

The structures and other definitions will be used for the dynamic
flex parser creation via Devx command interface. These structures
will be used as some some intermediate variables and input
parameters for the parser creation API.
It is better to keep all members consistent with the PRM definition
even though some of them will not be used.

Signed-off-by: Bing Zhao <bingz@mellanox.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.h | 44 ++++++++++++++++++++++++++++++++++++
 drivers/common/mlx5/mlx5_prm.h       | 14 ++++++++++++
 drivers/net/mlx5/mlx5.h              |  5 ++--
 3 files changed, 61 insertions(+), 2 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index 25704ef..faabfb1 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -299,6 +299,50 @@ struct mlx5_devx_virtio_q_couners_attr {
 	uint32_t invalid_buffer;
 };
 
+/*
+ * graph flow match sample attributes structure,
+ * used by flex parser operations.
+ */
+struct mlx5_devx_match_sample_attr {
+	uint32_t flow_match_sample_en:1;
+	uint32_t flow_match_sample_field_offset:16;
+	uint32_t flow_match_sample_offset_mode:4;
+	uint32_t flow_match_sample_field_offset_mask;
+	uint32_t flow_match_sample_field_offset_shift:4;
+	uint32_t flow_match_sample_field_base_offset:8;
+	uint32_t flow_match_sample_tunnel_mode:3;
+	uint32_t flow_match_sample_field_id;
+};
+
+/* graph node arc attributes structure, used by flex parser operations. */
+struct mlx5_devx_graph_arc_attr {
+	uint32_t compare_condition_value:16;
+	uint32_t start_inner_tunnel:1;
+	uint32_t arc_parse_graph_node:8;
+	uint32_t parse_graph_node_handle;
+};
+
+/* Maximal number of samples per graph node. */
+#define MLX5_GRAPH_NODE_SAMPLE_NUM 8
+
+/* Maximal number of input/output arcs per graph node. */
+#define MLX5_GRAPH_NODE_ARC_NUM 8
+
+/* parse graph node attributes structure, used by flex parser operations. */
+struct mlx5_devx_graph_node_attr {
+	uint32_t modify_field_select;
+	uint32_t header_length_mode:4;
+	uint32_t header_length_base_value:16;
+	uint32_t header_length_field_shift:4;
+	uint32_t header_length_field_offset:16;
+	uint32_t header_length_field_mask;
+	struct mlx5_devx_match_sample_attr sample[MLX5_GRAPH_NODE_SAMPLE_NUM];
+	uint32_t next_header_field_offset:16;
+	uint32_t next_header_field_size:5;
+	struct mlx5_devx_graph_arc_attr in[MLX5_GRAPH_NODE_ARC_NUM];
+	struct mlx5_devx_graph_arc_attr out[MLX5_GRAPH_NODE_ARC_NUM];
+};
+
 /* mlx5_devx_cmds.c */
 
 __rte_internal
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index decc63d..9fed365 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -2539,6 +2539,20 @@ enum {
 /* The bits meter color use. */
 #define MLX5_MTR_COLOR_BITS 8
 
+/* Length mode of dynamic flex parser graph node. */
+enum mlx5_parse_graph_node_len_mode {
+	MLX5_GRAPH_NODE_LEN_FIXED = 0x0,
+	MLX5_GRAPH_NODE_LEN_FIELD = 0x1,
+	MLX5_GRAPH_NODE_LEN_BITMASK = 0x2,
+};
+
+/* Offset mode of the samples of flex parser. */
+enum mlx5_parse_graph_flow_match_sample_offset_mode {
+	MLX5_GRAPH_SAMPLE_OFFSET_FIXED = 0x0,
+	MLX5_GRAPH_SAMPLE_OFFSET_FIELD = 0x1,
+	MLX5_GRAPH_SAMPLE_OFFSET_BITMASK = 0x2,
+};
+
 /**
  * Convert a user mark to flow mark.
  *
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 51775ca..07cbaf4 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -537,9 +537,10 @@ enum mlx5_flex_parser_profile_id {
 
 /* Sample ID information of flex parser structure. */
 struct mlx5_flex_parser_profiles {
-	uint32_t ids[4];	/* Sample IDs for this profile. */
-	void *obj;		/* Flex parser node object. */
 	uint32_t num;		/* Actual number of samples. */
+	uint32_t ids[8];	/* Sample IDs for this profile. */
+	uint8_t offset[8];	/* Bytes offset of each parser. */
+	void *obj;		/* Flex parser node object. */
 };
 
 /*
-- 
1.8.3.1


  parent reply	other threads:[~2020-07-08 14:43 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 14:43 [dpdk-dev] [PATCH 0/5] add eCPRI support in mlx5 driver Bing Zhao
2020-07-08 14:43 ` [dpdk-dev] [PATCH 1/5] net/mlx5: add flow validation of eCPRI header Bing Zhao
2020-07-08 14:43 ` [dpdk-dev] [PATCH 2/5] net/mlx5: add flow translation " Bing Zhao
2020-07-09 12:22   ` Thomas Monjalon
2020-07-09 14:47     ` Bing Zhao
2020-07-08 14:43 ` Bing Zhao [this message]
2020-07-08 14:43 ` [dpdk-dev] [PATCH 4/5] net/mlx5: adding Devx command for flex parsers Bing Zhao
2020-07-08 14:43 ` [dpdk-dev] [PATCH 5/5] net/mlx5: create and destroy eCPRI flex parser Bing Zhao
2020-07-16 13:49 ` [dpdk-dev] [PATCH v2 0/7] add eCPRI support in mlx5 driver Bing Zhao
2020-07-16 13:49   ` [dpdk-dev] [PATCH v2 1/7] net/mlx5: add flow validation of eCPRI header Bing Zhao
2020-07-16 13:49   ` [dpdk-dev] [PATCH v2 2/7] net/mlx5: add flow translation " Bing Zhao
2020-07-16 13:49   ` [dpdk-dev] [PATCH v2 3/7] common/mlx5: add flex parser DevX structures Bing Zhao
2020-07-16 13:49   ` [dpdk-dev] [PATCH v2 4/7] common/mlx5: adding DevX command for flex parsers Bing Zhao
2020-07-16 13:49   ` [dpdk-dev] [PATCH v2 5/7] net/mlx5: create and destroy eCPRI flex parser Bing Zhao
2020-07-16 13:49   ` [dpdk-dev] [PATCH v2 6/7] net/mlx5: add eCPRI flex parser capacity check Bing Zhao
2020-07-16 13:49   ` [dpdk-dev] [PATCH v2 7/7] doc: update release notes and guides for eCPRI Bing Zhao
2020-07-16 14:23   ` [dpdk-dev] [PATCH v3 0/7] add eCPRI support in mlx5 driver Bing Zhao
2020-07-16 14:23     ` [dpdk-dev] [PATCH v3 1/7] net/mlx5: add flow validation of eCPRI header Bing Zhao
2020-07-16 15:04       ` Slava Ovsiienko
2020-07-16 14:23     ` [dpdk-dev] [PATCH v3 2/7] net/mlx5: add flow translation " Bing Zhao
2020-07-16 15:04       ` Slava Ovsiienko
2020-07-16 14:23     ` [dpdk-dev] [PATCH v3 3/7] common/mlx5: add flex parser DevX structures Bing Zhao
2020-07-16 15:04       ` Slava Ovsiienko
2020-07-16 14:23     ` [dpdk-dev] [PATCH v3 4/7] common/mlx5: adding DevX command for flex parsers Bing Zhao
2020-07-16 15:05       ` Slava Ovsiienko
2020-07-16 14:23     ` [dpdk-dev] [PATCH v3 5/7] net/mlx5: create and destroy eCPRI flex parser Bing Zhao
2020-07-16 15:05       ` Slava Ovsiienko
2020-07-16 14:23     ` [dpdk-dev] [PATCH v3 6/7] net/mlx5: add eCPRI flex parser capacity check Bing Zhao
2020-07-16 15:05       ` Slava Ovsiienko
2020-07-16 14:23     ` [dpdk-dev] [PATCH v3 7/7] doc: update release notes and guides for eCPRI Bing Zhao
2020-07-16 15:05       ` Slava Ovsiienko
2020-07-17  7:11     ` [dpdk-dev] [PATCH v4 0/7] add eCPRI support in mlx5 driver Bing Zhao
2020-07-17  7:11       ` [dpdk-dev] [PATCH v4 1/7] net/mlx5: add flow validation of eCPRI header Bing Zhao
2020-07-17  7:11       ` [dpdk-dev] [PATCH v4 2/7] net/mlx5: add flow translation " Bing Zhao
2020-07-17  7:11       ` [dpdk-dev] [PATCH v4 3/7] common/mlx5: add flex parser DevX structures Bing Zhao
2020-07-17  7:11       ` [dpdk-dev] [PATCH v4 4/7] common/mlx5: adding DevX command for flex parsers Bing Zhao
2020-07-17  7:11       ` [dpdk-dev] [PATCH v4 5/7] net/mlx5: create and destroy eCPRI flex parser Bing Zhao
2020-07-17  7:11       ` [dpdk-dev] [PATCH v4 6/7] net/mlx5: add eCPRI flex parser capacity check Bing Zhao
2020-07-17  7:11       ` [dpdk-dev] [PATCH v4 7/7] doc: update release notes and guides for eCPRI Bing Zhao
2020-07-17 12:55       ` [dpdk-dev] [PATCH v4 0/7] add eCPRI support in mlx5 driver 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=1594219387-240274-4-git-send-email-bingz@mellanox.com \
    --to=bingz@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=orika@mellanox.com \
    --cc=rasland@mellanox.com \
    --cc=viacheslavo@mellanox.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
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;
as well as URLs for NNTP newsgroup(s).