DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] common/cnxk: add IPv6 routing ext flow type for cnxk
@ 2023-07-03  5:10 psatheesh
  2023-07-03  5:10 ` [dpdk-dev] [PATCH 2/2] net/cnxk: adding " psatheesh
  2023-08-08 13:52 ` [dpdk-dev] [PATCH 1/2] common/cnxk: add " Jerin Jacob
  0 siblings, 2 replies; 3+ messages in thread
From: psatheesh @ 2023-07-03  5:10 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, Satheesh Paul, Jerin Jacob

From: Kiran Kumar K <kirankumark@marvell.com>

Adding support to parse IPV6 routing ext flow type for cnxk.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/common/cnxk/roc_npc.h           | 17 +++++++++++++++++
 drivers/common/cnxk/roc_npc_mcam_dump.c |  3 +++
 drivers/common/cnxk/roc_npc_parse.c     | 15 +++++++++++++--
 3 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h
index 07e6634aa7..2ada774934 100644
--- a/drivers/common/cnxk/roc_npc.h
+++ b/drivers/common/cnxk/roc_npc.h
@@ -40,6 +40,7 @@ enum roc_npc_item_type {
 	ROC_NPC_ITEM_TYPE_RAW,
 	ROC_NPC_ITEM_TYPE_MARK,
 	ROC_NPC_ITEM_TYPE_TX_QUEUE,
+	ROC_NPC_ITEM_TYPE_IPV6_ROUTING_EXT,
 	ROC_NPC_ITEM_TYPE_END,
 };
 
@@ -131,6 +132,22 @@ struct roc_ipv6_fragment_ext {
 	uint32_t id;	     /**< Packet ID */
 } __plt_packed;
 
+struct roc_ipv6_routing_ext {
+	uint8_t next_hdr;	/**< Protocol, next header. */
+	uint8_t hdr_len;	/**< Header length. */
+	uint8_t type;		/**< Extension header type. */
+	uint8_t segments_left;	/**< Valid segments number. */
+	union {
+		uint32_t flags; /**< Packet control data per type. */
+		struct {
+			uint8_t last_entry; /**< The last_entry field of SRH */
+			uint8_t flag;	    /**< Packet flag. */
+			uint16_t tag;	    /**< Packet tag. */
+		};
+	};
+	/* Next are 128-bit IPv6 address fields to describe segments. */
+} __plt_packed;
+
 struct roc_flow_item_ipv6_ext {
 	uint8_t next_hdr; /**< Next header. */
 };
diff --git a/drivers/common/cnxk/roc_npc_mcam_dump.c b/drivers/common/cnxk/roc_npc_mcam_dump.c
index a88e166fbe..01c4212567 100644
--- a/drivers/common/cnxk/roc_npc_mcam_dump.c
+++ b/drivers/common/cnxk/roc_npc_mcam_dump.c
@@ -645,6 +645,7 @@ npc_flow_hw_mcam_entry_dump(FILE *file, struct npc *npc, struct roc_npc_flow *fl
 	struct nix_inl_dev *inl_dev = NULL;
 	struct idev_cfg *idev;
 	struct mbox *mbox;
+	uint8_t enabled;
 	int rc = 0, i;
 
 	idev = idev_get_cfg();
@@ -673,6 +674,7 @@ npc_flow_hw_mcam_entry_dump(FILE *file, struct npc *npc, struct roc_npc_flow *fl
 
 	mbox_memcpy(mcam_data, mcam_read_rsp->entry_data.kw, sizeof(mcam_data));
 	mbox_memcpy(mcam_mask, mcam_read_rsp->entry_data.kw_mask, sizeof(mcam_data));
+	enabled = mcam_read_rsp->enable;
 
 	fprintf(file, "HW MCAM Data :\n");
 
@@ -680,6 +682,7 @@ npc_flow_hw_mcam_entry_dump(FILE *file, struct npc *npc, struct roc_npc_flow *fl
 		fprintf(file, "\tDW%d     :%016lX\n", i, mcam_data[i]);
 		fprintf(file, "\tDW%d_Mask:%016lX\n", i, mcam_mask[i]);
 	}
+	fprintf(file, "\tEnabled = 0x%x\n", enabled);
 
 	fprintf(file, "\n");
 	mbox_put(mbox);
diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c
index acaebaed21..ecd1b3e13b 100644
--- a/drivers/common/cnxk/roc_npc_parse.c
+++ b/drivers/common/cnxk/roc_npc_parse.c
@@ -719,8 +719,8 @@ npc_handle_ipv6ext_attr(const struct roc_npc_flow_item_ipv6 *ipv6_spec,
 static int
 npc_process_ipv6_item(struct npc_parse_state *pst)
 {
-	uint8_t ipv6_hdr_mask[sizeof(struct roc_ipv6_hdr) + sizeof(struct roc_ipv6_fragment_ext)];
-	uint8_t ipv6_hdr_buf[sizeof(struct roc_ipv6_hdr) + sizeof(struct roc_ipv6_fragment_ext)];
+	uint8_t ipv6_hdr_mask[2 * sizeof(struct roc_ipv6_hdr)];
+	uint8_t ipv6_hdr_buf[2 * sizeof(struct roc_ipv6_hdr)];
 	const struct roc_npc_flow_item_ipv6 *ipv6_spec, *ipv6_mask;
 	const struct roc_npc_item_info *pattern = pst->pattern;
 	int offset = 0, rc = 0, lid, item_count = 0;
@@ -804,6 +804,16 @@ npc_process_ipv6_item(struct npc_parse_state *pst)
 				       sizeof(struct roc_ipv6_fragment_ext));
 
 			break;
+		} else if (pattern->type == ROC_NPC_ITEM_TYPE_IPV6_ROUTING_EXT) {
+			item_count++;
+			ltype = NPC_LT_LC_IP6_EXT;
+			parse_info.len = sizeof(struct roc_ipv6_hdr) + pattern->size;
+
+			if (pattern->spec)
+				memcpy(ipv6_hdr_buf + offset, pattern->spec, pattern->size);
+			if (pattern->mask)
+				memcpy(ipv6_hdr_mask + offset, pattern->mask, pattern->size);
+			break;
 		}
 
 		pattern++;
@@ -867,6 +877,7 @@ npc_parse_lc(struct npc_parse_state *pst)
 	case ROC_NPC_ITEM_TYPE_IPV6:
 	case ROC_NPC_ITEM_TYPE_IPV6_EXT:
 	case ROC_NPC_ITEM_TYPE_IPV6_FRAG_EXT:
+	case ROC_NPC_ITEM_TYPE_IPV6_ROUTING_EXT:
 		return npc_process_ipv6_item(pst);
 	case ROC_NPC_ITEM_TYPE_ARP_ETH_IPV4:
 		lt = NPC_LT_LC_ARP;
-- 
2.39.2


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

end of thread, other threads:[~2023-08-08 13:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03  5:10 [dpdk-dev] [PATCH 1/2] common/cnxk: add IPv6 routing ext flow type for cnxk psatheesh
2023-07-03  5:10 ` [dpdk-dev] [PATCH 2/2] net/cnxk: adding " psatheesh
2023-08-08 13:52 ` [dpdk-dev] [PATCH 1/2] common/cnxk: add " Jerin Jacob

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).