Skip to contentSkip to conversation

net/dpaa2: add support for VLAN tpid config

PATCH In review Hemant Agrawal 2 participants 7 messages Feb 22, 2019 – Feb 27, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 net/dpaa2: add support for VLAN tpid config

This patch add support to config custom tpid in dpni. i.e. value other than 0x8100 and 0x88A8

---
 drivers/net/dpaa2/dpaa2_ethdev.c    | 39 ++++++++++++
 drivers/net/dpaa2/mc/dpni.c         | 98 +++++++++++++++++++++++++++++
 drivers/net/dpaa2/mc/fsl_dpni.h     | 20 ++++++
 drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 18 ++++++
 4 files changed, 175 insertions(+)
drivers/net/dpaa2/dpaa2_ethdev.c +39 -0
index 2b90f4021..bc3faa8a3 100644
@@ -161,6 +161,44 @@ dpaa2_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 	return 0;
 }
 
+static int
+dpaa2_vlan_tpid_set(struct rte_eth_dev *dev,
+		      enum rte_vlan_type vlan_type __rte_unused,
+		      uint16_t tpid)
+{
+	struct dpaa2_dev_priv *priv = dev->data->dev_private;
+	struct fsl_mc_io *dpni = priv->hw;
+	int ret = -ENOTSUP;
+
+	PMD_INIT_FUNC_TRACE();
+
+	/* nothing to be done for standard vlan tpids */
+	if (tpid == 0x8100 || tpid == 0x88A8)
+		return 0;
+
+	ret = dpni_add_custom_tpid(dpni, CMD_PRI_LOW,
+				   priv->token, tpid);
+	if (ret < 0)
+		DPAA2_PMD_INFO("Unable to set vlan tpid = %d", ret);
+	/* if already configured tpids, remove them first */
+	if (ret == -EBUSY) {
+		struct dpni_custom_tpid_cfg tpid_list = {0};
+
+		ret = dpni_get_custom_tpid(dpni, CMD_PRI_LOW,
+				   priv->token, &tpid_list);
+		if (ret < 0)
+			goto fail;
+		ret = dpni_remove_custom_tpid(dpni, CMD_PRI_LOW,
+				   priv->token, tpid_list.tpid1);
+		if (ret < 0)
+			goto fail;
+		ret = dpni_add_custom_tpid(dpni, CMD_PRI_LOW,
+					   priv->token, tpid);
+	}
+fail:
+	return ret;
+}
+
 static int
 dpaa2_fw_version_get(struct rte_eth_dev *dev,
 		     char *fw_version,
@@ -1832,6 +1870,7 @@ static struct eth_dev_ops dpaa2_ethdev_ops = {
 	.mtu_set           = dpaa2_dev_mtu_set,
 	.vlan_filter_set      = dpaa2_vlan_filter_set,
 	.vlan_offload_set     = dpaa2_vlan_offload_set,
+	.vlan_tpid_set	      = dpaa2_vlan_tpid_set,
 	.rx_queue_setup    = dpaa2_dev_rx_queue_setup,
 	.rx_queue_release  = dpaa2_dev_rx_queue_release,
 	.tx_queue_setup    = dpaa2_dev_tx_queue_setup,
drivers/net/dpaa2/mc/dpni.c +98 -0

101 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpni.h +20 -0
index de1bcb5bf..0359a2bc7 100644
@@ -1202,4 +1202,24 @@ int dpni_get_opr(struct fsl_mc_io *mc_io,
 		 struct opr_cfg *cfg,
 		 struct opr_qry *qry);
 
+int dpni_add_custom_tpid(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
+		uint16_t token, uint16_t tpid);
+
+int dpni_remove_custom_tpid(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
+		uint16_t token, uint16_t tpid);
+
+/**
+ * struct dpni_custom_tpid_cfg - custom TPID configuration. Contains custom TPID
+ *	values used in current dpni object to detect 802.1q frames.
+ *	@tpid1: first tag. Not used if zero.
+ *	@tpid2: second tag. Not used if zero.
+ */
+struct dpni_custom_tpid_cfg {
+	uint16_t tpid1;
+	uint16_t tpid2;
+};
+
+int dpni_get_custom_tpid(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
+		uint16_t token, struct dpni_custom_tpid_cfg *tpid);
+
 #endif /* __FSL_DPNI_H */
drivers/net/dpaa2/mc/fsl_dpni_cmd.h +18 -0
index 3df5bcf1f..81830ed85 100644
@@ -91,6 +91,9 @@
 #define DPNI_CMDID_GET_TX_CONFIRMATION_MODE	DPNI_CMD(0x26D)
 #define DPNI_CMDID_SET_OPR			DPNI_CMD(0x26e)
 #define DPNI_CMDID_GET_OPR			DPNI_CMD(0x26f)
+#define DPNI_CMDID_ADD_CUSTOM_TPID		DPNI_CMD(0x275)
+#define DPNI_CMDID_REMOVE_CUSTOM_TPID		DPNI_CMD(0x276)
+#define DPNI_CMDID_GET_CUSTOM_TPID		DPNI_CMD(0x277)
 
 /* Macros for accessing command fields smaller than 1byte */
 #define DPNI_MASK(field)	\
@@ -674,5 +677,20 @@ struct dpni_rsp_get_opr {
 	uint16_t opr_id;
 };
 
+struct dpni_cmd_add_custom_tpid {
+	uint16_t	pad;
+	uint16_t	tpid;
+};
+
+struct dpni_cmd_remove_custom_tpid {
+	uint16_t	pad;
+	uint16_t	tpid;
+};
+
+struct dpni_rsp_get_custom_tpid {
+	uint16_t	tpid1;
+	uint16_t	tpid2;
+};
+
 #pragma pack(pop)
 #endif /* _FSL_DPNI_CMD_H */
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/6 mempool/dpaa2: fix to reduce continuous print on empty pool

Changing the print to DP_DEBUG to avoid continuous prints when buffer pools runs out of buffers

Fixes 3646ccf0b036 ("mempool/dpaa2: support dynamic logging")
---
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +2 -2
index 335eae40e..da66577cc 100644
@@ -326,8 +326,8 @@ rte_dpaa2_mbuf_alloc_bulk(struct rte_mempool *pool,
 		 * in pool, qbman_swp_acquire returns 0
 		 */
 		if (ret <= 0) {
-			DPAA2_MEMPOOL_ERR("Buffer acquire failed with"
-					  " err code: %d", ret);
+			DPAA2_MEMPOOL_DP_DEBUG(
+				"Buffer acquire failed with err code: %d", ret);
 			/* The API expect the exact number of requested bufs */
 			/* Releasing all buffers allocated */
 			rte_dpaa2_mbuf_release(pool, obj_table, bpid,
Signature · 1 line
2.17.1
#2 lore raw

PATCH 3/6 bus/fslmc: add enqueue response read routines in qbman

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

---
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c      |  47 ++++
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.h      |   4 +
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h       |  24 ++
 .../fslmc/qbman/include/fsl_qbman_portal.h    |  56 +++-
 drivers/bus/fslmc/qbman/qbman_portal.c        |  26 ++
 drivers/bus/fslmc/rte_bus_fslmc_version.map   |  16 +-
 drivers/net/dpaa2/dpaa2_ethdev.c              |  42 +++
 drivers/net/dpaa2/dpaa2_ethdev.h              |  13 +-
 drivers/net/dpaa2/dpaa2_rxtx.c                | 255 ++++++++++++++++++
 9 files changed, 480 insertions(+), 3 deletions(-)
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +47 -0
index f377f24ae..7bcbde840 100644
@@ -526,6 +526,18 @@ dpaa2_create_dpio_device(int vdev_fd,
 		goto err;
 	}
 
+	dpio_dev->eqresp = rte_zmalloc(NULL, MAX_EQ_RESP_ENTRIES *
+				     (sizeof(struct qbman_result) +
+				     sizeof(struct eqresp_metadata)),
+				     RTE_CACHE_LINE_SIZE);
+	if (!dpio_dev->eqresp) {
+		DPAA2_BUS_ERR("Memory allocation failed for eqresp");
+		goto err;
+	}
+	dpio_dev->eqresp_meta = (struct eqresp_metadata *)(dpio_dev->eqresp +
+				MAX_EQ_RESP_ENTRIES);
+
+
 	TAILQ_INSERT_TAIL(&dpio_dev_list, dpio_dev, next);
 
 	return 0;
@@ -588,6 +600,41 @@ dpaa2_alloc_dq_storage(struct queue_storage_info_t *q_storage)
 	return -1;
 }
 
+uint32_t
+dpaa2_free_eq_descriptors(void)
+{
+	struct dpaa2_dpio_dev *dpio_dev = DPAA2_PER_LCORE_DPIO;
+	struct qbman_result *eqresp;
+	struct eqresp_metadata *eqresp_meta;
+	struct dpaa2_queue *txq;
+
+	while (dpio_dev->eqresp_ci != dpio_dev->eqresp_pi) {
+		eqresp = &dpio_dev->eqresp[dpio_dev->eqresp_ci];
+		eqresp_meta = &dpio_dev->eqresp_meta[dpio_dev->eqresp_ci];
+
+		if (!qbman_result_eqresp_rspid(eqresp))
+			break;
+
+		if (qbman_result_eqresp_rc(eqresp)) {
+			txq = eqresp_meta->dpaa2_q;
+			txq->cb_eqresp_free(dpio_dev->eqresp_ci);
+		}
+		qbman_result_eqresp_set_rspid(eqresp, 0);
+
+		dpio_dev->eqresp_ci + 1 < MAX_EQ_RESP_ENTRIES ?
+			dpio_dev->eqresp_ci++ : (dpio_dev->eqresp_ci = 0);
+	}
+
+	/* Return 1 less entry so that PI and CI are never same in a
+	 * case there all the EQ responses are in use.
+	 */
+	if (dpio_dev->eqresp_ci > dpio_dev->eqresp_pi)
+		return dpio_dev->eqresp_ci - dpio_dev->eqresp_pi - 1;
+	else
+		return dpio_dev->eqresp_ci - dpio_dev->eqresp_pi +
+			MAX_EQ_RESP_ENTRIES - 1;
+}
+
 static struct rte_dpaa2_object rte_dpaa2_dpio_obj = {
 	.dev_type = DPAA2_IO,
 	.create = dpaa2_create_dpio_device,
drivers/bus/fslmc/portal/dpaa2_hw_dpio.h +4 -0
index 4354c76de..17e7e4fad 100644
@@ -51,4 +51,8 @@ dpaa2_alloc_dq_storage(struct queue_storage_info_t *q_storage);
 void
 dpaa2_free_dq_storage(struct queue_storage_info_t *q_storage);
 
+/* free the enqueue response descriptors */
+uint32_t
+dpaa2_free_eq_descriptors(void);
+
 #endif /* _DPAA2_HW_DPIO_H_ */
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +24 -0
index 626fcbbca..4679e9340 100644
@@ -34,6 +34,7 @@
 
 /* Maximum number of slots available in TX ring */
 #define MAX_TX_RING_SLOTS			32
+#define MAX_EQ_RESP_ENTRIES			(MAX_TX_RING_SLOTS + 1)
 
 /* Maximum number of slots available in RX ring */
 #define DPAA2_EQCR_RING_SIZE		8
@@ -50,6 +51,15 @@
 /* EQCR shift to get EQCR size for LX2 (2 >> 5) = 32 for LX2 */
 #define DPAA2_LX2_EQCR_SHIFT		5
 
+/* Flag to determine an ordered queue mbuf */
+#define DPAA2_ENQUEUE_FLAG_ORP		(1ULL << 30)
+/* ORP ID shift and mask */
+#define DPAA2_EQCR_OPRID_SHIFT		16
+#define DPAA2_EQCR_OPRID_MASK		0x3FFF0000
+/* Sequence number shift and mask */
+#define DPAA2_EQCR_SEQNUM_SHIFT		0
+#define DPAA2_EQCR_SEQNUM_MASK		0x0000FFFF
+
 #define DPAA2_SWP_CENA_REGION		0
 #define DPAA2_SWP_CINH_REGION		1
 #define DPAA2_SWP_CENA_MEM_REGION	2
@@ -77,12 +87,23 @@
 
 #define DPAA2_DPCI_MAX_QUEUES 2
 
+struct dpaa2_queue;
+
+struct eqresp_metadata {
+	struct dpaa2_queue *dpaa2_q;
+	struct rte_mempool *mp;
+};
+
 struct dpaa2_dpio_dev {
 	TAILQ_ENTRY(dpaa2_dpio_dev) next;
 		/**< Pointer to Next device instance */
 	uint16_t index; /**< Index of a instance in the list */
 	rte_atomic16_t ref_count;
 		/**< How many thread contexts are sharing this.*/
+	uint16_t eqresp_ci;
+	uint16_t eqresp_pi;
+	struct qbman_result *eqresp;
+	struct eqresp_metadata *eqresp_meta;
 	struct fsl_mc_io *dpio; /** handle to DPIO portal object */
 	uint16_t token;
 	struct qbman_swp *sw_portal; /** SW portal object */
@@ -125,6 +146,8 @@ typedef void (dpaa2_queue_cb_dqrr_t)(struct qbman_swp *swp,
 		struct dpaa2_queue *rxq,
 		struct rte_event *ev);
 
+typedef void (dpaa2_queue_cb_eqresp_free_t)(uint16_t eqresp_ci);
+
 struct dpaa2_queue {
 	struct rte_mempool *mb_pool; /**< mbuf pool to populate RX ring. */
 	union {
@@ -144,6 +167,7 @@ struct dpaa2_queue {
 	};
 	struct rte_event ev;
 	dpaa2_queue_cb_dqrr_t *cb;
+	dpaa2_queue_cb_eqresp_free_t *cb_eqresp_free;
 	struct dpaa2_bp_info *bp_array;
 };
 
drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +55 -1

74 lines not on this page · raw message

drivers/bus/fslmc/qbman/qbman_portal.c +26 -0
index 14f4b0344..f49b18097 100644
@@ -1569,6 +1569,32 @@ uint64_t qbman_result_cgcu_icnt(const struct qbman_result *scn)
 	return qbman_result_SCN_ctx(scn);
 }
 
+/********************/
+/* Parsing EQ RESP  */
+/********************/
+struct qbman_fd *qbman_result_eqresp_fd(struct qbman_result *eqresp)
+{
+	return (struct qbman_fd *)&eqresp->eq_resp.fd[0];
+}
+
+void qbman_result_eqresp_set_rspid(struct qbman_result *eqresp, uint8_t val)
+{
+	eqresp->eq_resp.rspid = val;
+}
+
+uint8_t qbman_result_eqresp_rspid(struct qbman_result *eqresp)
+{
+	return eqresp->eq_resp.rspid;
+}
+
+uint8_t qbman_result_eqresp_rc(struct qbman_result *eqresp)
+{
+	if (eqresp->eq_resp.rc == 0xE)
+		return 0;
+	else
+		return -1;
+}
+
 /******************/
 /* Buffer release */
 /******************/
drivers/bus/fslmc/rte_bus_fslmc_version.map +15 -1
index dcc4e082e..811a2e7b9 100644
@@ -120,7 +120,6 @@ DPDK_18.05 {
 
 DPDK_18.11 {
 	global:
-
 	dpaa2_dqrr_size;
 	dpaa2_eqcr_size;
 	dpci_get_link_state;
@@ -129,3 +128,18 @@ DPDK_18.11 {
 	dpci_set_opr;
 
 } DPDK_18.05;
+
+DPDK_19.05 {
+	global:
+	dpaa2_free_eq_descriptors;
+
+	qbman_eq_desc_set_orp;
+	qbman_eq_desc_set_token;
+	qbman_result_DQ_odpid;
+	qbman_result_DQ_seqnum;
+	qbman_result_eqresp_fd;
+	qbman_result_eqresp_rc;
+	qbman_result_eqresp_rspid;
+	qbman_result_eqresp_set_rspid;
+} DPDK_18.11;
+
drivers/net/dpaa2/dpaa2_ethdev.c +42 -0

66 lines not on this page · raw message

drivers/net/dpaa2/dpaa2_ethdev.h +12 -1
index 420ad6446..313cbe4bf 100644
@@ -96,15 +96,17 @@ struct dpaa2_dev_priv {
 	uint16_t token;
 	uint8_t nb_tx_queues;
 	uint8_t nb_rx_queues;
+	uint32_t options;
 	void *rx_vq[MAX_RX_QUEUES];
 	void *tx_vq[MAX_TX_QUEUES];
 
 	struct dpaa2_bp_list *bp_list; /**<Attached buffer pool list */
-	uint32_t options;
 	uint8_t max_mac_filters;
 	uint8_t max_vlan_filters;
 	uint8_t num_rx_tc;
 	uint8_t flags; /*dpaa2 config flags */
+	uint8_t en_ordered;
+	uint8_t en_loose_ordered;
 };
 
 int dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev,
@@ -135,6 +137,15 @@ void dpaa2_dev_process_atomic_event(struct qbman_swp *swp,
 				    const struct qbman_result *dq,
 				    struct dpaa2_queue *rxq,
 				    struct rte_event *ev);
+void dpaa2_dev_process_ordered_event(struct qbman_swp *swp,
+				     const struct qbman_fd *fd,
+				     const struct qbman_result *dq,
+				     struct dpaa2_queue *rxq,
+				     struct rte_event *ev);
 uint16_t dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts);
+uint16_t dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs,
+			      uint16_t nb_pkts);
 uint16_t dummy_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts);
+void dpaa2_dev_free_eqresp_buf(uint16_t eqresp_ci);
+
 #endif /* _DPAA2_ETHDEV_H */
drivers/net/dpaa2/dpaa2_rxtx.c +255 -0

267 lines not on this page · raw message

Signature · 1 line
2.17.1
#3 lore raw

PATCH 4/6 net/dpaa2: add support for 16 Rx Queues per traffic class

In reply to Hemant Agrawal

From: Ashish Jain <[email protected]>

Adding support for 16 queues per TC per DPNI port
which is required for LX2 platform.

---
 drivers/net/dpaa2/dpaa2_ethdev.c | 6 ++++--
 drivers/net/dpaa2/dpaa2_ethdev.h | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +4 -2
index 0ab43cadf..f8c2983b9 100644
@@ -266,6 +266,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev)
 	struct dpaa2_dev_priv *priv = dev->data->dev_private;
 	uint16_t dist_idx;
 	uint32_t vq_id;
+	uint8_t num_rxqueue_per_tc;
 	struct dpaa2_queue *mc_q, *mcq;
 	uint32_t tot_queues;
 	int i;
@@ -273,6 +274,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	num_rxqueue_per_tc = (priv->nb_rx_queues / priv->num_rx_tc);
 	tot_queues = priv->nb_rx_queues + priv->nb_tx_queues;
 	mc_q = rte_malloc(NULL, sizeof(struct dpaa2_queue) * tot_queues,
 			  RTE_CACHE_LINE_SIZE);
@@ -311,8 +313,8 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev)
 	vq_id = 0;
 	for (dist_idx = 0; dist_idx < priv->nb_rx_queues; dist_idx++) {
 		mcq = (struct dpaa2_queue *)priv->rx_vq[vq_id];
-		mcq->tc_index = DPAA2_DEF_TC;
-		mcq->flow_id = dist_idx;
+		mcq->tc_index = dist_idx / num_rxqueue_per_tc;
+		mcq->flow_id = dist_idx % num_rxqueue_per_tc;
 		vq_id++;
 	}
 
drivers/net/dpaa2/dpaa2_ethdev.h +1 -1
index 313cbe4bf..13259be7d 100644
@@ -20,7 +20,7 @@
 #define DPAA2_MAX_RX_PKT_LEN  10240 /*WRIOP support*/
 
 #define MAX_TCS			DPNI_MAX_TC
-#define MAX_RX_QUEUES		16
+#define MAX_RX_QUEUES		128
 #define MAX_TX_QUEUES		16
 
 /*default tc to be used for ,congestion, distribution etc configuration. */
Signature · 1 line
2.17.1
#4 lore raw

PATCH 5/6 net/dpaa2: support low level loopback tester

In reply to Hemant Agrawal
---
 doc/guides/nics/dpaa2.rst                     |   5 +
 .../fslmc/qbman/include/fsl_qbman_portal.h    |  18 ++
 drivers/bus/fslmc/qbman/qbman_portal.c        | 161 ++++++++++++++++++
 drivers/bus/fslmc/rte_bus_fslmc_version.map   |   1 +
 drivers/net/dpaa2/dpaa2_ethdev.c              |  57 ++++++-
 drivers/net/dpaa2/dpaa2_ethdev.h              |   3 +
 drivers/net/dpaa2/dpaa2_rxtx.c                | 161 ++++++++++++++++++
 7 files changed, 402 insertions(+), 4 deletions(-)
doc/guides/nics/dpaa2.rst +5 -0
index 769dc4e12..392ab0580 100644
@@ -499,6 +499,11 @@ for details.
       Done
       testpmd>
 
+
+* Use dev arg option ``drv_loopback=1`` to loopback packets at
+  driver level. Any packet received will be reflected back by the
+  driver on same port.
+
 Enabling logs
 -------------
 
drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +18 -0
index a9192d3cb..07b8a4372 100644
@@ -1039,6 +1039,24 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s,
 			       const struct qbman_fd *fd,
 			       uint32_t *flags,
 			       int num_frames);
+
+/**
+ * qbman_swp_enqueue_multiple_fd() - Enqueue multiple frames with same
+				  eq descriptor
+ * @s: the software portal used for enqueue.
+ * @d: the enqueue descriptor.
+ * @fd: the frame descriptor to be enqueued.
+ * @flags: bit-mask of QBMAN_ENQUEUE_FLAG_*** options
+ * @num_frames: the number of the frames to be enqueued.
+ *
+ * Return the number of enqueued frames, -EBUSY if the EQCR is not ready.
+ */
+int qbman_swp_enqueue_multiple_fd(struct qbman_swp *s,
+				  const struct qbman_eq_desc *d,
+				  struct qbman_fd **fd,
+				  uint32_t *flags,
+				  int num_frames);
+
 /**
  * qbman_swp_enqueue_multiple_desc() - Enqueue multiple frames with
  *				       individual eq descriptor.
drivers/bus/fslmc/qbman/qbman_portal.c +161 -0

185 lines not on this page · raw message

drivers/bus/fslmc/rte_bus_fslmc_version.map +1 -0
index 811a2e7b9..aa844dd80 100644
@@ -141,5 +141,6 @@ DPDK_19.05 {
 	qbman_result_eqresp_rc;
 	qbman_result_eqresp_rspid;
 	qbman_result_eqresp_set_rspid;
+	qbman_swp_enqueue_multiple_fd;
 } DPDK_18.11;
 
drivers/net/dpaa2/dpaa2_ethdev.c +53 -4

93 lines not on this page · raw message

drivers/net/dpaa2/dpaa2_ethdev.h +3 -0
index 13259be7d..7148104ec 100644
@@ -125,6 +125,9 @@ int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev,
 int dpaa2_eth_eventq_detach(const struct rte_eth_dev *dev,
 		int eth_rx_queue_id);
 
+uint16_t dpaa2_dev_loopback_rx(void *queue, struct rte_mbuf **bufs,
+				uint16_t nb_pkts);
+
 uint16_t dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs,
 			       uint16_t nb_pkts);
 void dpaa2_dev_process_parallel_event(struct qbman_swp *swp,
drivers/net/dpaa2/dpaa2_rxtx.c +161 -0

164 lines not on this page · raw message

Signature · 1 line
2.17.1
#5 lore raw

PATCH 6/6 net/dpaa2: add basic support for generic flow

In reply to Hemant Agrawal

From: Sunil Kumar Kori <[email protected]>

---
 drivers/net/dpaa2/Makefile             |    1 +
 drivers/net/dpaa2/base/dpaa2_hw_dpni.c |    4 +-
 drivers/net/dpaa2/dpaa2_ethdev.c       |   90 +-
 drivers/net/dpaa2/dpaa2_ethdev.h       |   22 +
 drivers/net/dpaa2/dpaa2_flow.c         | 1972 ++++++++++++++++++++++++
 drivers/net/dpaa2/mc/dpni.c            |  312 ++++
 drivers/net/dpaa2/mc/fsl_dpni.h        |  154 ++
 drivers/net/dpaa2/mc/fsl_dpni_cmd.h    |   88 ++
 drivers/net/dpaa2/meson.build          |    1 +
 9 files changed, 2635 insertions(+), 9 deletions(-)
 create mode 100644 drivers/net/dpaa2/dpaa2_flow.c
drivers/net/dpaa2/Makefile +1 -0
index 562551175..8bd269bfa 100644
@@ -33,6 +33,7 @@ CFLAGS += -DALLOW_EXPERIMENTAL_API
 SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += base/dpaa2_hw_dpni.c
 SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_rxtx.c
 SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_flow.c
 SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_mux.c
 SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpni.c
 SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpkg.c
drivers/net/dpaa2/base/dpaa2_hw_dpni.c +2 -2
index 11f14931e..56e2e56a3 100644
@@ -23,7 +23,7 @@
 
 #include "../dpaa2_ethdev.h"
 
-static int
+int
 dpaa2_distset_to_dpkg_profile_cfg(
 		uint64_t req_dist_set,
 		struct dpkg_profile_cfg *kg_cfg);
@@ -170,7 +170,7 @@ int dpaa2_remove_flow_dist(
 	return ret;
 }
 
-static int
+int
 dpaa2_distset_to_dpkg_profile_cfg(
 		uint64_t req_dist_set,
 		struct dpkg_profile_cfg *kg_cfg)
drivers/net/dpaa2/dpaa2_ethdev.c +83 -7

144 lines not on this page · raw message

drivers/net/dpaa2/dpaa2_ethdev.h +22 -0
index 7148104ec..0ef1bf368 100644
@@ -89,6 +89,13 @@
 /* enable timestamp in mbuf*/
 extern enum pmd_dpaa2_ts dpaa2_enable_ts;
 
+#define DPAA2_QOS_TABLE_RECONFIGURE	1
+#define DPAA2_FS_TABLE_RECONFIGURE	2
+
+/*Externaly defined*/
+extern const struct rte_flow_ops dpaa2_flow_ops;
+extern enum rte_filter_type dpaa2_filter_type;
+
 struct dpaa2_dev_priv {
 	void *hw;
 	int32_t hw_id;
@@ -107,8 +114,23 @@ struct dpaa2_dev_priv {
 	uint8_t flags; /*dpaa2 config flags */
 	uint8_t en_ordered;
 	uint8_t en_loose_ordered;
+
+	struct pattern_s {
+		uint8_t item_count;
+		uint8_t pattern_type[DPKG_MAX_NUM_OF_EXTRACTS];
+	} pattern[MAX_TCS + 1];
+
+	struct extract_s {
+		struct dpkg_profile_cfg qos_key_cfg;
+		struct dpkg_profile_cfg fs_key_cfg[MAX_TCS];
+		uint64_t qos_extract_param;
+		uint64_t fs_extract_param[MAX_TCS];
+	} extract;
 };
 
+int dpaa2_distset_to_dpkg_profile_cfg(uint64_t req_dist_set,
+				      struct dpkg_profile_cfg *kg_cfg);
+
 int dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev,
 			  uint64_t req_dist_set);
 
drivers/net/dpaa2/dpaa2_flow.c new file +1972 -0

1,972 lines not on this page · raw message

drivers/net/dpaa2/mc/dpni.c +312 -0

324 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpni.h +154 -0

166 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpni_cmd.h +88 -0

111 lines not on this page · raw message

drivers/net/dpaa2/meson.build +1 -0
index 801cbf5d7..53e1d8189 100644
@@ -11,6 +11,7 @@ deps += ['mempool_dpaa2']
 sources = files('base/dpaa2_hw_dpni.c',
 		'dpaa2_mux.c',
 		'dpaa2_ethdev.c',
+		'dpaa2_flow.c',
 		'dpaa2_rxtx.c',
 		'mc/dpkg.c',
 		'mc/dpdmux.c',
Signature · 1 line
2.17.1
#6 lore raw
In reply to Hemant Agrawal
Quoted 4 lines · Hemant Agrawal

This patch add support to config custom tpid in dpni. i.e. value other than 0x8100 and 0x88A8

Series applied to dpdk-next-net/master, thanks.

Hi Hemant,

What do you think adding a release notes update related to the changes, at least rte_flow support looks like to me something to mention in release notes?

Thanks,
ferruh