Skip to contentSkip to conversation

NXP DPAAx ethernet PMD changes

PATCH In review Hemant Agrawal 3 participants 62 messages Jan 20, 2021 – Feb 24, 2021

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

cover NXP DPAAx ethernet PMD changes

This patch series adds changes to dpaaX ethernet pmd

1. Basic Traffic Management support for shaper and scheduler
2. Support external buffer in Transmit side.
3. Optimize the SG packet handling
4. Add support APIs in DPDMUX (SRIOV equivalent for DPAA2)
5. Fix isssues

Gagandeep Singh (1):
net/dpaa2: add traffic management driver

Hemant Agrawal (3):
net/dpaa2: allocate SGT table from first segment net/dpaa: support external buffers in Tx net/dpaa2: add support to configure dpdmux max Rx frame len

Nipun Gupta (1):
net/dpaa2: support external buffers in Tx

Rohit Raj (1):
net/dpaa2: fix link get API implementation

Youri Querry (1):
bus/fslmc: fix to use ci value for qbman 5.0

 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |   5 +
 drivers/bus/fslmc/qbman/qbman_portal.c  |  14 +-
 drivers/net/dpaa/dpaa_rxtx.c            |  29 +-
 drivers/net/dpaa/dpaa_rxtx.h            |   8 +-
 drivers/net/dpaa2/dpaa2_ethdev.c        |  35 +-
 drivers/net/dpaa2/dpaa2_ethdev.h        |   5 +
 drivers/net/dpaa2/dpaa2_mux.c           |  28 +-
 drivers/net/dpaa2/dpaa2_rxtx.c          | 103 +++-
 drivers/net/dpaa2/dpaa2_tm.c            | 626 ++++++++++++++++++++++++
 drivers/net/dpaa2/dpaa2_tm.h            |  32 ++
 drivers/net/dpaa2/mc/dpni.c             | 313 +++++++++++-
 drivers/net/dpaa2/mc/fsl_dpni.h         | 210 +++++++-
 drivers/net/dpaa2/mc/fsl_dpni_cmd.h     |  59 ++-
 drivers/net/dpaa2/meson.build           |   3 +-
 drivers/net/dpaa2/rte_pmd_dpaa2.h       |  18 +-
 drivers/net/dpaa2/version.map           |   1 +
 16 files changed, 1436 insertions(+), 53 deletions(-)
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.c
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.h
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/7 bus/fslmc: fix to use ci value for qbman 5.0

From: Youri Querry <[email protected]>

since for qbman 5.0 generally, pi == ci, no need for extra checks. They are causing issue.
This fixes few random packet hang issues in event mode.

Fixes 1b49352f41be ("bus/fslmc: rename portal pi index to consumer index")
---
 drivers/bus/fslmc/qbman/qbman_portal.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/bus/fslmc/qbman/qbman_portal.c +3 -11
index 77c9d508c4..aedcad9258 100644
@@ -339,17 +339,9 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d)
 	eqcr_pi = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI);
 	p->eqcr.pi = eqcr_pi & p->eqcr.pi_ci_mask;
 	p->eqcr.pi_vb = eqcr_pi & QB_VALID_BIT;
-	if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000
-			&& (d->cena_access_mode == qman_cena_fastest_access))
-		p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI)
-					     & p->eqcr.pi_ci_mask;
-	else
-		p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI)
-					     & p->eqcr.pi_ci_mask;
-	p->eqcr.available = p->eqcr.pi_ring_size -
-				qm_cyc_diff(p->eqcr.pi_ring_size,
-				p->eqcr.ci & (p->eqcr.pi_ci_mask<<1),
-				p->eqcr.pi & (p->eqcr.pi_ci_mask<<1));
+	p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI)
+			& p->eqcr.pi_ci_mask;
+	p->eqcr.available = p->eqcr.pi_ring_size;
 
 	portal_idx_map[p->desc.idx] = p;
 	return p;
Signature · 1 line
2.17.1
#2 lore raw

Re: [dpdk-dev] [PATCH 1/7] bus/fslmc: fix to use ci value for qbman 5.0

Quoted 4 lines · Hemant Agrawal

From: Youri Querry <[email protected]>

since for qbman 5.0 generally, pi == ci, no need for extra checks. They are causing issue.

It would be nice to document the issues, in case users encounter them, they will know this patch is fixing it. Can you please send details?

btw, is the understanding correct that this patch is fixing issues only seen with qbman 5.0?

Quoted 7 lines

This fixes few random packet hang issues in event mode.

Fixes 1b49352f41be ("bus/fslmc: rename portal pi index to consumer index")

<...>

#3 lore raw

Re: [dpdk-dev] [PATCH 1/7] bus/fslmc: fix to use ci value for qbman 5.0

Quoted 7 lines · Ferruh Yigit
Quoted 4 lines · Hemant Agrawal

From: Youri Querry <[email protected]>

since for qbman 5.0 generally, pi == ci, no need for extra checks. They are causing issue.

It would be nice to document the issues, in case users encounter them, they will know this patch is fixing it. Can you please send details?

1.  Portal was incorrectly initialized. PI was getting assigned to CI incorrectly. This avoided few un-explained issues when using event mode.

2. This provided minor performance improvement

Quoted 2 lines

btw, is the understanding correct that this patch is fixing issues only seen with qbman 5.0?

yes.

Quoted 10 lines
Quoted 8 lines

This fixes few random packet hang issues in event mode.

Fixes 1b49352f41be ("bus/fslmc: rename portal pi index to consumer index")

<...>

#4 lore raw

PATCH 2/7 net/dpaa2: fix link get API implementation

In reply to Hemant Agrawal

From: Rohit Raj <[email protected]>

According to DPDK Documentation, rte_eth_link_get API can wait upto 9 seconds for auto-negotiation to finish and then returns link status.

In current implementation of rte_eth_link_get API in DPAA2 drivers, it wasn't waiting for auto negotiation to finish and was returning link status DOWN
It can cause issues with DPDK applications which relies on rte_eth_link_get API for link status and doesn't support link status interrupt.
Similar kind of issue was seen in TRex Application.

This patch fixes this bug by adding wait for up to 9 seconds for auto negotiation to finish.

Fixes c56c86ff87c1 ("net/dpaa2: update link status")
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +16 -5
index 6f38da3cce..5c1a12b841 100644
@@ -31,6 +31,8 @@
 
 #define DRIVER_LOOPBACK_MODE "drv_loopback"
 #define DRIVER_NO_PREFETCH_MODE "drv_no_prefetch"
+#define CHECK_INTERVAL         100  /* 100ms */
+#define MAX_REPEAT_TIME        90   /* 9s (90 * 100ms) in total */
 
 /* Supported Rx offloads */
 static uint64_t dev_rx_offloads_sup =
@@ -1805,23 +1807,32 @@ dpaa2_dev_stats_reset(struct rte_eth_dev *dev)
 /* return 0 means link status changed, -1 means not changed */
 static int
 dpaa2_dev_link_update(struct rte_eth_dev *dev,
-			int wait_to_complete __rte_unused)
+		      int wait_to_complete)
 {
 	int ret;
 	struct dpaa2_dev_priv *priv = dev->data->dev_private;
 	struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
 	struct rte_eth_link link;
 	struct dpni_link_state state = {0};
+	uint8_t count;
 
 	if (dpni == NULL) {
 		DPAA2_PMD_ERR("dpni is NULL");
 		return 0;
 	}
 
-	ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, &state);
-	if (ret < 0) {
-		DPAA2_PMD_DEBUG("error: dpni_get_link_state %d", ret);
-		return -1;
+	for (count = 0; count <= MAX_REPEAT_TIME; count++) {
+		ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token,
+					  &state);
+		if (ret < 0) {
+			DPAA2_PMD_DEBUG("error: dpni_get_link_state %d", ret);
+			return -1;
+		}
+		if (state.up == ETH_LINK_DOWN &&
+		    wait_to_complete)
+			rte_delay_ms(CHECK_INTERVAL);
+		else
+			break;
 	}
 
 	memset(&link, 0, sizeof(struct rte_eth_link));
Signature · 1 line
2.17.1
#5 lore raw

PATCH 3/7 net/dpaa2: allocate SGT table from first segment

In reply to Hemant Agrawal

This patch enables support to use the first segment headroom to build the HW requied Scatter Gather Table. (if space is available).
This will avoid 1 less buffer for SG buffer creation.

---
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |  5 ++
 drivers/net/dpaa2/dpaa2_rxtx.c          | 65 +++++++++++++++++++------
 2 files changed, 54 insertions(+), 16 deletions(-)
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +5 -0
index ac24f01451..0f15750b6c 100644
@@ -330,6 +330,11 @@ enum qbman_fd_format {
 } while (0)
 #define DPAA2_FD_GET_FORMAT(fd)	(((fd)->simple.bpid_offset >> 28) & 0x3)
 
+#define DPAA2_SG_SET_FORMAT(sg, format)	do {				\
+		(sg)->fin_bpid_offset &= 0xCFFFFFFF;			\
+		(sg)->fin_bpid_offset |= (uint32_t)format << 28;	\
+} while (0)
+
 #define DPAA2_SG_SET_FINAL(sg, fin)	do {				\
 		(sg)->fin_bpid_offset &= 0x7FFFFFFF;			\
 		(sg)->fin_bpid_offset |= (uint32_t)fin << 31;		\
drivers/net/dpaa2/dpaa2_rxtx.c +49 -16

109 lines not on this page · raw message

Signature · 1 line
2.17.1
#6 lore raw

PATCH 4/7 net/dpaa2: support external buffers in Tx

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

This patch support tx of external allocated buffers.

---
 drivers/net/dpaa2/dpaa2_rxtx.c | 38 ++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
drivers/net/dpaa2/dpaa2_rxtx.c +38 -0
index 7d2a7809d3..de297d8274 100644
@@ -1065,6 +1065,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;
 	struct dpaa2_dev_priv *priv = eth_data->dev_private;
 	uint32_t flags[MAX_TX_RING_SLOTS] = {0};
+	struct rte_mbuf **orig_bufs = bufs;
 
 	if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
 		ret = dpaa2_affine_qbman_swp();
@@ -1148,6 +1149,25 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 				mi = rte_mbuf_from_indirect(*bufs);
 				mp = mi->pool;
 			}
+
+			if (unlikely(RTE_MBUF_HAS_EXTBUF(*bufs))) {
+				rte_mbuf_refcnt_update(*bufs, 1);
+				if (unlikely((*bufs)->nb_segs > 1)) {
+					if (eth_mbuf_to_sg_fd(*bufs,
+							      &fd_arr[loop],
+							      mp, 0))
+						goto send_n_return;
+				} else {
+					eth_mbuf_to_fd(*bufs,
+						       &fd_arr[loop], 0);
+				}
+				bufs++;
+#ifdef RTE_LIBRTE_IEEE1588
+				enable_tx_tstamp(&fd_arr[loop]);
+#endif
+				continue;
+			}
+
 			/* Not a hw_pkt pool allocated frame */
 			if (unlikely(!mp || !priv->bp_list)) {
 				DPAA2_PMD_ERR("Err: No buffer pool attached");
@@ -1220,6 +1240,15 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		nb_pkts -= loop;
 	}
 	dpaa2_q->tx_pkts += num_tx;
+
+	loop = 0;
+	while (loop < num_tx) {
+		if (unlikely(RTE_MBUF_HAS_EXTBUF(*orig_bufs)))
+			rte_pktmbuf_free(*orig_bufs);
+		orig_bufs++;
+		loop++;
+	}
+
 	return num_tx;
 
 send_n_return:
@@ -1246,6 +1275,15 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	}
 skip_tx:
 	dpaa2_q->tx_pkts += num_tx;
+
+	loop = 0;
+	while (loop < num_tx) {
+		if (unlikely(RTE_MBUF_HAS_EXTBUF(*orig_bufs)))
+			rte_pktmbuf_free(*orig_bufs);
+		orig_bufs++;
+		loop++;
+	}
+
 	return num_tx;
 }
 
Signature · 1 line
2.17.1
#7 lore raw

PATCH 5/7 net/dpaa: support external buffers in Tx

In reply to Hemant Agrawal

This patch support tx of external buffers

---
 drivers/net/dpaa/dpaa_rxtx.c | 29 ++++++++++++++++++++++-------
 drivers/net/dpaa/dpaa_rxtx.h |  8 +-------
 2 files changed, 23 insertions(+), 14 deletions(-)
drivers/net/dpaa/dpaa_rxtx.c +22 -7
index e2459d9b99..6efa872c57 100644
@@ -334,7 +334,7 @@ dpaa_unsegmented_checksum(struct rte_mbuf *mbuf, struct qm_fd *fd_arr)
 	}
 }
 
-struct rte_mbuf *
+static struct rte_mbuf *
 dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid)
 {
 	struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid);
@@ -791,13 +791,12 @@ uint16_t dpaa_eth_queue_rx(void *q,
 	return num_rx;
 }
 
-int
+static int
 dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 		struct qm_fd *fd,
-		uint32_t bpid)
+		struct dpaa_bp_info *bp_info)
 {
 	struct rte_mbuf *cur_seg = mbuf, *prev_seg = NULL;
-	struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(bpid);
 	struct rte_mbuf *temp, *mi;
 	struct qm_sg_entry *sg_temp, *sgt;
 	int i = 0;
@@ -840,7 +839,7 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 	fd->format = QM_FD_SG;
 	fd->addr = temp->buf_iova;
 	fd->offset = temp->data_off;
-	fd->bpid = bpid;
+	fd->bpid = bp_info ? bp_info->bpid : 0xff;
 	fd->length20 = mbuf->pkt_len;
 
 	while (i < DPAA_SGT_MAX_ENTRIES) {
@@ -951,7 +950,7 @@ tx_on_dpaa_pool(struct rte_mbuf *mbuf,
 		tx_on_dpaa_pool_unsegmented(mbuf, bp_info, fd_arr);
 	} else if (mbuf->nb_segs > 1 &&
 		   mbuf->nb_segs <= DPAA_SGT_MAX_ENTRIES) {
-		if (dpaa_eth_mbuf_to_sg_fd(mbuf, fd_arr, bp_info->bpid)) {
+		if (dpaa_eth_mbuf_to_sg_fd(mbuf, fd_arr, bp_info)) {
 			DPAA_PMD_DEBUG("Unable to create Scatter Gather FD");
 			return 1;
 		}
@@ -1055,6 +1054,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 	uint16_t state;
 	int ret, realloc_mbuf = 0;
 	uint32_t seqn, index, flags[DPAA_TX_BURST_SIZE] = {0};
+	struct rte_mbuf **orig_bufs = bufs;
 
 	if (unlikely(!DPAA_PER_LCORE_PORTAL)) {
 		ret = rte_dpaa_portal_init((void *)0);
@@ -1112,6 +1112,12 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 				mp = mi->pool;
 			}
 
+			if (unlikely(RTE_MBUF_HAS_EXTBUF(mbuf))) {
+				rte_mbuf_refcnt_update(mbuf, 1);
+				bp_info = NULL;
+				goto indirect_buf;
+			}
+
 			bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp);
 			if (unlikely(mp->ops_index != bp_info->dpaa_ops_index ||
 				     realloc_mbuf == 1)) {
@@ -1130,7 +1136,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 				mbuf = temp_mbuf;
 				realloc_mbuf = 0;
 			}
-
+indirect_buf:
 			state = tx_on_dpaa_pool(mbuf, bp_info,
 						&fd_arr[loop]);
 			if (unlikely(state)) {
@@ -1157,6 +1163,15 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 
 	DPAA_DP_LOG(DEBUG, "Transmitted %d buffers on queue: %p", sent, q);
 
+
+	loop = 0;
+	while (loop < sent) {
+		if (unlikely(RTE_MBUF_HAS_EXTBUF(*orig_bufs)))
+			rte_pktmbuf_free(*orig_bufs);
+		orig_bufs++;
+		loop++;
+	}
+
 	return sent;
 }
 
drivers/net/dpaa/dpaa_rxtx.h +1 -7
index d9d7e04f5c..99e09196e9 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2017,2020 NXP
+ *   Copyright 2017,2020-2021 NXP
  *
  */
 
@@ -279,12 +279,6 @@ uint16_t dpaa_eth_tx_drop_all(void *q  __rte_unused,
 			      struct rte_mbuf **bufs __rte_unused,
 			      uint16_t nb_bufs __rte_unused);
 
-struct rte_mbuf *dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid);
-
-int dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
-			   struct qm_fd *fd,
-			   uint32_t bpid);
-
 uint16_t dpaa_free_mbuf(const struct qm_fd *fd);
 void dpaa_rx_cb(struct qman_fq **fq,
 		struct qm_dqrr_entry **dqrr, void **bufs, int num_bufs);
Signature · 1 line
2.17.1
#8 lore raw

PATCH 6/7 net/dpaa2: add traffic management driver

In reply to Hemant Agrawal

From: Gagandeep Singh <[email protected]>

Add basic support for scheduling and shaping on dpaa2 platform.

HW supports 2 level of scheduling and shaping. However the current patch only support single level.

---
 drivers/net/dpaa2/dpaa2_ethdev.c    |  14 +-
 drivers/net/dpaa2/dpaa2_ethdev.h    |   5 +
 drivers/net/dpaa2/dpaa2_tm.c        | 626 ++++++++++++++++++++++++++++
 drivers/net/dpaa2/dpaa2_tm.h        |  32 ++
 drivers/net/dpaa2/mc/dpni.c         | 313 +++++++++++++-
 drivers/net/dpaa2/mc/fsl_dpni.h     | 210 +++++++++-
 drivers/net/dpaa2/mc/fsl_dpni_cmd.h |  59 ++-
 drivers/net/dpaa2/meson.build       |   3 +-
 8 files changed, 1257 insertions(+), 5 deletions(-)
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.c
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.h
drivers/net/dpaa2/dpaa2_ethdev.c +13 -1
index 5c1a12b841..cce6aa0964 100644
@@ -1,7 +1,7 @@
 /* * SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2016-2020 NXP
+ *   Copyright 2016-2021 NXP
  *
  */
 
@@ -638,6 +638,8 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev)
 	if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
 		dpaa2_vlan_offload_set(dev, ETH_VLAN_FILTER_MASK);
 
+	dpaa2_tm_init(dev);
+
 	return 0;
 }
 
@@ -1264,6 +1266,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev)
 		return -1;
 	}
 
+	dpaa2_tm_deinit(dev);
 	dpaa2_flow_clean(dev);
 	/* Clean the device first */
 	ret = dpni_reset(dpni, CMD_PRI_LOW, priv->token);
@@ -2345,6 +2348,14 @@ dpaa2_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->conf.tx_deferred_start = 0;
 }
 
+static int
+dpaa2_tm_ops_get(struct rte_eth_dev *dev __rte_unused, void *ops)
+{
+	*(const void **)ops = &dpaa2_tm_ops;
+
+	return 0;
+}
+
 static struct eth_dev_ops dpaa2_ethdev_ops = {
 	.dev_configure	  = dpaa2_eth_dev_configure,
 	.dev_start	      = dpaa2_dev_start,
@@ -2387,6 +2398,7 @@ static struct eth_dev_ops dpaa2_ethdev_ops = {
 	.filter_ctrl          = dpaa2_dev_flow_ctrl,
 	.rxq_info_get	      = dpaa2_rxq_info_get,
 	.txq_info_get	      = dpaa2_txq_info_get,
+	.tm_ops_get	      = dpaa2_tm_ops_get,
 #if defined(RTE_LIBRTE_IEEE1588)
 	.timesync_enable      = dpaa2_timesync_enable,
 	.timesync_disable     = dpaa2_timesync_disable,
drivers/net/dpaa2/dpaa2_ethdev.h +5 -0
index bb49fa9a38..9837eb62c8 100644
@@ -12,6 +12,7 @@
 #include <rte_pmd_dpaa2.h>
 
 #include <dpaa2_hw_pvt.h>
+#include "dpaa2_tm.h"
 
 #include <mc/fsl_dpni.h>
 #include <mc/fsl_mc_sys.h>
@@ -112,6 +113,8 @@ extern int dpaa2_timestamp_dynfield_offset;
 extern const struct rte_flow_ops dpaa2_flow_ops;
 extern enum rte_filter_type dpaa2_filter_type;
 
+extern const struct rte_tm_ops dpaa2_tm_ops;
+
 #define IP_ADDRESS_OFFSET_INVALID (-1)
 
 struct dpaa2_key_info {
@@ -179,6 +182,8 @@ struct dpaa2_dev_priv {
 	struct rte_eth_dev *eth_dev; /**< Pointer back to holding ethdev */
 
 	LIST_HEAD(, rte_flow) flows; /**< Configured flow rule handles. */
+	LIST_HEAD(nodes, dpaa2_tm_node) nodes;
+	LIST_HEAD(shaper_profiles, dpaa2_tm_shaper_profile) shaper_profiles;
 };
 
 int dpaa2_distset_to_dpkg_profile_cfg(uint64_t req_dist_set,
drivers/net/dpaa2/dpaa2_tm.c new file +626 -0

626 lines not on this page · raw message

drivers/net/dpaa2/dpaa2_tm.h new file +32 -0
new file mode 100644
index 0000000000..6632fab687
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2020 NXP
+ */
+
+#ifndef _DPAA2_TM_H_
+#define _DPAA2_TM_H_
+
+#include <rte_tm.h>
+
+struct dpaa2_tm_shaper_profile {
+	LIST_ENTRY(dpaa2_tm_shaper_profile) next;
+	uint32_t id;
+	int refcnt;
+	struct rte_tm_shaper_params params;
+};
+
+struct dpaa2_tm_node {
+	LIST_ENTRY(dpaa2_tm_node) next;
+	uint32_t id;
+	uint32_t type;
+	int refcnt;
+	struct dpaa2_tm_node *parent;
+	struct dpaa2_tm_shaper_profile *profile;
+	uint32_t weight;
+	uint32_t priority;
+	uint64_t stats_mask;
+};
+
+int dpaa2_tm_init(struct rte_eth_dev *dev);
+void dpaa2_tm_deinit(struct rte_eth_dev *dev);
+
+#endif /* _DPAA2_TM_H_ */
drivers/net/dpaa2/mc/dpni.c +312 -1

337 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpni.h +209 -1

240 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpni_cmd.h +58 -1

89 lines not on this page · raw message

drivers/net/dpaa2/meson.build +2 -1
index 844dd25159..f5f411d592 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright 2018 NXP
+# Copyright 2018-2021 NXP
 
 if not is_linux
 	build = false
@@ -8,6 +8,7 @@ endif
 
 deps += ['mempool_dpaa2']
 sources = files('base/dpaa2_hw_dpni.c',
+		'dpaa2_tm.c',
 		'dpaa2_mux.c',
 		'dpaa2_ethdev.c',
 		'dpaa2_flow.c',
Signature · 1 line
2.17.1
#9 lore raw

Re: [dpdk-dev] [PATCH 6/7] net/dpaa2: add traffic management driver

Quoted 20 lines · Hemant Agrawal

From: Gagandeep Singh <[email protected]>

Add basic support for scheduling and shaping on dpaa2 platform.

HW supports 2 level of scheduling and shaping. However the current patch only support single level.

---
  drivers/net/dpaa2/dpaa2_ethdev.c    |  14 +-
  drivers/net/dpaa2/dpaa2_ethdev.h    |   5 +
  drivers/net/dpaa2/dpaa2_tm.c        | 626 ++++++++++++++++++++++++++++
  drivers/net/dpaa2/dpaa2_tm.h        |  32 ++
  drivers/net/dpaa2/mc/dpni.c         | 313 +++++++++++++-
  drivers/net/dpaa2/mc/fsl_dpni.h     | 210 +++++++++-
  drivers/net/dpaa2/mc/fsl_dpni_cmd.h |  59 ++-
  drivers/net/dpaa2/meson.build       |   3 +-
  8 files changed, 1257 insertions(+), 5 deletions(-)
Quoted 2 lines

create mode 100644 drivers/net/dpaa2/dpaa2_tm.c
create mode 100644 drivers/net/dpaa2/dpaa2_tm.h

Can you please update the documentation and the release notes for the traffic management support?

And this is relative big chunk of code, and taken into account that it has been sent after -rc1, can you please confirm you want to get it for the -rc3, which won't give much time to test before the release? Or we can postpone it to next release to be on the safe side.

#10 lore raw

Re: [dpdk-dev] [PATCH 6/7] net/dpaa2: add traffic management driver

Quoted 24 lines · Ferruh Yigit
Quoted 19 lines · Hemant Agrawal

From: Gagandeep Singh <[email protected]>

Add basic support for scheduling and shaping on dpaa2 platform.

HW supports 2 level of scheduling and shaping. However the current patch only support single level.

---
  drivers/net/dpaa2/dpaa2_ethdev.c    |  14 +- drivers/net/dpaa2/dpaa2_ethdev.h    |   5 + drivers/net/dpaa2/dpaa2_tm.c        | 626 ++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_tm.h        |  32 ++ drivers/net/dpaa2/mc/dpni.c         | 313 +++++++++++++- drivers/net/dpaa2/mc/fsl_dpni.h     | 210 +++++++++- drivers/net/dpaa2/mc/fsl_dpni_cmd.h |  59 ++- drivers/net/dpaa2/meson.build       |   3 +-

Quoted 3 lines
  8 files changed, 1257 insertions(+), 5 deletions(-)

  create mode 100644 drivers/net/dpaa2/dpaa2_tm.c
  create mode 100644 drivers/net/dpaa2/dpaa2_tm.h

Quoted 4 lines

Can you please update the documentation and the release notes for the traffic management support?

And this is relative big chunk of code, and taken into account that it has been sent after -rc1, can you please confirm you want to get it for the -rc3, which won't give much time to test before the release? Or we can postpone it to next release to be on the safe side.

We are ok to postpone this patch for next release.

#11 lore raw

PATCH 7/7 net/dpaa2: add support to configure dpdmux max Rx frame len

In reply to Hemant Agrawal

This patch introduce a new pmd api, which can help the applications to configure the max framelen for a given dpdmux interface

---
 drivers/net/dpaa2/dpaa2_mux.c     | 28 +++++++++++++++++++++++++++-
 drivers/net/dpaa2/rte_pmd_dpaa2.h | 18 +++++++++++++++++-
 drivers/net/dpaa2/version.map     |  1 +
 3 files changed, 45 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_mux.c +27 -1
index f8366e839e..b397d333d6 100644
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018-2020 NXP
+ * Copyright 2018-2021 NXP
  */
 
 #include <sys/queue.h>
@@ -205,6 +205,32 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 	return NULL;
 }
 
+int
+rte_pmd_dpaa2_mux_rx_frame_len(uint32_t dpdmux_id, uint16_t max_rx_frame_len)
+{
+	struct dpaa2_dpdmux_dev *dpdmux_dev;
+	int ret;
+
+	/* Find the DPDMUX from dpdmux_id in our list */
+	dpdmux_dev = get_dpdmux_from_id(dpdmux_id);
+	if (!dpdmux_dev) {
+		DPAA2_PMD_ERR("Invalid dpdmux_id: %d", dpdmux_id);
+		return -1;
+	}
+
+	ret = dpdmux_set_max_frame_length(&dpdmux_dev->dpdmux,
+			CMD_PRI_LOW, dpdmux_dev->token, max_rx_frame_len);
+	if (ret) {
+		DPAA2_PMD_ERR("DPDMUX:Unable to set mtu. check config %d", ret);
+		return ret;
+	}
+
+	DPAA2_PMD_INFO("dpdmux mtu set as %u",
+			DPAA2_MAX_RX_PKT_LEN - RTE_ETHER_CRC_LEN);
+
+	return ret;
+}
+
 static int
 dpaa2_create_dpdmux_device(int vdev_fd __rte_unused,
 			   struct vfio_device_info *obj_info __rte_unused,
drivers/net/dpaa2/rte_pmd_dpaa2.h +17 -1
index ec8df75af9..7204a8f951 100644
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018-2020 NXP
+ * Copyright 2018-2021 NXP
  */
 
 #ifndef _RTE_PMD_DPAA2_H
@@ -40,6 +40,22 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 			      struct rte_flow_item *pattern[],
 			      struct rte_flow_action *actions[]);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * demultiplex interface max rx frame length configure
+ *
+ * @param dpdmux_id
+ *    ID of the DPDMUX MC object.
+ * @param max_rx_frame_len
+ *    maximum receive frame length (will be checked to be minimux of all dpnis)
+ *
+ */
+__rte_experimental
+int
+rte_pmd_dpaa2_mux_rx_frame_len(uint32_t dpdmux_id, uint16_t max_rx_frame_len);
+
 /**
  * @warning
  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
drivers/net/dpaa2/version.map +1 -0
index 72d1b2b1c8..3c087c2423 100644
@@ -2,6 +2,7 @@ EXPERIMENTAL {
 	global:
 
 	rte_pmd_dpaa2_mux_flow_create;
+	rte_pmd_dpaa2_mux_rx_frame_len;
 	rte_pmd_dpaa2_set_custom_hash;
 };
 
Signature · 1 line
2.17.1
#12 lore raw

Re: [dpdk-dev] [PATCH 7/7] net/dpaa2: add support to configure dpdmux max Rx frame len

Quoted 4 lines · Hemant Agrawal

This patch introduce a new pmd api, which can help the applications to configure the max framelen for a given dpdmux interface

<...>

Quoted 6 lines
drivers/net/dpaa2/rte_pmd_dpaa2.h +6 -0
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * demultiplex interface max rx frame length configure
+ *

drivers/net/dpaa2/rte_pmd_dpaa2.h rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, · line 58

Quoted 10 lines
drivers/net/dpaa2/rte_pmd_dpaa2.h +10 -0
+ * @param dpdmux_id
+ *    ID of the DPDMUX MC object.
+ * @param max_rx_frame_len
+ *    maximum receive frame length (will be checked to be minimux of all dpnis)
+ *
+ */
+__rte_experimental
+int
+rte_pmd_dpaa2_mux_rx_frame_len(uint32_t dpdmux_id, uint16_t max_rx_frame_len);
+

PMD specific APIs are not good for portability, and I think better to reduce them as much as possible.

Can't this new parameter provided as devarg, instead of a new PMD API?

#13 lore raw

Re: [dpdk-dev] [PATCH 7/7] net/dpaa2: add support to configure dpdmux max Rx frame len

HI Ferruh,

Quoted 30 lines · Ferruh Yigit
Quoted 4 lines · Hemant Agrawal

This patch introduce a new pmd api, which can help the applications to configure the max framelen for a given dpdmux interface

<...>

Quoted 17 lines

+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * demultiplex interface max rx frame length configure
+ *
+ * @param dpdmux_id
+ *    ID of the DPDMUX MC object.
+ * @param max_rx_frame_len
+ *    maximum receive frame length (will be checked to be minimux of all dpnis)
+ *
+ */

drivers/net/dpaa2/rte_pmd_dpaa2.h +3 -0
+__rte_experimental
+int
+rte_pmd_dpaa2_mux_rx_frame_len(uint32_t dpdmux_id, uint16_t 
Quoted 2 lines

max_rx_frame_len);
+

PMD specific APIs are not good for portability, and I think better to reduce them as much as possible.

Quoted 1 line

Can't this new parameter provided as devarg, instead of a new PMD API?

Applications controls it w.r.t jumbo buffers for the dpdmux attached interfaces. So, devargs will not work in this case.

#14 lore raw

cover NXP DPAAx ethernet PMD changes

In reply to Hemant Agrawal

This patch series adds changes to dpaaX ethernet pmd

1. Basic Traffic Management support for shaper and scheduler
2. Support external buffer in Transmit side.
3. Optimize the SG packet handling
4. Add support APIs in DPDMUX (SRIOV equivalent for DPAA2)
5. Fix isssues

Gagandeep Singh (1):
net/dpaa2: add traffic management driver

Hemant Agrawal (3):
net/dpaa2: allocate SGT table from first segment net/dpaa: support external buffers in Tx net/dpaa2: add support to configure dpdmux max Rx frame len

Nipun Gupta (1):
net/dpaa2: support external buffers in Tx

Rohit Raj (1):
net/dpaa2: fix link get API implementation

Youri Querry (1):
bus/fslmc: fix to use ci value for qbman 5.0

 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |   5 +
 drivers/bus/fslmc/qbman/qbman_portal.c  |  14 +-
 drivers/net/dpaa/dpaa_rxtx.c            |  29 +-
 drivers/net/dpaa/dpaa_rxtx.h            |   8 +-
 drivers/net/dpaa2/dpaa2_ethdev.c        |  35 +-
 drivers/net/dpaa2/dpaa2_ethdev.h        |   5 +
 drivers/net/dpaa2/dpaa2_mux.c           |  28 +-
 drivers/net/dpaa2/dpaa2_rxtx.c          | 103 +++-
 drivers/net/dpaa2/dpaa2_tm.c            | 626 ++++++++++++++++++++++++
 drivers/net/dpaa2/dpaa2_tm.h            |  32 ++
 drivers/net/dpaa2/mc/dpni.c             | 313 +++++++++++-
 drivers/net/dpaa2/mc/fsl_dpni.h         | 210 +++++++-
 drivers/net/dpaa2/mc/fsl_dpni_cmd.h     |  59 ++-
 drivers/net/dpaa2/meson.build           |   3 +-
 drivers/net/dpaa2/rte_pmd_dpaa2.h       |  18 +-
 drivers/net/dpaa2/version.map           |   1 +
 16 files changed, 1436 insertions(+), 53 deletions(-)
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.c
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.h
Signature · 1 line
2.17.1
#15 lore raw

v2 cover NXP DPAAx ethernet PMD changes

In reply to Hemant Agrawal

This patch series adds changes to dpaaX ethernet pmd

1. Basic Traffic Management support for shaper and scheduler
2. Support external buffer in Transmit side.
3. Optimize the SG packet handling
4. Add support APIs in DPDMUX (SRIOV equivalent for DPAA2)
5. Fix isssues

v2: add more patches and add TM documentation

Akhil Goyal (1):
net/dpaa2: add support for raw pattern in dpdmux

Apeksha Gupta (1):
net/dpaa2: dpdmux skip reset

Gagandeep Singh (1):
net/dpaa2: add traffic management driver

Hemant Agrawal (8):
net/dpaa2: allocate SGT table from first segment net/dpaa: support external buffers in Tx net/dpaa2: add support to configure dpdmux max Rx frame len net/dpaa2: support dpdmux to not drop parse err pkts net/dpaa2: add device args for enable Tx confirmation mempool/dpaa2: support stats for secondary process bus/dpaa: secondary process init support bus/dpaa: enhance checks for bus and device detection

Nipun Gupta (6):
bus/dpaa: fix statistics reading net/dpaa2: support external buffers in Tx net/dpaa2: optionally enable error queues net/dpaa: do not release the cgr ranges net/dpaa: prevent multiple mp config on an device bus/dpaa: support shared ethernet MAC interface

Rohit Raj (2):
net/dpaa2: fix link get API implementation
net/dpaa: fix link get API implementation

Youri Querry (1):
bus/fslmc: fix to use ci value for qbman 5.0

 doc/guides/nics/dpaa2.rst                | 131 ++++-
 drivers/bus/dpaa/base/fman/fman.c        | 149 ++++--
 drivers/bus/dpaa/base/fman/fman_hw.c     |  33 +-
 drivers/bus/dpaa/dpaa_bus.c              |  34 +-
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h  |   6 +
 drivers/bus/fslmc/qbman/qbman_portal.c   |  14 +-
 drivers/mempool/dpaa/dpaa_mempool.c      |   1 +
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c |   8 +-
 drivers/net/dpaa/dpaa_ethdev.c           |  32 +-
 drivers/net/dpaa/dpaa_rxtx.c             |  39 +-
 drivers/net/dpaa/dpaa_rxtx.h             |   8 +-
 drivers/net/dpaa2/dpaa2_ethdev.c         | 135 ++++-
 drivers/net/dpaa2/dpaa2_ethdev.h         |  15 +-
 drivers/net/dpaa2/dpaa2_mux.c            | 111 +++-
 drivers/net/dpaa2/dpaa2_rxtx.c           | 204 +++++++-
 drivers/net/dpaa2/dpaa2_tm.c             | 626 +++++++++++++++++++++++
 drivers/net/dpaa2/dpaa2_tm.h             |  32 ++
 drivers/net/dpaa2/mc/dpdmux.c            | 124 ++++-
 drivers/net/dpaa2/mc/dpni.c              | 313 +++++++++++-
 drivers/net/dpaa2/mc/fsl_dpdmux.h        | 157 +++++-
 drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h    |  51 +-
 drivers/net/dpaa2/mc/fsl_dpni.h          | 210 +++++++-
 drivers/net/dpaa2/mc/fsl_dpni_cmd.h      |  59 ++-
 drivers/net/dpaa2/meson.build            |   3 +-
 drivers/net/dpaa2/rte_pmd_dpaa2.h        |  18 +-
 drivers/net/dpaa2/version.map            |   1 +
 26 files changed, 2322 insertions(+), 192 deletions(-)
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.c
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.h
Signature · 1 line
2.17.1
#16 lore raw

PATCH v2 1/20 bus/fslmc: fix to use ci value for qbman 5.0

From: Youri Querry <[email protected]>

Random portal hangs observed on device with QBMAN 5.0

This fixes few random packet hang issues in event mode. Few things fixed it.
1. generally, pi == ci, no need for extra checks.
2. the proper initilizations in init with ci helped

Fixes 1b49352f41be ("bus/fslmc: rename portal pi index to consumer index")
---
 drivers/bus/fslmc/qbman/qbman_portal.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/bus/fslmc/qbman/qbman_portal.c +3 -11
index 77c9d508c4..aedcad9258 100644
@@ -339,17 +339,9 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d)
 	eqcr_pi = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI);
 	p->eqcr.pi = eqcr_pi & p->eqcr.pi_ci_mask;
 	p->eqcr.pi_vb = eqcr_pi & QB_VALID_BIT;
-	if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000
-			&& (d->cena_access_mode == qman_cena_fastest_access))
-		p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI)
-					     & p->eqcr.pi_ci_mask;
-	else
-		p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI)
-					     & p->eqcr.pi_ci_mask;
-	p->eqcr.available = p->eqcr.pi_ring_size -
-				qm_cyc_diff(p->eqcr.pi_ring_size,
-				p->eqcr.ci & (p->eqcr.pi_ci_mask<<1),
-				p->eqcr.pi & (p->eqcr.pi_ci_mask<<1));
+	p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI)
+			& p->eqcr.pi_ci_mask;
+	p->eqcr.available = p->eqcr.pi_ring_size;
 
 	portal_idx_map[p->desc.idx] = p;
 	return p;
Signature · 1 line
2.17.1
#17 lore raw

PATCH v2 2/20 bus/dpaa: fix statistics reading

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

Reading of word un-aligned values after reading word aligned values lead to corrution of memory, such that older value. This patch make changes such that word alignedaccess is made, before making an un-aligned access

Fixes 6d6b4f49a155 ("bus/dpaa: add FMAN hardware operations")
---
 drivers/bus/dpaa/base/fman/fman_hw.c | 33 ++++++++++++++--------------
 1 file changed, 16 insertions(+), 17 deletions(-)
drivers/bus/dpaa/base/fman/fman_hw.c +16 -17
index 4ab49f7853..af9bac76c2 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
- * Copyright 2017 NXP
+ * Copyright 2017,2020 NXP
  *
  */
 
@@ -219,20 +219,20 @@ fman_if_stats_get(struct fman_if *p, struct rte_eth_stats *stats)
 	struct memac_regs *regs = m->ccsr_map;
 
 	/* read recved packet count */
-	stats->ipackets = ((u64)in_be32(&regs->rfrm_u)) << 32 |
-			in_be32(&regs->rfrm_l);
-	stats->ibytes = ((u64)in_be32(&regs->roct_u)) << 32 |
-			in_be32(&regs->roct_l);
-	stats->ierrors = ((u64)in_be32(&regs->rerr_u)) << 32 |
-			in_be32(&regs->rerr_l);
+	stats->ipackets = (u64)in_be32(&regs->rfrm_l) |
+			((u64)in_be32(&regs->rfrm_u)) << 32;
+	stats->ibytes = (u64)in_be32(&regs->roct_l) |
+			((u64)in_be32(&regs->roct_u)) << 32;
+	stats->ierrors = (u64)in_be32(&regs->rerr_l) |
+			((u64)in_be32(&regs->rerr_u)) << 32;
 
 	/* read xmited packet count */
-	stats->opackets = ((u64)in_be32(&regs->tfrm_u)) << 32 |
-			in_be32(&regs->tfrm_l);
-	stats->obytes = ((u64)in_be32(&regs->toct_u)) << 32 |
-			in_be32(&regs->toct_l);
-	stats->oerrors = ((u64)in_be32(&regs->terr_u)) << 32 |
-			in_be32(&regs->terr_l);
+	stats->opackets = (u64)in_be32(&regs->tfrm_l) |
+			((u64)in_be32(&regs->tfrm_u)) << 32;
+	stats->obytes = (u64)in_be32(&regs->toct_l) |
+			((u64)in_be32(&regs->toct_u)) << 32;
+	stats->oerrors = (u64)in_be32(&regs->terr_l) |
+			((u64)in_be32(&regs->terr_u)) << 32;
 }
 
 void
@@ -244,10 +244,9 @@ fman_if_stats_get_all(struct fman_if *p, uint64_t *value, int n)
 	uint64_t base_offset = offsetof(struct memac_regs, reoct_l);
 
 	for (i = 0; i < n; i++)
-		value[i] = ((u64)in_be32((char *)regs
-				+ base_offset + 8 * i + 4)) << 32 |
-				((u64)in_be32((char *)regs
-				+ base_offset + 8 * i));
+		value[i] = (((u64)in_be32((char *)regs + base_offset + 8 * i) |
+				(u64)in_be32((char *)regs + base_offset +
+				8 * i + 4)) << 32);
 }
 
 void
Signature · 1 line
2.17.1
#18 lore raw

PATCH v2 3/20 net/dpaa2: fix link get API implementation

In reply to Hemant Agrawal

From: Rohit Raj <[email protected]>

According to DPDK Documentation, rte_eth_link_get API can wait upto 9 seconds for auto-negotiation to finish and then returns link status.

In current implementation of rte_eth_link_get API in DPAA2 drivers, it wasn't waiting for auto negotiation to finish and was returning link status DOWN
It can cause issues with DPDK applications which relies on rte_eth_link_get API for link status and doesn't support link status interrupt.
Similar kind of issue was seen in TRex Application.

This patch fixes this bug by adding wait for up to 9 seconds for auto negotiation to finish.

Fixes c56c86ff87c1 ("net/dpaa2: update link status")
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +16 -5
index 38774e255b..a81c73438e 100644
@@ -31,6 +31,8 @@
 
 #define DRIVER_LOOPBACK_MODE "drv_loopback"
 #define DRIVER_NO_PREFETCH_MODE "drv_no_prefetch"
+#define CHECK_INTERVAL         100  /* 100ms */
+#define MAX_REPEAT_TIME        90   /* 9s (90 * 100ms) in total */
 
 /* Supported Rx offloads */
 static uint64_t dev_rx_offloads_sup =
@@ -1805,23 +1807,32 @@ dpaa2_dev_stats_reset(struct rte_eth_dev *dev)
 /* return 0 means link status changed, -1 means not changed */
 static int
 dpaa2_dev_link_update(struct rte_eth_dev *dev,
-			int wait_to_complete __rte_unused)
+		      int wait_to_complete)
 {
 	int ret;
 	struct dpaa2_dev_priv *priv = dev->data->dev_private;
 	struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
 	struct rte_eth_link link;
 	struct dpni_link_state state = {0};
+	uint8_t count;
 
 	if (dpni == NULL) {
 		DPAA2_PMD_ERR("dpni is NULL");
 		return 0;
 	}
 
-	ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, &state);
-	if (ret < 0) {
-		DPAA2_PMD_DEBUG("error: dpni_get_link_state %d", ret);
-		return -1;
+	for (count = 0; count <= MAX_REPEAT_TIME; count++) {
+		ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token,
+					  &state);
+		if (ret < 0) {
+			DPAA2_PMD_DEBUG("error: dpni_get_link_state %d", ret);
+			return -1;
+		}
+		if (state.up == ETH_LINK_DOWN &&
+		    wait_to_complete)
+			rte_delay_ms(CHECK_INTERVAL);
+		else
+			break;
 	}
 
 	memset(&link, 0, sizeof(struct rte_eth_link));
Signature · 1 line
2.17.1
#19 lore raw

PATCH v2 4/20 net/dpaa: fix link get API implementation

In reply to Hemant Agrawal

From: Rohit Raj <[email protected]>

According to DPDK Documentation, rte_eth_link_get API can wait upto 9 seconds for auto-negotiation to finish and then returns link status.

In current implementation of rte_eth_link_get API in DPAA drivers, it wasn't waiting for auto negotiation to finish and was returning link status DOWN
It can cause issues with DPDK applications which relies
on rte_eth_link_get API for link statusand doesn't support link status interrupt.

This patch fixes this bug by adding wait for up to 9 seconds for auto negotiation to finish.

Fixes 2aa10990a8dd ("bus/dpaa: enable link state interrupt")
---
 drivers/net/dpaa/dpaa_ethdev.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
drivers/net/dpaa/dpaa_ethdev.c +15 -5
index d643514de6..c59873dd8a 100644
@@ -49,6 +49,9 @@
 #include <process.h>
 #include <fmlib/fm_ext.h>
 
+#define CHECK_INTERVAL         100  /* 100ms */
+#define MAX_REPEAT_TIME        90   /* 9s (90 * 100ms) in total */
+
 /* Supported Rx offloads */
 static uint64_t dev_rx_offloads_sup =
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
@@ -669,23 +672,30 @@ dpaa_dev_tx_burst_mode_get(struct rte_eth_dev *dev,
 }
 
 static int dpaa_eth_link_update(struct rte_eth_dev *dev,
-				int wait_to_complete __rte_unused)
+				int wait_to_complete)
 {
 	struct dpaa_if *dpaa_intf = dev->data->dev_private;
 	struct rte_eth_link *link = &dev->data->dev_link;
 	struct fman_if *fif = dev->process_private;
 	struct __fman_if *__fif = container_of(fif, struct __fman_if, __if);
 	int ret, ioctl_version;
+	uint8_t count;
 
 	PMD_INIT_FUNC_TRACE();
 
 	ioctl_version = dpaa_get_ioctl_version_number();
 
-
 	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
-		ret = dpaa_get_link_status(__fif->node_name, link);
-		if (ret)
-			return ret;
+		for (count = 0; count <= MAX_REPEAT_TIME; count++) {
+			ret = dpaa_get_link_status(__fif->node_name, link);
+			if (ret)
+				return ret;
+			if (link->link_status == ETH_LINK_DOWN &&
+			    wait_to_complete)
+				rte_delay_ms(CHECK_INTERVAL);
+			else
+				break;
+		}
 	} else {
 		link->link_status = dpaa_intf->valid;
 	}
Signature · 1 line
2.17.1
#20 lore raw

PATCH v2 5/20 net/dpaa2: allocate SGT table from first segment

In reply to Hemant Agrawal

This patch enables support to use the first segment headroom to build the HW requied Scatter Gather Table. (if space is available).
This will avoid 1 less buffer for SG buffer creation.

---
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |  5 ++
 drivers/net/dpaa2/dpaa2_rxtx.c          | 65 +++++++++++++++++++------
 2 files changed, 54 insertions(+), 16 deletions(-)
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +5 -0
index ac24f01451..0f15750b6c 100644
@@ -330,6 +330,11 @@ enum qbman_fd_format {
 } while (0)
 #define DPAA2_FD_GET_FORMAT(fd)	(((fd)->simple.bpid_offset >> 28) & 0x3)
 
+#define DPAA2_SG_SET_FORMAT(sg, format)	do {				\
+		(sg)->fin_bpid_offset &= 0xCFFFFFFF;			\
+		(sg)->fin_bpid_offset |= (uint32_t)format << 28;	\
+} while (0)
+
 #define DPAA2_SG_SET_FINAL(sg, fin)	do {				\
 		(sg)->fin_bpid_offset &= 0x7FFFFFFF;			\
 		(sg)->fin_bpid_offset |= (uint32_t)fin << 31;		\
drivers/net/dpaa2/dpaa2_rxtx.c +49 -16

109 lines not on this page · raw message

Signature · 1 line
2.17.1
#21 lore raw

PATCH v2 6/20 net/dpaa2: support external buffers in Tx

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

This patch support tx of external allocated buffers.

---
 drivers/net/dpaa2/dpaa2_rxtx.c | 42 ++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
drivers/net/dpaa2/dpaa2_rxtx.c +42 -0
index c11ed0ee61..7deba3aed3 100644
@@ -450,6 +450,9 @@ eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 				}
 			}
 			cur_seg = cur_seg->next;
+		} else if (RTE_MBUF_HAS_EXTBUF(cur_seg)) {
+			DPAA2_SET_FLE_IVP(sge);
+			cur_seg = cur_seg->next;
 		} else {
 			/* Get owner MBUF from indirect buffer */
 			mi = rte_mbuf_from_indirect(cur_seg);
@@ -494,6 +497,8 @@ eth_mbuf_to_fd(struct rte_mbuf *mbuf,
 			DPAA2_SET_FD_IVP(fd);
 			rte_mbuf_refcnt_update(mbuf, -1);
 		}
+	} else if (RTE_MBUF_HAS_EXTBUF(mbuf)) {
+		DPAA2_SET_FD_IVP(fd);
 	} else {
 		struct rte_mbuf *mi;
 
@@ -1065,6 +1070,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;
 	struct dpaa2_dev_priv *priv = eth_data->dev_private;
 	uint32_t flags[MAX_TX_RING_SLOTS] = {0};
+	struct rte_mbuf **orig_bufs = bufs;
 
 	if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
 		ret = dpaa2_affine_qbman_swp();
@@ -1148,6 +1154,24 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 				mi = rte_mbuf_from_indirect(*bufs);
 				mp = mi->pool;
 			}
+
+			if (unlikely(RTE_MBUF_HAS_EXTBUF(*bufs))) {
+				if (unlikely((*bufs)->nb_segs > 1)) {
+					if (eth_mbuf_to_sg_fd(*bufs,
+							      &fd_arr[loop],
+							      mp, 0))
+						goto send_n_return;
+				} else {
+					eth_mbuf_to_fd(*bufs,
+						       &fd_arr[loop], 0);
+				}
+				bufs++;
+#ifdef RTE_LIBRTE_IEEE1588
+				enable_tx_tstamp(&fd_arr[loop]);
+#endif
+				continue;
+			}
+
 			/* Not a hw_pkt pool allocated frame */
 			if (unlikely(!mp || !priv->bp_list)) {
 				DPAA2_PMD_ERR("Err: No buffer pool attached");
@@ -1220,6 +1244,15 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		nb_pkts -= loop;
 	}
 	dpaa2_q->tx_pkts += num_tx;
+
+	loop = 0;
+	while (loop < num_tx) {
+		if (unlikely(RTE_MBUF_HAS_EXTBUF(*orig_bufs)))
+			rte_pktmbuf_free(*orig_bufs);
+		orig_bufs++;
+		loop++;
+	}
+
 	return num_tx;
 
 send_n_return:
@@ -1246,6 +1279,15 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	}
 skip_tx:
 	dpaa2_q->tx_pkts += num_tx;
+
+	loop = 0;
+	while (loop < num_tx) {
+		if (unlikely(RTE_MBUF_HAS_EXTBUF(*orig_bufs)))
+			rte_pktmbuf_free(*orig_bufs);
+		orig_bufs++;
+		loop++;
+	}
+
 	return num_tx;
 }
 
Signature · 1 line
2.17.1
#22 lore raw

PATCH v2 7/20 net/dpaa: support external buffers in Tx

In reply to Hemant Agrawal

This patch support tx of external buffers

---
 drivers/net/dpaa/dpaa_rxtx.c | 39 +++++++++++++++++++++++++++---------
 drivers/net/dpaa/dpaa_rxtx.h |  8 +-------
 2 files changed, 31 insertions(+), 16 deletions(-)
drivers/net/dpaa/dpaa_rxtx.c +30 -9
index e38fba23c0..423de40e95 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2017,2019 NXP
+ *   Copyright 2017,2019-2021 NXP
  *
  */
 
@@ -334,7 +334,7 @@ dpaa_unsegmented_checksum(struct rte_mbuf *mbuf, struct qm_fd *fd_arr)
 	}
 }
 
-struct rte_mbuf *
+static struct rte_mbuf *
 dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid)
 {
 	struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid);
@@ -791,13 +791,12 @@ uint16_t dpaa_eth_queue_rx(void *q,
 	return num_rx;
 }
 
-int
+static int
 dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 		struct qm_fd *fd,
-		uint32_t bpid)
+		struct dpaa_bp_info *bp_info)
 {
 	struct rte_mbuf *cur_seg = mbuf, *prev_seg = NULL;
-	struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(bpid);
 	struct rte_mbuf *temp, *mi;
 	struct qm_sg_entry *sg_temp, *sgt;
 	int i = 0;
@@ -840,7 +839,7 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 	fd->format = QM_FD_SG;
 	fd->addr = temp->buf_iova;
 	fd->offset = temp->data_off;
-	fd->bpid = bpid;
+	fd->bpid = bp_info ? bp_info->bpid : 0xff;
 	fd->length20 = mbuf->pkt_len;
 
 	while (i < DPAA_SGT_MAX_ENTRIES) {
@@ -862,6 +861,9 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 					DPAA_MEMPOOL_TO_BPID(cur_seg->pool);
 			}
 			cur_seg = cur_seg->next;
+		} else if (RTE_MBUF_HAS_EXTBUF(cur_seg)) {
+			sg_temp->bpid = 0xff;
+			cur_seg = cur_seg->next;
 		} else {
 			/* Get owner MBUF from indirect buffer */
 			mi = rte_mbuf_from_indirect(cur_seg);
@@ -911,6 +913,9 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf,
 			 */
 			DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, bp_info->bpid);
 		}
+	} else if (RTE_MBUF_HAS_EXTBUF(mbuf)) {
+		DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr,
+				bp_info ? bp_info->bpid : 0xff);
 	} else {
 		/* This is data-containing core mbuf: 'mi' */
 		mi = rte_mbuf_from_indirect(mbuf);
@@ -929,7 +934,8 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf,
 			 * been released by BMAN.
 			 */
 			rte_mbuf_refcnt_update(mi, 1);
-			DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, bp_info->bpid);
+			DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr,
+						bp_info ? bp_info->bpid : 0xff);
 		}
 		rte_pktmbuf_free(mbuf);
 	}
@@ -951,7 +957,7 @@ tx_on_dpaa_pool(struct rte_mbuf *mbuf,
 		tx_on_dpaa_pool_unsegmented(mbuf, bp_info, fd_arr);
 	} else if (mbuf->nb_segs > 1 &&
 		   mbuf->nb_segs <= DPAA_SGT_MAX_ENTRIES) {
-		if (dpaa_eth_mbuf_to_sg_fd(mbuf, fd_arr, bp_info->bpid)) {
+		if (dpaa_eth_mbuf_to_sg_fd(mbuf, fd_arr, bp_info)) {
 			DPAA_PMD_DEBUG("Unable to create Scatter Gather FD");
 			return 1;
 		}
@@ -1055,6 +1061,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 	uint16_t state;
 	int ret, realloc_mbuf = 0;
 	uint32_t seqn, index, flags[DPAA_TX_BURST_SIZE] = {0};
+	struct rte_mbuf **orig_bufs = bufs;
 
 	if (unlikely(!DPAA_PER_LCORE_PORTAL)) {
 		ret = rte_dpaa_portal_init((void *)0);
@@ -1112,6 +1119,11 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 				mp = mi->pool;
 			}
 
+			if (unlikely(RTE_MBUF_HAS_EXTBUF(mbuf))) {
+				bp_info = NULL;
+				goto indirect_buf;
+			}
+
 			bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp);
 			if (unlikely(mp->ops_index != bp_info->dpaa_ops_index ||
 				     realloc_mbuf == 1)) {
@@ -1130,7 +1142,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 				mbuf = temp_mbuf;
 				realloc_mbuf = 0;
 			}
-
+indirect_buf:
 			state = tx_on_dpaa_pool(mbuf, bp_info,
 						&fd_arr[loop]);
 			if (unlikely(state)) {
@@ -1157,6 +1169,15 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 
 	DPAA_DP_LOG(DEBUG, "Transmitted %d buffers on queue: %p", sent, q);
 
+
+	loop = 0;
+	while (loop < sent) {
+		if (unlikely(RTE_MBUF_HAS_EXTBUF(*orig_bufs)))
+			rte_pktmbuf_free(*orig_bufs);
+		orig_bufs++;
+		loop++;
+	}
+
 	return sent;
 }
 
drivers/net/dpaa/dpaa_rxtx.h +1 -7
index d9d7e04f5c..99e09196e9 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2017,2020 NXP
+ *   Copyright 2017,2020-2021 NXP
  *
  */
 
@@ -279,12 +279,6 @@ uint16_t dpaa_eth_tx_drop_all(void *q  __rte_unused,
 			      struct rte_mbuf **bufs __rte_unused,
 			      uint16_t nb_bufs __rte_unused);
 
-struct rte_mbuf *dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid);
-
-int dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
-			   struct qm_fd *fd,
-			   uint32_t bpid);
-
 uint16_t dpaa_free_mbuf(const struct qm_fd *fd);
 void dpaa_rx_cb(struct qman_fq **fq,
 		struct qm_dqrr_entry **dqrr, void **bufs, int num_bufs);
Signature · 1 line
2.17.1
#23 lore raw

PATCH v2 8/20 net/dpaa2: add traffic management driver

In reply to Hemant Agrawal

From: Gagandeep Singh <[email protected]>

Add basic support for scheduling and shaping on dpaa2 platform.

HW supports 2 level of scheduling and shaping. However the current patch only support single level.

---
 doc/guides/nics/dpaa2.rst           | 120 +++++-
 drivers/net/dpaa2/dpaa2_ethdev.c    |  14 +-
 drivers/net/dpaa2/dpaa2_ethdev.h    |   5 +
 drivers/net/dpaa2/dpaa2_tm.c        | 626 ++++++++++++++++++++++++++++
 drivers/net/dpaa2/dpaa2_tm.h        |  32 ++
 drivers/net/dpaa2/mc/dpni.c         | 313 +++++++++++++-
 drivers/net/dpaa2/mc/fsl_dpni.h     | 210 +++++++++-
 drivers/net/dpaa2/mc/fsl_dpni_cmd.h |  59 ++-
 drivers/net/dpaa2/meson.build       |   3 +-
 9 files changed, 1376 insertions(+), 6 deletions(-)
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.c
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.h
doc/guides/nics/dpaa2.rst +119 -1
index 233d926e0a..893e87e714 100644
@@ -1,5 +1,5 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
-    Copyright 2016,2020 NXP
+    Copyright 2016,2020-2021 NXP
 
 
 DPAA2 Poll Mode Driver
@@ -406,6 +406,8 @@ Features of the DPAA2 PMD are:
 - Jumbo frames
 - Link flow control
 - Scattered and gather for TX and RX
+- :ref:`Traffic Management API <dptmapi>`
+
 
 Supported DPAA2 SoCs
 --------------------
@@ -548,3 +550,119 @@ Other Limitations
 
 - RSS hash key cannot be modified.
 - RSS RETA cannot be configured.
+
+.. _dptmapi:
+
+Traffic Management API
+----------------------
+
+DPAA2 PMD supports generic DPDK Traffic Management API which allows to
+configure the following features:
+
+1. Hierarchical scheduling
+2. Traffic shaping
+
+Internally TM is represented by a hierarchy (tree) of nodes.
+Node which has a parent is called a leaf whereas node without
+parent is called a non-leaf (root).
+
+Nodes hold following types of settings:
+
+- for egress scheduler configuration: weight
+- for egress rate limiter: private shaper
+
+Hierarchy is always constructed from the top, i.e first a root node is added
+then some number of leaf nodes. Number of leaf nodes cannot exceed number
+of configured tx queues.
+
+After hierarchy is complete it can be committed.
+
+For an additional description please refer to DPDK :doc:`Traffic Management API <../prog_guide/traffic_management>`.
+
+Supported Features
+~~~~~~~~~~~~~~~~~~
+
+The following capabilities are supported:
+
+- Level0 (root node) and Level1 are supported.
+- 1 private shaper at root node (port level) is supported.
+- 8 TX queues per port supported (1 channel per port)
+- Both SP and WFQ scheduling mechanisms are supported on all 8 queues.
+- Congestion notification is supported. It means if there is congestion on
+    the network, DPDK driver will not enqueue any packet (no taildrop or WRED)
+
+  User can also check node, level capabilities using testpmd commands.
+
+Usage example
+~~~~~~~~~~~~~
+
+For a detailed usage description please refer to "Traffic Management" section in DPDK :doc:`Testpmd Runtime Functions <../testpmd_app_ug/testpmd_funcs>`.
+
+1. Run testpmd as follows:
+
+   .. code-block:: console
+
+	./dpdk-testpmd  -c 0xf -n 1 -- -i --portmask 0x3 --nb-cores=1 --txq=4 --rxq=4
+
+2. Stop all ports:
+
+   .. code-block:: console
+
+	testpmd> port stop all
+
+3. Add shaper profile:
+
+   One port level shaper and strict priority on all 4 queues of port 0:
+
+   .. code-block:: console
+
+	add port tm node shaper profile 0 1 104857600 64 100 0 0
+	add port tm nonleaf node 0 8 -1 0 1 0 1 1 1 0
+	add port tm leaf node 0 0 8 0 1 1 -1 0 0 0 0
+	add port tm leaf node 0 1 8 1 1 1 -1 0 0 0 0
+	add port tm leaf node 0 2 8 2 1 1 -1 0 0 0 0
+	add port tm leaf node 0 3 8 3 1 1 -1 0 0 0 0
+	port tm hierarchy commit 0 no
+
+	or
+
+   One port level shaper and WFQ on all 4 queues of port 0:
+
+   .. code-block:: console
+
+	add port tm node shaper profile 0 1 104857600 64 100 0 0
+	add port tm nonleaf node 0 8 -1 0 1 0 1 1 1 0
+	add port tm leaf node 0 0 8 0 200 1 -1 0 0 0 0
+	add port tm leaf node 0 1 8 0 300 1 -1 0 0 0 0
+	add port tm leaf node 0 2 8 0 400 1 -1 0 0 0 0
+	add port tm leaf node 0 3 8 0 500 1 -1 0 0 0 0
+	port tm hierarchy commit 0 no
+
+4. Create flows as per the source IP addresses:
+
+   .. code-block:: console
+
+	flow create 1 group 0 priority 1 ingress pattern ipv4 src is \
+	10.10.10.1 / end actions queue index 0 / end
+	flow create 1 group 0 priority 2 ingress pattern ipv4 src is \
+	10.10.10.2 / end actions queue index 1 / end
+	flow create 1 group 0 priority 3 ingress pattern ipv4 src is \
+	10.10.10.3 / end actions queue index 2 / end
+	flow create 1 group 0 priority 4 ingress pattern ipv4 src is \
+	10.10.10.4 / end actions queue index 3 / end
+
+5. Start all ports
+
+   .. code-block:: console
+
+	testpmd> port start all
+
+
+
+6. Enable forwarding
+
+   .. code-block:: console
+
+		testpmd> start
+
+7. Inject the traffic on port1 as per the configured flows, you will see shaped and scheduled forwarded traffic on port0
drivers/net/dpaa2/dpaa2_ethdev.c +13 -1
index a81c73438e..490eb4b3f4 100644
@@ -1,7 +1,7 @@
 /* * SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2016-2020 NXP
+ *   Copyright 2016-2021 NXP
  *
  */
 
@@ -638,6 +638,8 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev)
 	if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
 		dpaa2_vlan_offload_set(dev, ETH_VLAN_FILTER_MASK);
 
+	dpaa2_tm_init(dev);
+
 	return 0;
 }
 
@@ -1264,6 +1266,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev)
 		return -1;
 	}
 
+	dpaa2_tm_deinit(dev);
 	dpaa2_flow_clean(dev);
 	/* Clean the device first */
 	ret = dpni_reset(dpni, CMD_PRI_LOW, priv->token);
@@ -2345,6 +2348,14 @@ dpaa2_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->conf.tx_deferred_start = 0;
 }
 
+static int
+dpaa2_tm_ops_get(struct rte_eth_dev *dev __rte_unused, void *ops)
+{
+	*(const void **)ops = &dpaa2_tm_ops;
+
+	return 0;
+}
+
 static struct eth_dev_ops dpaa2_ethdev_ops = {
 	.dev_configure	  = dpaa2_eth_dev_configure,
 	.dev_start	      = dpaa2_dev_start,
@@ -2387,6 +2398,7 @@ static struct eth_dev_ops dpaa2_ethdev_ops = {
 	.filter_ctrl          = dpaa2_dev_flow_ctrl,
 	.rxq_info_get	      = dpaa2_rxq_info_get,
 	.txq_info_get	      = dpaa2_txq_info_get,
+	.tm_ops_get	      = dpaa2_tm_ops_get,
 #if defined(RTE_LIBRTE_IEEE1588)
 	.timesync_enable      = dpaa2_timesync_enable,
 	.timesync_disable     = dpaa2_timesync_disable,
drivers/net/dpaa2/dpaa2_ethdev.h +5 -0
index bb49fa9a38..9837eb62c8 100644
@@ -12,6 +12,7 @@
 #include <rte_pmd_dpaa2.h>
 
 #include <dpaa2_hw_pvt.h>
+#include "dpaa2_tm.h"
 
 #include <mc/fsl_dpni.h>
 #include <mc/fsl_mc_sys.h>
@@ -112,6 +113,8 @@ extern int dpaa2_timestamp_dynfield_offset;
 extern const struct rte_flow_ops dpaa2_flow_ops;
 extern enum rte_filter_type dpaa2_filter_type;
 
+extern const struct rte_tm_ops dpaa2_tm_ops;
+
 #define IP_ADDRESS_OFFSET_INVALID (-1)
 
 struct dpaa2_key_info {
@@ -179,6 +182,8 @@ struct dpaa2_dev_priv {
 	struct rte_eth_dev *eth_dev; /**< Pointer back to holding ethdev */
 
 	LIST_HEAD(, rte_flow) flows; /**< Configured flow rule handles. */
+	LIST_HEAD(nodes, dpaa2_tm_node) nodes;
+	LIST_HEAD(shaper_profiles, dpaa2_tm_shaper_profile) shaper_profiles;
 };
 
 int dpaa2_distset_to_dpkg_profile_cfg(uint64_t req_dist_set,
drivers/net/dpaa2/dpaa2_tm.c new file +626 -0

626 lines not on this page · raw message

drivers/net/dpaa2/dpaa2_tm.h new file +32 -0
new file mode 100644
index 0000000000..6632fab687
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2020 NXP
+ */
+
+#ifndef _DPAA2_TM_H_
+#define _DPAA2_TM_H_
+
+#include <rte_tm.h>
+
+struct dpaa2_tm_shaper_profile {
+	LIST_ENTRY(dpaa2_tm_shaper_profile) next;
+	uint32_t id;
+	int refcnt;
+	struct rte_tm_shaper_params params;
+};
+
+struct dpaa2_tm_node {
+	LIST_ENTRY(dpaa2_tm_node) next;
+	uint32_t id;
+	uint32_t type;
+	int refcnt;
+	struct dpaa2_tm_node *parent;
+	struct dpaa2_tm_shaper_profile *profile;
+	uint32_t weight;
+	uint32_t priority;
+	uint64_t stats_mask;
+};
+
+int dpaa2_tm_init(struct rte_eth_dev *dev);
+void dpaa2_tm_deinit(struct rte_eth_dev *dev);
+
+#endif /* _DPAA2_TM_H_ */
drivers/net/dpaa2/mc/dpni.c +312 -1

337 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpni.h +209 -1

240 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpni_cmd.h +58 -1

89 lines not on this page · raw message

drivers/net/dpaa2/meson.build +2 -1
index 844dd25159..f5f411d592 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright 2018 NXP
+# Copyright 2018-2021 NXP
 
 if not is_linux
 	build = false
@@ -8,6 +8,7 @@ endif
 
 deps += ['mempool_dpaa2']
 sources = files('base/dpaa2_hw_dpni.c',
+		'dpaa2_tm.c',
 		'dpaa2_mux.c',
 		'dpaa2_ethdev.c',
 		'dpaa2_flow.c',
Signature · 1 line
2.17.1
#24 lore raw

PATCH v2 9/20 net/dpaa2: add support to configure dpdmux max Rx frame len

In reply to Hemant Agrawal

This patch introduce a new pmd api, which can help the applications to configure the max framelen for a given dpdmux interface

---
 drivers/net/dpaa2/dpaa2_mux.c     | 28 +++++++++++++++++++++++++++-
 drivers/net/dpaa2/rte_pmd_dpaa2.h | 18 +++++++++++++++++-
 drivers/net/dpaa2/version.map     |  1 +
 3 files changed, 45 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_mux.c +27 -1
index f8366e839e..b397d333d6 100644
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018-2020 NXP
+ * Copyright 2018-2021 NXP
  */
 
 #include <sys/queue.h>
@@ -205,6 +205,32 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 	return NULL;
 }
 
+int
+rte_pmd_dpaa2_mux_rx_frame_len(uint32_t dpdmux_id, uint16_t max_rx_frame_len)
+{
+	struct dpaa2_dpdmux_dev *dpdmux_dev;
+	int ret;
+
+	/* Find the DPDMUX from dpdmux_id in our list */
+	dpdmux_dev = get_dpdmux_from_id(dpdmux_id);
+	if (!dpdmux_dev) {
+		DPAA2_PMD_ERR("Invalid dpdmux_id: %d", dpdmux_id);
+		return -1;
+	}
+
+	ret = dpdmux_set_max_frame_length(&dpdmux_dev->dpdmux,
+			CMD_PRI_LOW, dpdmux_dev->token, max_rx_frame_len);
+	if (ret) {
+		DPAA2_PMD_ERR("DPDMUX:Unable to set mtu. check config %d", ret);
+		return ret;
+	}
+
+	DPAA2_PMD_INFO("dpdmux mtu set as %u",
+			DPAA2_MAX_RX_PKT_LEN - RTE_ETHER_CRC_LEN);
+
+	return ret;
+}
+
 static int
 dpaa2_create_dpdmux_device(int vdev_fd __rte_unused,
 			   struct vfio_device_info *obj_info __rte_unused,
drivers/net/dpaa2/rte_pmd_dpaa2.h +17 -1
index ec8df75af9..7204a8f951 100644
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018-2020 NXP
+ * Copyright 2018-2021 NXP
  */
 
 #ifndef _RTE_PMD_DPAA2_H
@@ -40,6 +40,22 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 			      struct rte_flow_item *pattern[],
 			      struct rte_flow_action *actions[]);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * demultiplex interface max rx frame length configure
+ *
+ * @param dpdmux_id
+ *    ID of the DPDMUX MC object.
+ * @param max_rx_frame_len
+ *    maximum receive frame length (will be checked to be minimux of all dpnis)
+ *
+ */
+__rte_experimental
+int
+rte_pmd_dpaa2_mux_rx_frame_len(uint32_t dpdmux_id, uint16_t max_rx_frame_len);
+
 /**
  * @warning
  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
drivers/net/dpaa2/version.map +1 -0
index 72d1b2b1c8..3c087c2423 100644
@@ -2,6 +2,7 @@ EXPERIMENTAL {
 	global:
 
 	rte_pmd_dpaa2_mux_flow_create;
+	rte_pmd_dpaa2_mux_rx_frame_len;
 	rte_pmd_dpaa2_set_custom_hash;
 };
 
Signature · 1 line
2.17.1
#25 lore raw

PATCH v2 10/20 net/dpaa2: add support for raw pattern in dpdmux

In reply to Hemant Agrawal

From: Akhil Goyal <[email protected]>

Added support for flow raw pattern and check that the call for dpdmux_set_custom_key() which should be called only once for a particular DPDMUX as all previous rules will be erased with this call.
Hence calling it for the first time only.

---
 drivers/net/dpaa2/dpaa2_mux.c         | 39 ++++++++++++++++++++++-----
 drivers/net/dpaa2/mc/dpdmux.c         |  3 ++-
 drivers/net/dpaa2/mc/fsl_dpdmux.h     | 12 +++++++--
 drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h |  4 +--
 4 files changed, 46 insertions(+), 12 deletions(-)
drivers/net/dpaa2/dpaa2_mux.c +32 -7
index b397d333d6..b669a16fc1 100644
@@ -66,6 +66,7 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 	void *key_iova, *mask_iova, *key_cfg_iova = NULL;
 	uint8_t key_size = 0;
 	int ret;
+	static int i;
 
 	/* Find the DPDMUX from dpdmux_id in our list */
 	dpdmux_dev = get_dpdmux_from_id(dpdmux_id);
@@ -154,6 +155,23 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 	}
 	break;
 
+	case RTE_FLOW_ITEM_TYPE_RAW:
+	{
+		const struct rte_flow_item_raw *spec;
+
+		spec = (const struct rte_flow_item_raw *)pattern[0]->spec;
+		kg_cfg.extracts[0].extract.from_data.offset = spec->offset;
+		kg_cfg.extracts[0].extract.from_data.size = spec->length;
+		kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_DATA;
+		kg_cfg.num_extracts = 1;
+		memcpy((void *)key_iova, (const void *)spec->pattern,
+							spec->length);
+		memcpy(mask_iova, pattern[0]->mask, spec->length);
+
+		key_size = spec->length;
+	}
+	break;
+
 	default:
 		DPAA2_PMD_ERR("Not supported pattern type: %d",
 				pattern[0]->type);
@@ -166,20 +184,27 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 		goto creation_error;
 	}
 
-	ret = dpdmux_set_custom_key(&dpdmux_dev->dpdmux, CMD_PRI_LOW,
-				    dpdmux_dev->token,
-			(uint64_t)(DPAA2_VADDR_TO_IOVA(key_cfg_iova)));
-	if (ret) {
-		DPAA2_PMD_ERR("dpdmux_set_custom_key failed: err(%d)", ret);
-		goto creation_error;
+	/* Multiple rules with same DPKG extracts (kg_cfg.extracts) like same
+	 * offset and length values in raw is supported right now. Different
+	 * values of kg_cfg may not work.
+	 */
+	if (i == 0) {
+		ret = dpdmux_set_custom_key(&dpdmux_dev->dpdmux, CMD_PRI_LOW,
+					    dpdmux_dev->token,
+				(uint64_t)(DPAA2_VADDR_TO_IOVA(key_cfg_iova)));
+		if (ret) {
+			DPAA2_PMD_ERR("dpdmux_set_custom_key failed: err(%d)",
+					ret);
+			goto creation_error;
+		}
 	}
-
 	/* As now our key extract parameters are set, let us configure
 	 * the rule.
 	 */
 	flow->rule.key_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(key_iova));
 	flow->rule.mask_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(mask_iova));
 	flow->rule.key_size = key_size;
+	flow->rule.entry_index = i++;
 
 	vf_conf = (const struct rte_flow_action_vf *)(actions[0]->conf);
 	if (vf_conf->id == 0 || vf_conf->id > dpdmux_dev->num_ifs) {
drivers/net/dpaa2/mc/dpdmux.c +2 -1
index 63f1ec7d30..67d37ed4cd 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2013-2016 Freescale Semiconductor Inc.
- * Copyright 2018-2019 NXP
+ * Copyright 2018-2021 NXP
  *
  */
 #include <fsl_mc_sys.h>
@@ -852,6 +852,7 @@ int dpdmux_add_custom_cls_entry(struct fsl_mc_io *mc_io,
 
 	cmd_params = (struct dpdmux_cmd_add_custom_cls_entry *)cmd.params;
 	cmd_params->key_size = rule->key_size;
+	cmd_params->entry_index = rule->entry_index;
 	cmd_params->dest_if = cpu_to_le16(action->dest_if);
 	cmd_params->key_iova = cpu_to_le64(rule->key_iova);
 	cmd_params->mask_iova = cpu_to_le64(rule->mask_iova);
drivers/net/dpaa2/mc/fsl_dpdmux.h +10 -2
index accd1ef5c1..b809aade5d 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2013-2016 Freescale Semiconductor Inc.
- * Copyright 2018-2019 NXP
+ * Copyright 2018-2021 NXP
  *
  */
 #ifndef __FSL_DPDMUX_H
@@ -367,15 +367,23 @@ int dpdmux_set_custom_key(struct fsl_mc_io *mc_io,
  * struct dpdmux_rule_cfg - Custom classification rule.
  *
  * @key_iova: DMA address of buffer storing the look-up value
- * @mask_iova: DMA address of the mask used for TCAM classification
+ * @mask_iova: DMA address of the mask used for TCAM classification. This
+ *  parameter is used only if dpdmux was created using option
+ *  DPDMUX_OPT_CLS_MASK_SUPPORT.
  * @key_size: size, in bytes, of the look-up value. This must match the size
  *	of the look-up key defined using dpdmux_set_custom_key, otherwise the
  *	entry will never be hit
+ * @entry_index: rule index into the table. This parameter is used only when
+ *  dpdmux object was created using option DPDMUX_OPT_CLS_MASK_SUPPORT. In
+ *  this case the rule is masking and the current frame may be a hit for
+ *  multiple rules. This parameter determines the order in wich the rules
+ *  will be checked (smaller entry_index first).
  */
 struct dpdmux_rule_cfg {
 	uint64_t key_iova;
 	uint64_t mask_iova;
 	uint8_t key_size;
+	uint16_t entry_index;
 };
 
 /**
drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h +2 -2
index a60b2ebe3c..b6b8c38c41 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2013-2016 Freescale Semiconductor Inc.
- * Copyright 2018-2019 NXP
+ * Copyright 2018-2021 NXP
  *
  */
 #ifndef _FSL_DPDMUX_CMD_H
@@ -204,7 +204,7 @@ struct dpdmux_set_custom_key {
 struct dpdmux_cmd_add_custom_cls_entry {
 	uint8_t pad[3];
 	uint8_t key_size;
-	uint16_t pad1;
+	uint16_t entry_index;
 	uint16_t dest_if;
 	uint64_t key_iova;
 	uint64_t mask_iova;
Signature · 1 line
2.17.1
#26 lore raw

PATCH v2 11/20 net/dpaa2: dpdmux skip reset

In reply to Hemant Agrawal

From: Apeksha Gupta <[email protected]>

This is require as the interface is shared with linux and we do not want the dpdmux to be reset. rather the default interface to kernel shall continue.
command dpdmux_set_resetable is used to skip DPDMUX reset. By default the DPDMUX_RESET command will reset the DPDMUX completely, dpdmux_set_resetable command will be ignored in old MC firmware.

---
 drivers/net/dpaa2/dpaa2_mux.c         | 26 +++++++++
 drivers/net/dpaa2/mc/dpdmux.c         | 84 +++++++++++++++++++++++++++
 drivers/net/dpaa2/mc/fsl_dpdmux.h     | 32 ++++++++++
 drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h | 22 ++++++-
 4 files changed, 161 insertions(+), 3 deletions(-)
drivers/net/dpaa2/dpaa2_mux.c +26 -0
index b669a16fc1..1ff00ca8f7 100644
@@ -264,6 +264,8 @@ dpaa2_create_dpdmux_device(int vdev_fd __rte_unused,
 	struct dpaa2_dpdmux_dev *dpdmux_dev;
 	struct dpdmux_attr attr;
 	int ret;
+	uint16_t maj_ver;
+	uint16_t min_ver;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -298,6 +300,30 @@ dpaa2_create_dpdmux_device(int vdev_fd __rte_unused,
 		goto init_err;
 	}
 
+	ret = dpdmux_get_api_version(&dpdmux_dev->dpdmux, CMD_PRI_LOW,
+					&maj_ver, &min_ver);
+	if (ret) {
+		DPAA2_PMD_ERR("setting version failed in %s",
+				__func__);
+		goto init_err;
+	}
+
+	/* The new dpdmux_set/get_resetable() API are available starting with
+	 * DPDMUX_VER_MAJOR==6 and DPDMUX_VER_MINOR==6
+	 */
+	if (maj_ver >= 6 && min_ver >= 6) {
+		ret = dpdmux_set_resetable(&dpdmux_dev->dpdmux, CMD_PRI_LOW,
+				dpdmux_dev->token,
+				DPDMUX_SKIP_DEFAULT_INTERFACE |
+				DPDMUX_SKIP_UNICAST_RULES |
+				DPDMUX_SKIP_MULTICAST_RULES);
+		if (ret) {
+			DPAA2_PMD_ERR("setting default interface failed in %s",
+				      __func__);
+			goto init_err;
+		}
+	}
+
 	dpdmux_dev->dpdmux_id = dpdmux_id;
 	dpdmux_dev->num_ifs = attr.num_ifs;
 
drivers/net/dpaa2/mc/dpdmux.c +84 -0

106 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpdmux.h +32 -0
index b809aade5d..f035f0f24e 100644
@@ -79,6 +79,8 @@ enum dpdmux_method {
  * @method: Defines the operation method for the DPDMUX address table
  * @manip: Required manipulation operation
  * @num_ifs: Number of interfaces (excluding the uplink interface)
+ * @default_if: Default interface number (different from uplink,
+	maximum value num_ifs)
  * @adv: Advanced parameters; default is all zeros;
  *	use this structure to change default settings
  * @adv.options: DPDMUX options - combination of 'DPDMUX_OPT_<X>' flags.
@@ -89,16 +91,20 @@ enum dpdmux_method {
  * @adv.max_vlan_ids: Maximum vlan ids allowed in the system -
  *	relevant only case of working in mac+vlan method.
  *	0 - indicates default 16 vlan ids.
+ * @adv.mem_size: Size of the memory used for internal buffers expressed as
+ * number of 256byte buffers.
  */
 struct dpdmux_cfg {
 	enum dpdmux_method method;
 	enum dpdmux_manip manip;
 	uint16_t num_ifs;
+	uint16_t default_if;
 	struct {
 		uint64_t options;
 		uint16_t max_dmat_entries;
 		uint16_t max_mc_groups;
 		uint16_t max_vlan_ids;
+		uint16_t mem_size;
 	} adv;
 };
 
@@ -130,6 +136,29 @@ int dpdmux_reset(struct fsl_mc_io *mc_io,
 		 uint32_t cmd_flags,
 		 uint16_t token);
 
+/**
+ *Setting 1 DPDMUX_RESET will not reset default interface
+ */
+#define DPDMUX_SKIP_DEFAULT_INTERFACE	0x01
+/**
+ *Setting 1 DPDMUX_RESET will not reset unicast rules
+ */
+#define DPDMUX_SKIP_UNICAST_RULES	0x02
+/**
+ *Setting 1 DPDMUX_RESET will not reset multicast rules
+ */
+#define DPDMUX_SKIP_MULTICAST_RULES	0x04
+
+int dpdmux_set_resetable(struct fsl_mc_io *mc_io,
+				  uint32_t cmd_flags,
+				  uint16_t token,
+				  uint8_t skip_reset_flags);
+
+int dpdmux_get_resetable(struct fsl_mc_io *mc_io,
+				  uint32_t cmd_flags,
+				  uint16_t token,
+				  uint8_t *skip_reset_flags);
+
 /**
  * struct dpdmux_attr - Structure representing DPDMUX attributes
  * @id: DPDMUX object ID
@@ -138,6 +167,8 @@ int dpdmux_reset(struct fsl_mc_io *mc_io,
  * @manip: DPDMUX manipulation type
  * @num_ifs: Number of interfaces (excluding the uplink interface)
  * @mem_size: DPDMUX frame storage memory size
+ * @default_if: Default interface number (different from uplink,
+	maximum value num_ifs)
  */
 struct dpdmux_attr {
 	int id;
@@ -146,6 +177,7 @@ struct dpdmux_attr {
 	enum dpdmux_manip manip;
 	uint16_t num_ifs;
 	uint16_t mem_size;
+	uint16_t default_if;
 };
 
 int dpdmux_get_attributes(struct fsl_mc_io *mc_io,
drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h +19 -3
index b6b8c38c41..2444e9a2e5 100644
@@ -55,6 +55,9 @@
 #define DPDMUX_CMDID_IF_SET_DEFAULT		DPDMUX_CMD(0x0b8)
 #define DPDMUX_CMDID_IF_GET_DEFAULT		DPDMUX_CMD(0x0b9)
 
+#define DPDMUX_CMDID_SET_RESETABLE		DPDMUX_CMD(0x0ba)
+#define DPDMUX_CMDID_GET_RESETABLE		DPDMUX_CMD(0x0bb)
+
 #define DPDMUX_MASK(field)        \
 	GENMASK(DPDMUX_##field##_SHIFT + DPDMUX_##field##_SIZE - 1, \
 		DPDMUX_##field##_SHIFT)
@@ -72,12 +75,13 @@ struct dpdmux_cmd_create {
 	uint8_t method;
 	uint8_t manip;
 	uint16_t num_ifs;
-	uint32_t pad;
+	uint16_t default_if;
+	uint16_t pad;
 
 	uint16_t adv_max_dmat_entries;
 	uint16_t adv_max_mc_groups;
 	uint16_t adv_max_vlan_ids;
-	uint16_t pad1;
+	uint16_t mem_size;
 
 	uint64_t options;
 };
@@ -100,7 +104,7 @@ struct dpdmux_rsp_get_attr {
 	uint8_t manip;
 	uint16_t num_ifs;
 	uint16_t mem_size;
-	uint16_t pad;
+	uint16_t default_if;
 
 	uint64_t pad1;
 
@@ -217,5 +221,17 @@ struct dpdmux_cmd_remove_custom_cls_entry {
 	uint64_t key_iova;
 	uint64_t mask_iova;
 };
+
+#define DPDMUX_SKIP_RESET_FLAGS_SHIFT    0
+#define DPDMUX_SKIP_RESET_FLAGS_SIZE     3
+
+struct dpdmux_cmd_set_skip_reset_flags {
+	uint8_t skip_reset_flags;
+};
+
+struct dpdmux_rsp_get_skip_reset_flags {
+	uint8_t skip_reset_flags;
+};
+
 #pragma pack(pop)
 #endif /* _FSL_DPDMUX_CMD_H */
Signature · 1 line
2.17.1
#27 lore raw

PATCH v2 12/20 net/dpaa2: support dpdmux to not drop parse err pkts

In reply to Hemant Agrawal

DPDMUX should not drop parse error packets. They shall be left to the decision of the connected DPNI interfaces

---
 drivers/net/dpaa2/dpaa2_mux.c         |  18 ++++
 drivers/net/dpaa2/mc/dpdmux.c         |  37 +++++++++
 drivers/net/dpaa2/mc/fsl_dpdmux.h     | 113 +++++++++++++++++++++++++-
 drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h |  25 ++++--
 4 files changed, 187 insertions(+), 6 deletions(-)
drivers/net/dpaa2/dpaa2_mux.c +18 -0
index 1ff00ca8f7..811f417491 100644
@@ -324,6 +324,24 @@ dpaa2_create_dpdmux_device(int vdev_fd __rte_unused,
 		}
 	}
 
+	if (maj_ver >= 6 && min_ver >= 9) {
+		struct dpdmux_error_cfg mux_err_cfg;
+
+		memset(&mux_err_cfg, 0, sizeof(mux_err_cfg));
+		mux_err_cfg.error_action = DPDMUX_ERROR_ACTION_CONTINUE;
+		mux_err_cfg.errors = DPDMUX_ERROR_DISC;
+
+		ret = dpdmux_if_set_errors_behavior(&dpdmux_dev->dpdmux,
+				CMD_PRI_LOW,
+				dpdmux_dev->token, dpdmux_id,
+				&mux_err_cfg);
+		if (ret) {
+			DPAA2_PMD_ERR("dpdmux_if_set_errors_behavior %s err %d",
+				      __func__, ret);
+			goto init_err;
+		}
+	}
+
 	dpdmux_dev->dpdmux_id = dpdmux_id;
 	dpdmux_dev->num_ifs = attr.num_ifs;
 
drivers/net/dpaa2/mc/dpdmux.c +37 -0
index 57c811c70f..93912ef9d3 100644
@@ -1012,3 +1012,40 @@ int dpdmux_get_api_version(struct fsl_mc_io *mc_io,
 
 	return 0;
 }
+
+/**
+ * dpdmux_if_set_errors_behavior() - Set errors behavior
+ * @cmd_flags:	Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:	Token of DPSW object
+ * @if_id:  Interface Identifier
+ * @cfg:	Errors configuration
+ *
+ * Provides a set of frame errors that will be rejected or accepted by the
+ * dpdmux interface. The frame with this errors will no longer be dropped by
+ * the dpdmux interface. When frame has parsing error the distribution to
+ * expected interface may fail. If the frame must be distributed using the
+ * information from a header that was not parsed due errors the frame may
+ * be discarded or end up on a default interface because needed data was not
+ * parsed properly.
+ * This function may be called numerous times with different error masks
+ *
+ * Return:	'0' on Success; Error code otherwise.
+ */
+int dpdmux_if_set_errors_behavior(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
+		uint16_t token, uint16_t if_id, struct dpdmux_error_cfg *cfg)
+{
+	struct mc_command cmd = { 0 };
+	struct dpdmux_cmd_set_errors_behavior *cmd_params;
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_SET_ERRORS_BEHAVIOR,
+					cmd_flags,
+					token);
+	cmd_params = (struct dpdmux_cmd_set_errors_behavior *)cmd.params;
+	cmd_params->errors = cpu_to_le32(cfg->errors);
+	dpdmux_set_field(cmd_params->flags, ERROR_ACTION, cfg->error_action);
+	cmd_params->if_id = cpu_to_le16(if_id);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
drivers/net/dpaa2/mc/fsl_dpdmux.h +112 -1

135 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h +20 -5
index 2444e9a2e5..2ab4d75dfb 100644
@@ -9,30 +9,35 @@
 
 /* DPDMUX Version */
 #define DPDMUX_VER_MAJOR		6
-#define DPDMUX_VER_MINOR		3
+#define DPDMUX_VER_MINOR		9
 
 #define DPDMUX_CMD_BASE_VERSION		1
 #define DPDMUX_CMD_VERSION_2		2
+#define DPDMUX_CMD_VERSION_3		3
+#define DPDMUX_CMD_VERSION_4		4
 #define DPDMUX_CMD_ID_OFFSET		4
 
 #define DPDMUX_CMD(id)	(((id) << DPDMUX_CMD_ID_OFFSET) |\
 				DPDMUX_CMD_BASE_VERSION)
 #define DPDMUX_CMD_V2(id) (((id) << DPDMUX_CMD_ID_OFFSET) | \
 				DPDMUX_CMD_VERSION_2)
+#define DPDMUX_CMD_V3(id)	(((id) << DPDMUX_CMD_ID_OFFSET) |\
+				DPDMUX_CMD_VERSION_3)
+#define DPDMUX_CMD_V4(id)	(((id) << DPDMUX_CMD_ID_OFFSET) |\
+				DPDMUX_CMD_VERSION_4)
 
 /* Command IDs */
 #define DPDMUX_CMDID_CLOSE			DPDMUX_CMD(0x800)
 #define DPDMUX_CMDID_OPEN			DPDMUX_CMD(0x806)
-#define DPDMUX_CMDID_CREATE			DPDMUX_CMD(0x906)
+#define DPDMUX_CMDID_CREATE			DPDMUX_CMD_V4(0x906)
 #define DPDMUX_CMDID_DESTROY			DPDMUX_CMD(0x986)
 #define DPDMUX_CMDID_GET_API_VERSION		DPDMUX_CMD(0xa06)
 
 #define DPDMUX_CMDID_ENABLE			DPDMUX_CMD(0x002)
 #define DPDMUX_CMDID_DISABLE			DPDMUX_CMD(0x003)
-#define DPDMUX_CMDID_GET_ATTR			DPDMUX_CMD(0x004)
+#define DPDMUX_CMDID_GET_ATTR			DPDMUX_CMD_V2(0x004)
 #define DPDMUX_CMDID_RESET			DPDMUX_CMD(0x005)
 #define DPDMUX_CMDID_IS_ENABLED			DPDMUX_CMD(0x006)
-
 #define DPDMUX_CMDID_SET_MAX_FRAME_LENGTH	DPDMUX_CMD(0x0a1)
 
 #define DPDMUX_CMDID_UL_RESET_COUNTERS		DPDMUX_CMD(0x0a3)
@@ -49,7 +54,7 @@
 #define DPDMUX_CMDID_IF_GET_LINK_STATE		DPDMUX_CMD_V2(0x0b4)
 
 #define DPDMUX_CMDID_SET_CUSTOM_KEY		DPDMUX_CMD(0x0b5)
-#define DPDMUX_CMDID_ADD_CUSTOM_CLS_ENTRY	DPDMUX_CMD(0x0b6)
+#define DPDMUX_CMDID_ADD_CUSTOM_CLS_ENTRY	DPDMUX_CMD_V2(0x0b6)
 #define DPDMUX_CMDID_REMOVE_CUSTOM_CLS_ENTRY	DPDMUX_CMD(0x0b7)
 
 #define DPDMUX_CMDID_IF_SET_DEFAULT		DPDMUX_CMD(0x0b8)
@@ -57,6 +62,7 @@
 
 #define DPDMUX_CMDID_SET_RESETABLE		DPDMUX_CMD(0x0ba)
 #define DPDMUX_CMDID_GET_RESETABLE		DPDMUX_CMD(0x0bb)
+#define DPDMUX_CMDID_SET_ERRORS_BEHAVIOR	DPDMUX_CMD(0x0bf)
 
 #define DPDMUX_MASK(field)        \
 	GENMASK(DPDMUX_##field##_SHIFT + DPDMUX_##field##_SIZE - 1, \
@@ -233,5 +239,14 @@ struct dpdmux_rsp_get_skip_reset_flags {
 	uint8_t skip_reset_flags;
 };
 
+#define DPDMUX_ERROR_ACTION_SHIFT		0
+#define DPDMUX_ERROR_ACTION_SIZE		4
+
+struct dpdmux_cmd_set_errors_behavior {
+	uint32_t errors;
+	uint16_t flags;
+	uint16_t if_id;
+};
+
 #pragma pack(pop)
 #endif /* _FSL_DPDMUX_CMD_H */
Signature · 1 line
2.17.1
#28 lore raw

PATCH v2 13/20 net/dpaa2: add device args for enable Tx confirmation

In reply to Hemant Agrawal

Add support for dev arg ``fslmc:dpni.1,drv_tx_conf=1``

It is optional for dpaa2 to use TX confirmation. DPAA2 can free the transmitted packets. However some use-case requires the TX confirmation to be explicit.

---
 doc/guides/nics/dpaa2.rst        |  4 ++++
 drivers/net/dpaa2/dpaa2_ethdev.c | 35 +++++++++++++++++---------------
 drivers/net/dpaa2/dpaa2_ethdev.h |  5 +++--
 3 files changed, 26 insertions(+), 18 deletions(-)
doc/guides/nics/dpaa2.rst +4 -0
index 893e87e714..4eec8fcdd9 100644
@@ -484,6 +484,10 @@ for details.
   of the packet pull command which is issued  in the previous cycle.
   e.g. ``fslmc:dpni.1,drv_no_prefetch=1``
 
+* Use dev arg option  ``drv_tx_conf=1`` to enable TX confirmation mode.
+  In this mode tx conf queues need to be polled to free the buffers.
+  e.g. ``fslmc:dpni.1,drv_tx_conf=1``
+
 Enabling logs
 -------------
 
drivers/net/dpaa2/dpaa2_ethdev.c +19 -16
index 490eb4b3f4..4b3eb7f5c9 100644
@@ -31,6 +31,7 @@
 
 #define DRIVER_LOOPBACK_MODE "drv_loopback"
 #define DRIVER_NO_PREFETCH_MODE "drv_no_prefetch"
+#define DRIVER_TX_CONF "drv_tx_conf"
 #define CHECK_INTERVAL         100  /* 100ms */
 #define MAX_REPEAT_TIME        90   /* 9s (90 * 100ms) in total */
 
@@ -363,7 +364,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);
-	if (priv->tx_conf_en)
+	if (priv->flags & DPAA2_TX_CONF_ENABLE)
 		tot_queues = priv->nb_rx_queues + 2 * priv->nb_tx_queues;
 	else
 		tot_queues = priv->nb_rx_queues + priv->nb_tx_queues;
@@ -401,7 +402,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev)
 			goto fail_tx;
 	}
 
-	if (priv->tx_conf_en) {
+	if (priv->flags & DPAA2_TX_CONF_ENABLE) {
 		/*Setup tx confirmation queues*/
 		for (i = 0; i < priv->nb_tx_queues; i++) {
 			mc_q->eth_data = dev->data;
@@ -483,7 +484,7 @@ dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev)
 			dpaa2_q = (struct dpaa2_queue *)priv->tx_vq[i];
 			rte_free(dpaa2_q->cscn);
 		}
-		if (priv->tx_conf_en) {
+		if (priv->flags & DPAA2_TX_CONF_ENABLE) {
 			/* cleanup tx conf queue storage */
 			for (i = 0; i < priv->nb_tx_queues; i++) {
 				dpaa2_q = (struct dpaa2_queue *)
@@ -857,7 +858,7 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
 	if (tx_queue_id == 0) {
 		/*Set tx-conf and error configuration*/
-		if (priv->tx_conf_en)
+		if (priv->flags & DPAA2_TX_CONF_ENABLE)
 			ret = dpni_set_tx_confirmation_mode(dpni, CMD_PRI_LOW,
 							    priv->token,
 							    DPNI_CONF_AFFINE);
@@ -918,7 +919,7 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	dpaa2_q->cb_eqresp_free = dpaa2_dev_free_eqresp_buf;
 	dev->data->tx_queues[tx_queue_id] = dpaa2_q;
 
-	if (priv->tx_conf_en) {
+	if (priv->flags & DPAA2_TX_CONF_ENABLE) {
 		dpaa2_q->tx_conf_queue = dpaa2_tx_conf_q;
 		options = options | DPNI_QUEUE_OPT_USER_CTX;
 		tx_conf_cfg.user_context = (size_t)(dpaa2_q);
@@ -2614,10 +2615,14 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 	priv->max_vlan_filters = attr.vlan_filter_entries;
 	priv->flags = 0;
 #if defined(RTE_LIBRTE_IEEE1588)
-	priv->tx_conf_en = 1;
-#else
-	priv->tx_conf_en = 0;
+	printf("DPDK IEEE1588 is enabled\n");
+	priv->flags |= DPAA2_TX_CONF_ENABLE;
 #endif
+	/* Used with ``fslmc:dpni.1,drv_tx_conf=1`` */
+	if (dpaa2_get_devargs(dev->devargs, DRIVER_TX_CONF)) {
+		priv->flags |= DPAA2_TX_CONF_ENABLE;
+		DPAA2_PMD_INFO("TX_CONF Enabled");
+	}
 
 	/* Allocate memory for hardware structure for queues */
 	ret = dpaa2_alloc_rx_tx_queues(eth_dev);
@@ -2650,7 +2655,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 
 	/* ... tx buffer layout ... */
 	memset(&layout, 0, sizeof(struct dpni_buffer_layout));
-	if (priv->tx_conf_en) {
+	if (priv->flags & DPAA2_TX_CONF_ENABLE) {
 		layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS |
 				 DPNI_BUF_LAYOUT_OPT_TIMESTAMP;
 		layout.pass_timestamp = true;
@@ -2667,13 +2672,11 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 
 	/* ... tx-conf and error buffer layout ... */
 	memset(&layout, 0, sizeof(struct dpni_buffer_layout));
-	if (priv->tx_conf_en) {
-		layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS |
-				 DPNI_BUF_LAYOUT_OPT_TIMESTAMP;
+	if (priv->flags & DPAA2_TX_CONF_ENABLE) {
+		layout.options = DPNI_BUF_LAYOUT_OPT_TIMESTAMP;
 		layout.pass_timestamp = true;
-	} else {
-		layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS;
 	}
+	layout.options |= DPNI_BUF_LAYOUT_OPT_FRAME_STATUS;
 	layout.pass_frame_status = 1;
 	ret = dpni_set_buffer_layout(dpni_dev, CMD_PRI_LOW, priv->token,
 				     DPNI_QUEUE_TX_CONFIRM, &layout);
@@ -2807,7 +2810,6 @@ rte_dpaa2_probe(struct rte_dpaa2_driver *dpaa2_drv,
 		eth_dev->data->dev_private = (void *)dev_priv;
 		/* Store a pointer to eth_dev in dev_private */
 		dev_priv->eth_dev = eth_dev;
-		dev_priv->tx_conf_en = 0;
 	} else {
 		eth_dev = rte_eth_dev_attach_secondary(dpaa2_dev->device.name);
 		if (!eth_dev) {
@@ -2860,5 +2862,6 @@ static struct rte_dpaa2_driver rte_dpaa2_pmd = {
 RTE_PMD_REGISTER_DPAA2(net_dpaa2, rte_dpaa2_pmd);
 RTE_PMD_REGISTER_PARAM_STRING(net_dpaa2,
 		DRIVER_LOOPBACK_MODE "=<int> "
-		DRIVER_NO_PREFETCH_MODE "=<int>");
+		DRIVER_NO_PREFETCH_MODE "=<int>"
+		DRIVER_TX_CONF "=<int>");
 RTE_LOG_REGISTER(dpaa2_logtype_pmd, pmd.net.dpaa2, NOTICE);
drivers/net/dpaa2/dpaa2_ethdev.h +3 -2
index 9837eb62c8..becdb50055 100644
@@ -60,6 +60,8 @@
 
 /* Disable RX tail drop, default is enable */
 #define DPAA2_RX_TAILDROP_OFF	0x04
+/* Tx confirmation enabled */
+#define DPAA2_TX_CONF_ENABLE	0x08
 
 #define DPAA2_RSS_OFFLOAD_ALL ( \
 	ETH_RSS_L2_PAYLOAD | \
@@ -152,14 +154,13 @@ struct dpaa2_dev_priv {
 	void *tx_vq[MAX_TX_QUEUES];
 	struct dpaa2_bp_list *bp_list; /**<Attached buffer pool list */
 	void *tx_conf_vq[MAX_TX_QUEUES];
-	uint8_t tx_conf_en;
+	uint8_t flags; /*dpaa2 config flags */
 	uint8_t max_mac_filters;
 	uint8_t max_vlan_filters;
 	uint8_t num_rx_tc;
 	uint16_t qos_entries;
 	uint16_t fs_entries;
 	uint8_t dist_queues;
-	uint8_t flags; /*dpaa2 config flags */
 	uint8_t en_ordered;
 	uint8_t en_loose_ordered;
 	uint8_t max_cgs;
Signature · 1 line
2.17.1
#29 lore raw

PATCH v2 14/20 net/dpaa2: optionally enable error queues

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

In case error packets are received by the ethernet interface, this patch enables the receival of packets on the error queue, printing the error and the error packet.

to enable, use the dev_arg as : fslmc:dpni.1,drv_error_queue=1

---
 doc/guides/nics/dpaa2.rst               |  7 ++
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |  1 +
 drivers/net/dpaa2/dpaa2_ethdev.c        | 67 +++++++++++++++--
 drivers/net/dpaa2/dpaa2_ethdev.h        |  5 +-
 drivers/net/dpaa2/dpaa2_rxtx.c          | 97 ++++++++++++++++++++++++-
 5 files changed, 169 insertions(+), 8 deletions(-)
doc/guides/nics/dpaa2.rst +7 -0
index 4eec8fcdd9..1e698bfbd8 100644
@@ -488,6 +488,13 @@ for details.
   In this mode tx conf queues need to be polled to free the buffers.
   e.g. ``fslmc:dpni.1,drv_tx_conf=1``
 
+* Use dev arg option  ``drv_error_queue=1`` to enable Packets in Error queue.
+  DPAA2 hardware drops the error packet in hardware. This option enables the
+  hardware to not drop the error packet and let the driver dump the error
+  packets, so that user can check what is wrong with those packets.
+   e.g. ``fslmc:dpni.1,drv_error_queue=1``
+
+
 Enabling logs
 -------------
 
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +1 -0
index 0f15750b6c..037c841ef5 100644
@@ -314,6 +314,7 @@ enum qbman_fd_format {
 #define DPAA2_GET_FD_FLC(fd) \
 	(((uint64_t)((fd)->simple.flc_hi) << 32) + (fd)->simple.flc_lo)
 #define DPAA2_GET_FD_ERR(fd)   ((fd)->simple.ctrl & 0x000000FF)
+#define DPAA2_GET_FD_FA_ERR(fd)   ((fd)->simple.ctrl & 0x00000040)
 #define DPAA2_GET_FLE_OFFSET(fle) (((fle)->fin_bpid_offset & 0x0FFF0000) >> 16)
 #define DPAA2_SET_FLE_SG_EXT(fle) ((fle)->fin_bpid_offset |= (uint64_t)1 << 29)
 #define DPAA2_IS_SET_FLE_SG_EXT(fle)	\
drivers/net/dpaa2/dpaa2_ethdev.c +62 -5

108 lines not on this page · raw message

drivers/net/dpaa2/dpaa2_ethdev.h +4 -1
index becdb50055..28341178e4 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2016-2020 NXP
+ *   Copyright 2016-2021 NXP
  *
  */
 
@@ -117,6 +117,8 @@ extern enum rte_filter_type dpaa2_filter_type;
 
 extern const struct rte_tm_ops dpaa2_tm_ops;
 
+extern bool dpaa2_enable_err_queue;
+
 #define IP_ADDRESS_OFFSET_INVALID (-1)
 
 struct dpaa2_key_info {
@@ -154,6 +156,7 @@ struct dpaa2_dev_priv {
 	void *tx_vq[MAX_TX_QUEUES];
 	struct dpaa2_bp_list *bp_list; /**<Attached buffer pool list */
 	void *tx_conf_vq[MAX_TX_QUEUES];
+	void *rx_err_vq;
 	uint8_t flags; /*dpaa2 config flags */
 	uint8_t max_mac_filters;
 	uint8_t max_vlan_filters;
drivers/net/dpaa2/dpaa2_rxtx.c +95 -2

122 lines not on this page · raw message

Signature · 1 line
2.17.1
#30 lore raw

PATCH v2 15/20 mempool/dpaa2: support stats for secondary process

In reply to Hemant Agrawal

DPAA2 DPBP object access need availability of MCP object pointer. In case of secondary process, we need to use local MCP pointer instead of primary process.

---
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +7 -1
index ca49a8d42a..bc146e4ce1 100644
@@ -393,6 +393,7 @@ rte_hw_mbuf_get_count(const struct rte_mempool *mp)
 	unsigned int num_of_bufs = 0;
 	struct dpaa2_bp_info *bp_info;
 	struct dpaa2_dpbp_dev *dpbp_node;
+	struct fsl_mc_io mc_io;
 
 	if (!mp || !mp->pool_data) {
 		DPAA2_MEMPOOL_ERR("Invalid mempool provided");
@@ -402,7 +403,12 @@ rte_hw_mbuf_get_count(const struct rte_mempool *mp)
 	bp_info = (struct dpaa2_bp_info *)mp->pool_data;
 	dpbp_node = bp_info->bp_list->buf_pool.dpbp_node;
 
-	ret = dpbp_get_num_free_bufs(&dpbp_node->dpbp, CMD_PRI_LOW,
+	/* In case as secondary process access stats, MCP portal in priv-hw may
+	 * have primary process address. Need the secondary process based MCP
+	 * portal address for this object.
+	 */
+	mc_io.regs = dpaa2_get_mcp_ptr(MC_PORTAL_INDEX);
+	ret = dpbp_get_num_free_bufs(&mc_io, CMD_PRI_LOW,
 				     dpbp_node->token, &num_of_bufs);
 	if (ret) {
 		DPAA2_MEMPOOL_ERR("Unable to obtain free buf count (err=%d)",
Signature · 1 line
2.17.1
#31 lore raw

PATCH v2 16/20 net/dpaa: do not release the cgr ranges

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

CGR are automatically freed up in the kernel. As we do not cleanup the queues, if we release the CGR here, kernel reports them in use. So have them freed up in the kernel

---
 drivers/net/dpaa/dpaa_ethdev.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/net/dpaa/dpaa_ethdev.c +0 -6
index c59873dd8a..0996edf9a9 100644
@@ -486,9 +486,6 @@ static int dpaa_eth_dev_close(struct rte_eth_dev *dev)
 	if (dpaa_intf->cgr_rx) {
 		for (loop = 0; loop < dpaa_intf->nb_rx_queues; loop++)
 			qman_delete_cgr(&dpaa_intf->cgr_rx[loop]);
-
-		qman_release_cgrid_range(dpaa_intf->cgr_rx[loop].cgrid,
-					 dpaa_intf->nb_rx_queues);
 	}
 
 	rte_free(dpaa_intf->cgr_rx);
@@ -497,9 +494,6 @@ static int dpaa_eth_dev_close(struct rte_eth_dev *dev)
 	if (dpaa_intf->cgr_tx) {
 		for (loop = 0; loop < MAX_DPAA_CORES; loop++)
 			qman_delete_cgr(&dpaa_intf->cgr_tx[loop]);
-
-		qman_release_cgrid_range(dpaa_intf->cgr_tx[loop].cgrid,
-					 MAX_DPAA_CORES);
 		rte_free(dpaa_intf->cgr_tx);
 		dpaa_intf->cgr_tx = NULL;
 	}
Signature · 1 line
2.17.1
#32 lore raw

PATCH v2 17/20 net/dpaa: prevent multiple mp config on an device

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

The current driver only support single buffer pool on a given pmd instance. return error, if trying to configure more.

---
 drivers/mempool/dpaa/dpaa_mempool.c | 1 +
 drivers/net/dpaa/dpaa_ethdev.c      | 6 ++++++
 2 files changed, 7 insertions(+)
drivers/mempool/dpaa/dpaa_mempool.c +1 -0
index e6b06f0575..1ee7ffb647 100644
@@ -134,6 +134,7 @@ dpaa_mbuf_free_pool(struct rte_mempool *mp)
 		DPAA_MEMPOOL_INFO("BMAN pool freed for bpid =%d",
 				  bp_info->bpid);
 		rte_free(mp->pool_data);
+		bp_info->bp = NULL;
 		mp->pool_data = NULL;
 	}
 }
drivers/net/dpaa/dpaa_ethdev.c +6 -0
index 0996edf9a9..a3a3e7cb24 100644
@@ -969,6 +969,12 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 		}
 	}
 
+	if (dpaa_intf->bp_info && dpaa_intf->bp_info->bp &&
+	    dpaa_intf->bp_info->mp != mp) {
+		DPAA_PMD_WARN("Multiple pools on same interface not supported");
+		return -EINVAL;
+	}
+
 	/* Max packet can fit in single buffer */
 	if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= buffsz) {
 		;
Signature · 1 line
2.17.1
#33 lore raw

PATCH v2 18/20 bus/dpaa: secondary process init support

In reply to Hemant Agrawal

Secondary process also need the access the qman and bman ccsr map.

---
 drivers/bus/dpaa/dpaa_bus.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)
drivers/bus/dpaa/dpaa_bus.c +12 -14
index 662cbfaae5..37cf55d60b 100644
@@ -582,20 +582,18 @@ rte_dpaa_bus_probe(void)
 	/* Device list creation is only done once */
 	if (!process_once) {
 		rte_dpaa_bus_dev_build();
-		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-			/* One time load of Qman/Bman drivers */
-			ret = qman_global_init();
-			if (ret) {
-				DPAA_BUS_ERR("QMAN initialization failed: %d",
-					     ret);
-				return ret;
-			}
-			ret = bman_global_init();
-			if (ret) {
-				DPAA_BUS_ERR("BMAN initialization failed: %d",
-					     ret);
-				return ret;
-			}
+		/* One time load of Qman/Bman drivers */
+		ret = qman_global_init();
+		if (ret) {
+			DPAA_BUS_ERR("QMAN initialization failed: %d",
+				     ret);
+			return ret;
+		}
+		ret = bman_global_init();
+		if (ret) {
+			DPAA_BUS_ERR("BMAN initialization failed: %d",
+				     ret);
+			return ret;
 		}
 	}
 	process_once = 1;
Signature · 1 line
2.17.1
#34 lore raw

PATCH v2 19/20 bus/dpaa: support shared ethernet MAC interface

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

DPAA can share an interface on classification criteria with kernel.

This patch enables default kernel driver to be used as a shared MAC interface with DPDK interface. (provided that VSP is enabled on that interface.)

---
 drivers/bus/dpaa/base/fman/fman.c | 149 +++++++++++++++++++++---------
 1 file changed, 105 insertions(+), 44 deletions(-)
drivers/bus/dpaa/base/fman/fman.c +105 -44
index 39102bc1f3..692071b4b0 100644
@@ -211,12 +211,16 @@ fman_if_init(const struct device_node *dpa_node)
 	const phandle *mac_phandle, *ports_phandle, *pools_phandle;
 	const phandle *tx_channel_id = NULL, *mac_addr, *cell_idx;
 	const phandle *rx_phandle, *tx_phandle;
+	const phandle *port_cell_idx, *ext_args_cell_idx;
+	const struct device_node *parent_node_ext_args;
 	uint64_t tx_phandle_host[4] = {0};
 	uint64_t rx_phandle_host[4] = {0};
 	uint64_t regs_addr_host = 0;
 	uint64_t cell_idx_host = 0;
+	uint64_t port_cell_idx_val = 0;
+	uint64_t ext_args_cell_idx_val = 0;
 
-	const struct device_node *mac_node = NULL, *tx_node;
+	const struct device_node *mac_node = NULL, *tx_node, *ext_args_node;
 	const struct device_node *pool_node, *fman_node, *rx_node;
 	const uint32_t *regs_addr = NULL;
 	const char *mname, *fname;
@@ -230,16 +234,112 @@ fman_if_init(const struct device_node *dpa_node)
 		return 0;
 
 	if (!of_device_is_compatible(dpa_node, "fsl,dpa-ethernet-init") &&
-		!of_device_is_compatible(dpa_node, "fsl,dpa-ethernet-shared")) {
+		!of_device_is_compatible(dpa_node, "fsl,dpa-ethernet")) {
 		return 0;
 	}
 
-	if (of_device_is_compatible(dpa_node, "fsl,dpa-ethernet-shared"))
-		is_shared = 1;
-
 	rprop = "fsl,qman-frame-queues-rx";
 	mprop = "fsl,fman-mac";
 
+	/* Obtain the MAC node used by this interface except macless */
+	mac_phandle = of_get_property(dpa_node, mprop, &lenp);
+	if (!mac_phandle) {
+		FMAN_ERR(-EINVAL, "%s: no %s\n", dname, mprop);
+		return -EINVAL;
+	}
+	assert(lenp == sizeof(phandle));
+	mac_node = of_find_node_by_phandle(*mac_phandle);
+	if (!mac_node) {
+		FMAN_ERR(-ENXIO, "%s: bad 'fsl,fman-mac\n", dname);
+		return -ENXIO;
+	}
+	mname = mac_node->full_name;
+
+	/* Extract the Rx and Tx ports */
+	ports_phandle = of_get_property(mac_node, "fsl,port-handles",
+					&lenp);
+	if (!ports_phandle)
+		ports_phandle = of_get_property(mac_node, "fsl,fman-ports",
+						&lenp);
+	if (!ports_phandle) {
+		FMAN_ERR(-EINVAL, "%s: no fsl,port-handles\n",
+			 mname);
+		return -EINVAL;
+	}
+	assert(lenp == (2 * sizeof(phandle)));
+	rx_node = of_find_node_by_phandle(ports_phandle[0]);
+	if (!rx_node) {
+		FMAN_ERR(-ENXIO, "%s: bad fsl,port-handle[0]\n", mname);
+		return -ENXIO;
+	}
+	tx_node = of_find_node_by_phandle(ports_phandle[1]);
+	if (!tx_node) {
+		FMAN_ERR(-ENXIO, "%s: bad fsl,port-handle[1]\n", mname);
+		return -ENXIO;
+	}
+
+	/* Check if the port is shared interface */
+	if (of_device_is_compatible(dpa_node, "fsl,dpa-ethernet")) {
+		port_cell_idx = of_get_property(rx_node, "cell-index", &lenp);
+		if (!port_cell_idx) {
+			FMAN_ERR(-ENXIO,
+				 "%s: no cell-index for port\n", mname);
+			return -ENXIO;
+		}
+		assert(lenp == sizeof(*port_cell_idx));
+		port_cell_idx_val =
+			of_read_number(port_cell_idx, lenp / sizeof(phandle));
+
+		if (of_device_is_compatible(rx_node, "fsl,fman-port-1g-rx"))
+			port_cell_idx_val -= 0x8;
+		else if (of_device_is_compatible(
+				rx_node, "fsl,fman-port-10g-rx"))
+			port_cell_idx_val -= 0x10;
+
+		parent_node_ext_args = of_find_compatible_node(NULL,
+			NULL, "fsl,fman-extended-args");
+		if (!parent_node_ext_args)
+			return 0;
+
+		for_each_child_node(parent_node_ext_args, ext_args_node) {
+			ext_args_cell_idx = of_get_property(ext_args_node,
+				"cell-index", &lenp);
+			if (!ext_args_cell_idx) {
+				FMAN_ERR(-ENXIO,
+					 "%s: no cell-index for ext args\n",
+					 mname);
+				return -ENXIO;
+			}
+			assert(lenp == sizeof(*ext_args_cell_idx));
+			ext_args_cell_idx_val =
+				of_read_number(ext_args_cell_idx, lenp /
+				sizeof(phandle));
+
+			if (port_cell_idx_val == ext_args_cell_idx_val) {
+				if (of_device_is_compatible(ext_args_node,
+					"fsl,fman-port-1g-rx-extended-args") &&
+					of_device_is_compatible(rx_node,
+					"fsl,fman-port-1g-rx")) {
+					if (of_get_property(ext_args_node,
+						"vsp-window", &lenp))
+						is_shared = 1;
+					break;
+				}
+				if (of_device_is_compatible(ext_args_node,
+					"fsl,fman-port-10g-rx-extended-args") &&
+					of_device_is_compatible(rx_node,
+					"fsl,fman-port-10g-rx")) {
+					if (of_get_property(ext_args_node,
+						"vsp-window", &lenp))
+						is_shared = 1;
+					break;
+				}
+			}
+		}
+		if (!is_shared)
+			return 0;
+	}
+
 	/* Allocate an object for this network interface */
 	__if = rte_malloc(NULL, sizeof(*__if), RTE_CACHE_LINE_SIZE);
 	if (!__if) {
@@ -253,20 +353,6 @@ fman_if_init(const struct device_node *dpa_node)
 	strlcpy(__if->node_path, dpa_node->full_name, PATH_MAX - 1);
 	__if->node_path[PATH_MAX - 1] = '\0';
 
-	/* Obtain the MAC node used by this interface except macless */
-	mac_phandle = of_get_property(dpa_node, mprop, &lenp);
-	if (!mac_phandle) {
-		FMAN_ERR(-EINVAL, "%s: no %s\n", dname, mprop);
-		goto err;
-	}
-	assert(lenp == sizeof(phandle));
-	mac_node = of_find_node_by_phandle(*mac_phandle);
-	if (!mac_node) {
-		FMAN_ERR(-ENXIO, "%s: bad 'fsl,fman-mac\n", dname);
-		goto err;
-	}
-	mname = mac_node->full_name;
-
 	/* Map the CCSR regs for the MAC node */
 	regs_addr = of_get_address(mac_node, 0, &__if->regs_size, NULL);
 	if (!regs_addr) {
@@ -290,7 +376,6 @@ fman_if_init(const struct device_node *dpa_node)
 	/* Get rid of endianness (issues). Convert to host byte order */
 	regs_addr_host = of_read_number(regs_addr, na);
 
-
 	/* Get the index of the Fman this i/f belongs to */
 	fman_node = of_get_parent(mac_node);
 	na = of_n_addr_cells(mac_node);
@@ -384,25 +469,6 @@ fman_if_init(const struct device_node *dpa_node)
 	}
 	memcpy(&__if->__if.mac_addr, mac_addr, ETHER_ADDR_LEN);
 
-	/* Extract the Tx port (it's the second of the two port handles)
-	 * and get its channel ID
-	 */
-	ports_phandle = of_get_property(mac_node, "fsl,port-handles",
-					&lenp);
-	if (!ports_phandle)
-		ports_phandle = of_get_property(mac_node, "fsl,fman-ports",
-						&lenp);
-	if (!ports_phandle) {
-		FMAN_ERR(-EINVAL, "%s: no fsl,port-handles\n",
-			 mname);
-		goto err;
-	}
-	assert(lenp == (2 * sizeof(phandle)));
-	tx_node = of_find_node_by_phandle(ports_phandle[1]);
-	if (!tx_node) {
-		FMAN_ERR(-ENXIO, "%s: bad fsl,port-handle[1]\n", mname);
-		goto err;
-	}
 	/* Extract the channel ID (from tx-port-handle) */
 	tx_channel_id = of_get_property(tx_node, "fsl,qman-channel-id",
 					&lenp);
@@ -412,11 +478,6 @@ fman_if_init(const struct device_node *dpa_node)
 		goto err;
 	}
 
-	rx_node = of_find_node_by_phandle(ports_phandle[0]);
-	if (!rx_node) {
-		FMAN_ERR(-ENXIO, "%s: bad fsl,port-handle[0]\n", mname);
-		goto err;
-	}
 	regs_addr = of_get_address(rx_node, 0, &__if->regs_size, NULL);
 	if (!regs_addr) {
 		FMAN_ERR(-EINVAL, "of_get_address(%s)\n", mname);
Signature · 1 line
2.17.1
#35 lore raw

PATCH v2 20/20 bus/dpaa: enhance checks for bus and device detection

In reply to Hemant Agrawal

1. It is not a error if no network device available. One can only use crypto device
2. Improve logging for failure in detecting the bus

---
 drivers/bus/dpaa/dpaa_bus.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/bus/dpaa/dpaa_bus.c +5 -3
index 37cf55d60b..173041c026 100644
@@ -521,16 +521,18 @@ rte_dpaa_bus_dev_build(void)
 	/* Get the interface configurations from device-tree */
 	dpaa_netcfg = netcfg_acquire();
 	if (!dpaa_netcfg) {
-		DPAA_BUS_LOG(ERR, "netcfg_acquire failed");
+		DPAA_BUS_LOG(ERR,
+			"netcfg failed: /dev/fsl_usdpaa device not available");
+		DPAA_BUS_WARN(
+			"Check if you are using USDPAA based device tree");
 		return -EINVAL;
 	}
 
 	RTE_LOG(NOTICE, EAL, "DPAA Bus Detected\n");
 
 	if (!dpaa_netcfg->num_ethports) {
-		DPAA_BUS_LOG(INFO, "no network interfaces available");
+		DPAA_BUS_LOG(INFO, "NO DPDK mapped net interfaces available");
 		/* This is not an error */
-		return 0;
 	}
 
 #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER
Signature · 1 line
2.17.1
#36 lore raw

v3 cover NXP DPAAx ethernet PMD changes

In reply to Hemant Agrawal

This patch series adds changes to dpaaX ethernet pmd

1. Basic Traffic Management support for shaper and scheduler
2. Support external buffer in Transmit side.
3. Optimize the SG packet handling
4. Add support APIs in DPDMUX (SRIOV equivalent for DPAA2)
5. Fix isssues

v3: fix spelling issues, add rx buf size support
v2: add more patches and add TM documentation

Akhil Goyal (1):
net/dpaa2: add support for raw pattern in dpdmux

Apeksha Gupta (1):
net/dpaa2: dpdmux skip reset

Gagandeep Singh (1):
net/dpaa2: add traffic management driver

Hemant Agrawal (11):
net/dpaa2: allocate SGT table from first segment net/dpaa: support external buffers in Tx net/dpaa2: add support to configure dpdmux max Rx frame len net/dpaa2: support dpdmux to not drop parse err pkts net/dpaa2: add device args for enable Tx confirmation net/dpaa2: change Tx queue congestion settings mempool/dpaa2: support stats for secondary process bus/dpaa: secondary process init support bus/dpaa: enhance checks for bus and device detection net/dpaa2: add Rx buf size support
net/dpaa: add Rx buf size support

Nipun Gupta (6):
bus/dpaa: fix statistics reading net/dpaa2: support external buffers in Tx net/dpaa2: optionally enable error queues net/dpaa: do not release the cgr ranges net/dpaa: prevent multiple mp config on an device bus/dpaa: support shared ethernet MAC interface

Rohit Raj (2):
net/dpaa2: fix link get API implementation
net/dpaa: fix link get API implementation

Youri Querry (1):
bus/fslmc: fix to use ci value for qbman 5.0

 doc/guides/nics/dpaa2.rst                | 130 ++++-
 drivers/bus/dpaa/base/fman/fman.c        | 149 ++++--
 drivers/bus/dpaa/base/fman/fman_hw.c     |  33 +-
 drivers/bus/dpaa/dpaa_bus.c              |  34 +-
 drivers/bus/dpaa/include/fsl_fman.h      |   1 +
 drivers/bus/dpaa/version.map             |   1 +
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h  |   6 +
 drivers/bus/fslmc/qbman/qbman_portal.c   |  14 +-
 drivers/mempool/dpaa/dpaa_mempool.c      |   1 +
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c |   8 +-
 drivers/net/dpaa/dpaa_ethdev.c           |  39 +-
 drivers/net/dpaa/dpaa_rxtx.c             |  39 +-
 drivers/net/dpaa/dpaa_rxtx.h             |   8 +-
 drivers/net/dpaa2/dpaa2_ethdev.c         | 145 +++++-
 drivers/net/dpaa2/dpaa2_ethdev.h         |  15 +-
 drivers/net/dpaa2/dpaa2_mux.c            | 111 +++-
 drivers/net/dpaa2/dpaa2_rxtx.c           | 204 +++++++-
 drivers/net/dpaa2/dpaa2_tm.c             | 630 +++++++++++++++++++++++
 drivers/net/dpaa2/dpaa2_tm.h             |  32 ++
 drivers/net/dpaa2/mc/dpdmux.c            | 124 ++++-
 drivers/net/dpaa2/mc/dpni.c              | 313 ++++++++++-
 drivers/net/dpaa2/mc/fsl_dpdmux.h        | 157 +++++-
 drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h    |  51 +-
 drivers/net/dpaa2/mc/fsl_dpni.h          | 210 +++++++-
 drivers/net/dpaa2/mc/fsl_dpni_cmd.h      |  59 ++-
 drivers/net/dpaa2/meson.build            |   3 +-
 drivers/net/dpaa2/rte_pmd_dpaa2.h        |  18 +-
 drivers/net/dpaa2/version.map            |   1 +
 28 files changed, 2342 insertions(+), 194 deletions(-)
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.c
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.h
Signature · 1 line
2.17.1
#37 lore raw

PATCH v3 1/23 bus/fslmc: fix to use ci value for qbman 5.0

From: Youri Querry <[email protected]>

Random portal hangs observed on device with QBMAN 5.0

This fixes few random packet hang issues in event mode. Few things fixed it.
1. Generally, pi == ci, no need for extra checks.
2. The proper initializations in init with ci

Fixes 1b49352f41be ("bus/fslmc: rename portal pi index to consumer index")
---
 drivers/bus/fslmc/qbman/qbman_portal.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/bus/fslmc/qbman/qbman_portal.c +3 -11
index 77c9d508c4..aedcad9258 100644
@@ -339,17 +339,9 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d)
 	eqcr_pi = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI);
 	p->eqcr.pi = eqcr_pi & p->eqcr.pi_ci_mask;
 	p->eqcr.pi_vb = eqcr_pi & QB_VALID_BIT;
-	if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000
-			&& (d->cena_access_mode == qman_cena_fastest_access))
-		p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI)
-					     & p->eqcr.pi_ci_mask;
-	else
-		p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI)
-					     & p->eqcr.pi_ci_mask;
-	p->eqcr.available = p->eqcr.pi_ring_size -
-				qm_cyc_diff(p->eqcr.pi_ring_size,
-				p->eqcr.ci & (p->eqcr.pi_ci_mask<<1),
-				p->eqcr.pi & (p->eqcr.pi_ci_mask<<1));
+	p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI)
+			& p->eqcr.pi_ci_mask;
+	p->eqcr.available = p->eqcr.pi_ring_size;
 
 	portal_idx_map[p->desc.idx] = p;
 	return p;
Signature · 1 line
2.17.1
#38 lore raw

PATCH v3 2/23 bus/dpaa: fix statistics reading

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

Reading of word un-aligned values after reading word aligned values lead to corrution of memory, such that older value. This patch make changes such that word alignedaccess is made, before making an un-aligned access

Fixes 6d6b4f49a155 ("bus/dpaa: add FMAN hardware operations")
---
 drivers/bus/dpaa/base/fman/fman_hw.c | 33 ++++++++++++++--------------
 1 file changed, 16 insertions(+), 17 deletions(-)
drivers/bus/dpaa/base/fman/fman_hw.c +16 -17
index 4ab49f7853..af9bac76c2 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
- * Copyright 2017 NXP
+ * Copyright 2017,2020 NXP
  *
  */
 
@@ -219,20 +219,20 @@ fman_if_stats_get(struct fman_if *p, struct rte_eth_stats *stats)
 	struct memac_regs *regs = m->ccsr_map;
 
 	/* read recved packet count */
-	stats->ipackets = ((u64)in_be32(&regs->rfrm_u)) << 32 |
-			in_be32(&regs->rfrm_l);
-	stats->ibytes = ((u64)in_be32(&regs->roct_u)) << 32 |
-			in_be32(&regs->roct_l);
-	stats->ierrors = ((u64)in_be32(&regs->rerr_u)) << 32 |
-			in_be32(&regs->rerr_l);
+	stats->ipackets = (u64)in_be32(&regs->rfrm_l) |
+			((u64)in_be32(&regs->rfrm_u)) << 32;
+	stats->ibytes = (u64)in_be32(&regs->roct_l) |
+			((u64)in_be32(&regs->roct_u)) << 32;
+	stats->ierrors = (u64)in_be32(&regs->rerr_l) |
+			((u64)in_be32(&regs->rerr_u)) << 32;
 
 	/* read xmited packet count */
-	stats->opackets = ((u64)in_be32(&regs->tfrm_u)) << 32 |
-			in_be32(&regs->tfrm_l);
-	stats->obytes = ((u64)in_be32(&regs->toct_u)) << 32 |
-			in_be32(&regs->toct_l);
-	stats->oerrors = ((u64)in_be32(&regs->terr_u)) << 32 |
-			in_be32(&regs->terr_l);
+	stats->opackets = (u64)in_be32(&regs->tfrm_l) |
+			((u64)in_be32(&regs->tfrm_u)) << 32;
+	stats->obytes = (u64)in_be32(&regs->toct_l) |
+			((u64)in_be32(&regs->toct_u)) << 32;
+	stats->oerrors = (u64)in_be32(&regs->terr_l) |
+			((u64)in_be32(&regs->terr_u)) << 32;
 }
 
 void
@@ -244,10 +244,9 @@ fman_if_stats_get_all(struct fman_if *p, uint64_t *value, int n)
 	uint64_t base_offset = offsetof(struct memac_regs, reoct_l);
 
 	for (i = 0; i < n; i++)
-		value[i] = ((u64)in_be32((char *)regs
-				+ base_offset + 8 * i + 4)) << 32 |
-				((u64)in_be32((char *)regs
-				+ base_offset + 8 * i));
+		value[i] = (((u64)in_be32((char *)regs + base_offset + 8 * i) |
+				(u64)in_be32((char *)regs + base_offset +
+				8 * i + 4)) << 32);
 }
 
 void
Signature · 1 line
2.17.1
#39 lore raw

PATCH v3 3/23 net/dpaa2: fix link get API implementation

In reply to Hemant Agrawal

From: Rohit Raj <[email protected]>

According to DPDK Documentation, rte_eth_link_get API can wait up to 9 seconds for auto-negotiation to finish and then returns link status.

In current implementation of rte_eth_link_get API in DPAA2 drivers, it was not waiting for auto negotiation to finish and was returning link status DOWN
It can cause issues with DPDK applications which relies on rte_eth_link_get API for link status and does not support link status interrupt.
Similar kind of issue was seen in TRex Application.

This patch fixes this bug by adding wait for up to 9 seconds for auto negotiation to finish.

Fixes c56c86ff87c1 ("net/dpaa2: update link status")
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +16 -5
index 38774e255b..a81c73438e 100644
@@ -31,6 +31,8 @@
 
 #define DRIVER_LOOPBACK_MODE "drv_loopback"
 #define DRIVER_NO_PREFETCH_MODE "drv_no_prefetch"
+#define CHECK_INTERVAL         100  /* 100ms */
+#define MAX_REPEAT_TIME        90   /* 9s (90 * 100ms) in total */
 
 /* Supported Rx offloads */
 static uint64_t dev_rx_offloads_sup =
@@ -1805,23 +1807,32 @@ dpaa2_dev_stats_reset(struct rte_eth_dev *dev)
 /* return 0 means link status changed, -1 means not changed */
 static int
 dpaa2_dev_link_update(struct rte_eth_dev *dev,
-			int wait_to_complete __rte_unused)
+		      int wait_to_complete)
 {
 	int ret;
 	struct dpaa2_dev_priv *priv = dev->data->dev_private;
 	struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
 	struct rte_eth_link link;
 	struct dpni_link_state state = {0};
+	uint8_t count;
 
 	if (dpni == NULL) {
 		DPAA2_PMD_ERR("dpni is NULL");
 		return 0;
 	}
 
-	ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, &state);
-	if (ret < 0) {
-		DPAA2_PMD_DEBUG("error: dpni_get_link_state %d", ret);
-		return -1;
+	for (count = 0; count <= MAX_REPEAT_TIME; count++) {
+		ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token,
+					  &state);
+		if (ret < 0) {
+			DPAA2_PMD_DEBUG("error: dpni_get_link_state %d", ret);
+			return -1;
+		}
+		if (state.up == ETH_LINK_DOWN &&
+		    wait_to_complete)
+			rte_delay_ms(CHECK_INTERVAL);
+		else
+			break;
 	}
 
 	memset(&link, 0, sizeof(struct rte_eth_link));
Signature · 1 line
2.17.1
#40 lore raw

PATCH v3 4/23 net/dpaa: fix link get API implementation

In reply to Hemant Agrawal

From: Rohit Raj <[email protected]>

According to DPDK Documentation, rte_eth_link_get API can wait up to 9 seconds for auto-negotiation to finish and then returns link status.

In current implementation of rte_eth_link_get API in DPAA drivers, it was not waiting for auto negotiation to finish and was returning link status DOWN
It can cause issues with DPDK applications which relies
on rte_eth_link_get API for link statusand does not support link status interrupt.

This patch fixes this bug by adding wait for up to 9 seconds for auto negotiation to finish.

Fixes 2aa10990a8dd ("bus/dpaa: enable link state interrupt")
---
 drivers/net/dpaa/dpaa_ethdev.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
drivers/net/dpaa/dpaa_ethdev.c +15 -5
index d643514de6..c59873dd8a 100644
@@ -49,6 +49,9 @@
 #include <process.h>
 #include <fmlib/fm_ext.h>
 
+#define CHECK_INTERVAL         100  /* 100ms */
+#define MAX_REPEAT_TIME        90   /* 9s (90 * 100ms) in total */
+
 /* Supported Rx offloads */
 static uint64_t dev_rx_offloads_sup =
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
@@ -669,23 +672,30 @@ dpaa_dev_tx_burst_mode_get(struct rte_eth_dev *dev,
 }
 
 static int dpaa_eth_link_update(struct rte_eth_dev *dev,
-				int wait_to_complete __rte_unused)
+				int wait_to_complete)
 {
 	struct dpaa_if *dpaa_intf = dev->data->dev_private;
 	struct rte_eth_link *link = &dev->data->dev_link;
 	struct fman_if *fif = dev->process_private;
 	struct __fman_if *__fif = container_of(fif, struct __fman_if, __if);
 	int ret, ioctl_version;
+	uint8_t count;
 
 	PMD_INIT_FUNC_TRACE();
 
 	ioctl_version = dpaa_get_ioctl_version_number();
 
-
 	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
-		ret = dpaa_get_link_status(__fif->node_name, link);
-		if (ret)
-			return ret;
+		for (count = 0; count <= MAX_REPEAT_TIME; count++) {
+			ret = dpaa_get_link_status(__fif->node_name, link);
+			if (ret)
+				return ret;
+			if (link->link_status == ETH_LINK_DOWN &&
+			    wait_to_complete)
+				rte_delay_ms(CHECK_INTERVAL);
+			else
+				break;
+		}
 	} else {
 		link->link_status = dpaa_intf->valid;
 	}
Signature · 1 line
2.17.1
#41 lore raw

PATCH v3 5/23 net/dpaa2: allocate SGT table from first segment

In reply to Hemant Agrawal

This patch enables support to use the first segment headroom to build the HW required Scatter Gather Table. (if space is available).
This will avoid 1 less buffer for SG buffer creation.

---
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |  5 ++
 drivers/net/dpaa2/dpaa2_rxtx.c          | 65 +++++++++++++++++++------
 2 files changed, 54 insertions(+), 16 deletions(-)
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +5 -0
index ac24f01451..0f15750b6c 100644
@@ -330,6 +330,11 @@ enum qbman_fd_format {
 } while (0)
 #define DPAA2_FD_GET_FORMAT(fd)	(((fd)->simple.bpid_offset >> 28) & 0x3)
 
+#define DPAA2_SG_SET_FORMAT(sg, format)	do {				\
+		(sg)->fin_bpid_offset &= 0xCFFFFFFF;			\
+		(sg)->fin_bpid_offset |= (uint32_t)format << 28;	\
+} while (0)
+
 #define DPAA2_SG_SET_FINAL(sg, fin)	do {				\
 		(sg)->fin_bpid_offset &= 0x7FFFFFFF;			\
 		(sg)->fin_bpid_offset |= (uint32_t)fin << 31;		\
drivers/net/dpaa2/dpaa2_rxtx.c +49 -16

109 lines not on this page · raw message

Signature · 1 line
2.17.1
#42 lore raw

PATCH v3 6/23 net/dpaa2: support external buffers in Tx

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

This patch support tx of external allocated buffers.

---
 drivers/net/dpaa2/dpaa2_rxtx.c | 42 ++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
drivers/net/dpaa2/dpaa2_rxtx.c +42 -0
index c11ed0ee61..7deba3aed3 100644
@@ -450,6 +450,9 @@ eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 				}
 			}
 			cur_seg = cur_seg->next;
+		} else if (RTE_MBUF_HAS_EXTBUF(cur_seg)) {
+			DPAA2_SET_FLE_IVP(sge);
+			cur_seg = cur_seg->next;
 		} else {
 			/* Get owner MBUF from indirect buffer */
 			mi = rte_mbuf_from_indirect(cur_seg);
@@ -494,6 +497,8 @@ eth_mbuf_to_fd(struct rte_mbuf *mbuf,
 			DPAA2_SET_FD_IVP(fd);
 			rte_mbuf_refcnt_update(mbuf, -1);
 		}
+	} else if (RTE_MBUF_HAS_EXTBUF(mbuf)) {
+		DPAA2_SET_FD_IVP(fd);
 	} else {
 		struct rte_mbuf *mi;
 
@@ -1065,6 +1070,7 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;
 	struct dpaa2_dev_priv *priv = eth_data->dev_private;
 	uint32_t flags[MAX_TX_RING_SLOTS] = {0};
+	struct rte_mbuf **orig_bufs = bufs;
 
 	if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
 		ret = dpaa2_affine_qbman_swp();
@@ -1148,6 +1154,24 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 				mi = rte_mbuf_from_indirect(*bufs);
 				mp = mi->pool;
 			}
+
+			if (unlikely(RTE_MBUF_HAS_EXTBUF(*bufs))) {
+				if (unlikely((*bufs)->nb_segs > 1)) {
+					if (eth_mbuf_to_sg_fd(*bufs,
+							      &fd_arr[loop],
+							      mp, 0))
+						goto send_n_return;
+				} else {
+					eth_mbuf_to_fd(*bufs,
+						       &fd_arr[loop], 0);
+				}
+				bufs++;
+#ifdef RTE_LIBRTE_IEEE1588
+				enable_tx_tstamp(&fd_arr[loop]);
+#endif
+				continue;
+			}
+
 			/* Not a hw_pkt pool allocated frame */
 			if (unlikely(!mp || !priv->bp_list)) {
 				DPAA2_PMD_ERR("Err: No buffer pool attached");
@@ -1220,6 +1244,15 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		nb_pkts -= loop;
 	}
 	dpaa2_q->tx_pkts += num_tx;
+
+	loop = 0;
+	while (loop < num_tx) {
+		if (unlikely(RTE_MBUF_HAS_EXTBUF(*orig_bufs)))
+			rte_pktmbuf_free(*orig_bufs);
+		orig_bufs++;
+		loop++;
+	}
+
 	return num_tx;
 
 send_n_return:
@@ -1246,6 +1279,15 @@ dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	}
 skip_tx:
 	dpaa2_q->tx_pkts += num_tx;
+
+	loop = 0;
+	while (loop < num_tx) {
+		if (unlikely(RTE_MBUF_HAS_EXTBUF(*orig_bufs)))
+			rte_pktmbuf_free(*orig_bufs);
+		orig_bufs++;
+		loop++;
+	}
+
 	return num_tx;
 }
 
Signature · 1 line
2.17.1
#43 lore raw

PATCH v3 7/23 net/dpaa: support external buffers in Tx

In reply to Hemant Agrawal

This patch support tx of external buffers

---
 drivers/net/dpaa/dpaa_rxtx.c | 39 +++++++++++++++++++++++++++---------
 drivers/net/dpaa/dpaa_rxtx.h |  8 +-------
 2 files changed, 31 insertions(+), 16 deletions(-)
drivers/net/dpaa/dpaa_rxtx.c +30 -9
index e38fba23c0..423de40e95 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2017,2019 NXP
+ *   Copyright 2017,2019-2021 NXP
  *
  */
 
@@ -334,7 +334,7 @@ dpaa_unsegmented_checksum(struct rte_mbuf *mbuf, struct qm_fd *fd_arr)
 	}
 }
 
-struct rte_mbuf *
+static struct rte_mbuf *
 dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid)
 {
 	struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid);
@@ -791,13 +791,12 @@ uint16_t dpaa_eth_queue_rx(void *q,
 	return num_rx;
 }
 
-int
+static int
 dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 		struct qm_fd *fd,
-		uint32_t bpid)
+		struct dpaa_bp_info *bp_info)
 {
 	struct rte_mbuf *cur_seg = mbuf, *prev_seg = NULL;
-	struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(bpid);
 	struct rte_mbuf *temp, *mi;
 	struct qm_sg_entry *sg_temp, *sgt;
 	int i = 0;
@@ -840,7 +839,7 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 	fd->format = QM_FD_SG;
 	fd->addr = temp->buf_iova;
 	fd->offset = temp->data_off;
-	fd->bpid = bpid;
+	fd->bpid = bp_info ? bp_info->bpid : 0xff;
 	fd->length20 = mbuf->pkt_len;
 
 	while (i < DPAA_SGT_MAX_ENTRIES) {
@@ -862,6 +861,9 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 					DPAA_MEMPOOL_TO_BPID(cur_seg->pool);
 			}
 			cur_seg = cur_seg->next;
+		} else if (RTE_MBUF_HAS_EXTBUF(cur_seg)) {
+			sg_temp->bpid = 0xff;
+			cur_seg = cur_seg->next;
 		} else {
 			/* Get owner MBUF from indirect buffer */
 			mi = rte_mbuf_from_indirect(cur_seg);
@@ -911,6 +913,9 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf,
 			 */
 			DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, bp_info->bpid);
 		}
+	} else if (RTE_MBUF_HAS_EXTBUF(mbuf)) {
+		DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr,
+				bp_info ? bp_info->bpid : 0xff);
 	} else {
 		/* This is data-containing core mbuf: 'mi' */
 		mi = rte_mbuf_from_indirect(mbuf);
@@ -929,7 +934,8 @@ tx_on_dpaa_pool_unsegmented(struct rte_mbuf *mbuf,
 			 * been released by BMAN.
 			 */
 			rte_mbuf_refcnt_update(mi, 1);
-			DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr, bp_info->bpid);
+			DPAA_MBUF_TO_CONTIG_FD(mbuf, fd_arr,
+						bp_info ? bp_info->bpid : 0xff);
 		}
 		rte_pktmbuf_free(mbuf);
 	}
@@ -951,7 +957,7 @@ tx_on_dpaa_pool(struct rte_mbuf *mbuf,
 		tx_on_dpaa_pool_unsegmented(mbuf, bp_info, fd_arr);
 	} else if (mbuf->nb_segs > 1 &&
 		   mbuf->nb_segs <= DPAA_SGT_MAX_ENTRIES) {
-		if (dpaa_eth_mbuf_to_sg_fd(mbuf, fd_arr, bp_info->bpid)) {
+		if (dpaa_eth_mbuf_to_sg_fd(mbuf, fd_arr, bp_info)) {
 			DPAA_PMD_DEBUG("Unable to create Scatter Gather FD");
 			return 1;
 		}
@@ -1055,6 +1061,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 	uint16_t state;
 	int ret, realloc_mbuf = 0;
 	uint32_t seqn, index, flags[DPAA_TX_BURST_SIZE] = {0};
+	struct rte_mbuf **orig_bufs = bufs;
 
 	if (unlikely(!DPAA_PER_LCORE_PORTAL)) {
 		ret = rte_dpaa_portal_init((void *)0);
@@ -1112,6 +1119,11 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 				mp = mi->pool;
 			}
 
+			if (unlikely(RTE_MBUF_HAS_EXTBUF(mbuf))) {
+				bp_info = NULL;
+				goto indirect_buf;
+			}
+
 			bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp);
 			if (unlikely(mp->ops_index != bp_info->dpaa_ops_index ||
 				     realloc_mbuf == 1)) {
@@ -1130,7 +1142,7 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 				mbuf = temp_mbuf;
 				realloc_mbuf = 0;
 			}
-
+indirect_buf:
 			state = tx_on_dpaa_pool(mbuf, bp_info,
 						&fd_arr[loop]);
 			if (unlikely(state)) {
@@ -1157,6 +1169,15 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 
 	DPAA_DP_LOG(DEBUG, "Transmitted %d buffers on queue: %p", sent, q);
 
+
+	loop = 0;
+	while (loop < sent) {
+		if (unlikely(RTE_MBUF_HAS_EXTBUF(*orig_bufs)))
+			rte_pktmbuf_free(*orig_bufs);
+		orig_bufs++;
+		loop++;
+	}
+
 	return sent;
 }
 
drivers/net/dpaa/dpaa_rxtx.h +1 -7
index d9d7e04f5c..99e09196e9 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2017,2020 NXP
+ *   Copyright 2017,2020-2021 NXP
  *
  */
 
@@ -279,12 +279,6 @@ uint16_t dpaa_eth_tx_drop_all(void *q  __rte_unused,
 			      struct rte_mbuf **bufs __rte_unused,
 			      uint16_t nb_bufs __rte_unused);
 
-struct rte_mbuf *dpaa_eth_sg_to_mbuf(const struct qm_fd *fd, uint32_t ifid);
-
-int dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
-			   struct qm_fd *fd,
-			   uint32_t bpid);
-
 uint16_t dpaa_free_mbuf(const struct qm_fd *fd);
 void dpaa_rx_cb(struct qman_fq **fq,
 		struct qm_dqrr_entry **dqrr, void **bufs, int num_bufs);
Signature · 1 line
2.17.1
#44 lore raw

PATCH v3 8/23 net/dpaa2: add traffic management driver

In reply to Hemant Agrawal

From: Gagandeep Singh <[email protected]>

Add basic support for scheduling and shaping on dpaa2 platform.

HW supports 2 level of scheduling and shaping. However the current patch only support single level.

---
 doc/guides/nics/dpaa2.rst           | 120 +++++-
 drivers/net/dpaa2/dpaa2_ethdev.c    |  14 +-
 drivers/net/dpaa2/dpaa2_ethdev.h    |   5 +
 drivers/net/dpaa2/dpaa2_tm.c        | 630 ++++++++++++++++++++++++++++
 drivers/net/dpaa2/dpaa2_tm.h        |  32 ++
 drivers/net/dpaa2/mc/dpni.c         | 313 +++++++++++++-
 drivers/net/dpaa2/mc/fsl_dpni.h     | 210 +++++++++-
 drivers/net/dpaa2/mc/fsl_dpni_cmd.h |  59 ++-
 drivers/net/dpaa2/meson.build       |   3 +-
 9 files changed, 1380 insertions(+), 6 deletions(-)
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.c
 create mode 100644 drivers/net/dpaa2/dpaa2_tm.h
doc/guides/nics/dpaa2.rst +119 -1
index 233d926e0a..893e87e714 100644
@@ -1,5 +1,5 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
-    Copyright 2016,2020 NXP
+    Copyright 2016,2020-2021 NXP
 
 
 DPAA2 Poll Mode Driver
@@ -406,6 +406,8 @@ Features of the DPAA2 PMD are:
 - Jumbo frames
 - Link flow control
 - Scattered and gather for TX and RX
+- :ref:`Traffic Management API <dptmapi>`
+
 
 Supported DPAA2 SoCs
 --------------------
@@ -548,3 +550,119 @@ Other Limitations
 
 - RSS hash key cannot be modified.
 - RSS RETA cannot be configured.
+
+.. _dptmapi:
+
+Traffic Management API
+----------------------
+
+DPAA2 PMD supports generic DPDK Traffic Management API which allows to
+configure the following features:
+
+1. Hierarchical scheduling
+2. Traffic shaping
+
+Internally TM is represented by a hierarchy (tree) of nodes.
+Node which has a parent is called a leaf whereas node without
+parent is called a non-leaf (root).
+
+Nodes hold following types of settings:
+
+- for egress scheduler configuration: weight
+- for egress rate limiter: private shaper
+
+Hierarchy is always constructed from the top, i.e first a root node is added
+then some number of leaf nodes. Number of leaf nodes cannot exceed number
+of configured tx queues.
+
+After hierarchy is complete it can be committed.
+
+For an additional description please refer to DPDK :doc:`Traffic Management API <../prog_guide/traffic_management>`.
+
+Supported Features
+~~~~~~~~~~~~~~~~~~
+
+The following capabilities are supported:
+
+- Level0 (root node) and Level1 are supported.
+- 1 private shaper at root node (port level) is supported.
+- 8 TX queues per port supported (1 channel per port)
+- Both SP and WFQ scheduling mechanisms are supported on all 8 queues.
+- Congestion notification is supported. It means if there is congestion on
+    the network, DPDK driver will not enqueue any packet (no taildrop or WRED)
+
+  User can also check node, level capabilities using testpmd commands.
+
+Usage example
+~~~~~~~~~~~~~
+
+For a detailed usage description please refer to "Traffic Management" section in DPDK :doc:`Testpmd Runtime Functions <../testpmd_app_ug/testpmd_funcs>`.
+
+1. Run testpmd as follows:
+
+   .. code-block:: console
+
+	./dpdk-testpmd  -c 0xf -n 1 -- -i --portmask 0x3 --nb-cores=1 --txq=4 --rxq=4
+
+2. Stop all ports:
+
+   .. code-block:: console
+
+	testpmd> port stop all
+
+3. Add shaper profile:
+
+   One port level shaper and strict priority on all 4 queues of port 0:
+
+   .. code-block:: console
+
+	add port tm node shaper profile 0 1 104857600 64 100 0 0
+	add port tm nonleaf node 0 8 -1 0 1 0 1 1 1 0
+	add port tm leaf node 0 0 8 0 1 1 -1 0 0 0 0
+	add port tm leaf node 0 1 8 1 1 1 -1 0 0 0 0
+	add port tm leaf node 0 2 8 2 1 1 -1 0 0 0 0
+	add port tm leaf node 0 3 8 3 1 1 -1 0 0 0 0
+	port tm hierarchy commit 0 no
+
+	or
+
+   One port level shaper and WFQ on all 4 queues of port 0:
+
+   .. code-block:: console
+
+	add port tm node shaper profile 0 1 104857600 64 100 0 0
+	add port tm nonleaf node 0 8 -1 0 1 0 1 1 1 0
+	add port tm leaf node 0 0 8 0 200 1 -1 0 0 0 0
+	add port tm leaf node 0 1 8 0 300 1 -1 0 0 0 0
+	add port tm leaf node 0 2 8 0 400 1 -1 0 0 0 0
+	add port tm leaf node 0 3 8 0 500 1 -1 0 0 0 0
+	port tm hierarchy commit 0 no
+
+4. Create flows as per the source IP addresses:
+
+   .. code-block:: console
+
+	flow create 1 group 0 priority 1 ingress pattern ipv4 src is \
+	10.10.10.1 / end actions queue index 0 / end
+	flow create 1 group 0 priority 2 ingress pattern ipv4 src is \
+	10.10.10.2 / end actions queue index 1 / end
+	flow create 1 group 0 priority 3 ingress pattern ipv4 src is \
+	10.10.10.3 / end actions queue index 2 / end
+	flow create 1 group 0 priority 4 ingress pattern ipv4 src is \
+	10.10.10.4 / end actions queue index 3 / end
+
+5. Start all ports
+
+   .. code-block:: console
+
+	testpmd> port start all
+
+
+
+6. Enable forwarding
+
+   .. code-block:: console
+
+		testpmd> start
+
+7. Inject the traffic on port1 as per the configured flows, you will see shaped and scheduled forwarded traffic on port0
drivers/net/dpaa2/dpaa2_ethdev.c +13 -1
index a81c73438e..490eb4b3f4 100644
@@ -1,7 +1,7 @@
 /* * SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2016-2020 NXP
+ *   Copyright 2016-2021 NXP
  *
  */
 
@@ -638,6 +638,8 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev)
 	if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
 		dpaa2_vlan_offload_set(dev, ETH_VLAN_FILTER_MASK);
 
+	dpaa2_tm_init(dev);
+
 	return 0;
 }
 
@@ -1264,6 +1266,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev)
 		return -1;
 	}
 
+	dpaa2_tm_deinit(dev);
 	dpaa2_flow_clean(dev);
 	/* Clean the device first */
 	ret = dpni_reset(dpni, CMD_PRI_LOW, priv->token);
@@ -2345,6 +2348,14 @@ dpaa2_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->conf.tx_deferred_start = 0;
 }
 
+static int
+dpaa2_tm_ops_get(struct rte_eth_dev *dev __rte_unused, void *ops)
+{
+	*(const void **)ops = &dpaa2_tm_ops;
+
+	return 0;
+}
+
 static struct eth_dev_ops dpaa2_ethdev_ops = {
 	.dev_configure	  = dpaa2_eth_dev_configure,
 	.dev_start	      = dpaa2_dev_start,
@@ -2387,6 +2398,7 @@ static struct eth_dev_ops dpaa2_ethdev_ops = {
 	.filter_ctrl          = dpaa2_dev_flow_ctrl,
 	.rxq_info_get	      = dpaa2_rxq_info_get,
 	.txq_info_get	      = dpaa2_txq_info_get,
+	.tm_ops_get	      = dpaa2_tm_ops_get,
 #if defined(RTE_LIBRTE_IEEE1588)
 	.timesync_enable      = dpaa2_timesync_enable,
 	.timesync_disable     = dpaa2_timesync_disable,
drivers/net/dpaa2/dpaa2_ethdev.h +5 -0
index bb49fa9a38..9837eb62c8 100644
@@ -12,6 +12,7 @@
 #include <rte_pmd_dpaa2.h>
 
 #include <dpaa2_hw_pvt.h>
+#include "dpaa2_tm.h"
 
 #include <mc/fsl_dpni.h>
 #include <mc/fsl_mc_sys.h>
@@ -112,6 +113,8 @@ extern int dpaa2_timestamp_dynfield_offset;
 extern const struct rte_flow_ops dpaa2_flow_ops;
 extern enum rte_filter_type dpaa2_filter_type;
 
+extern const struct rte_tm_ops dpaa2_tm_ops;
+
 #define IP_ADDRESS_OFFSET_INVALID (-1)
 
 struct dpaa2_key_info {
@@ -179,6 +182,8 @@ struct dpaa2_dev_priv {
 	struct rte_eth_dev *eth_dev; /**< Pointer back to holding ethdev */
 
 	LIST_HEAD(, rte_flow) flows; /**< Configured flow rule handles. */
+	LIST_HEAD(nodes, dpaa2_tm_node) nodes;
+	LIST_HEAD(shaper_profiles, dpaa2_tm_shaper_profile) shaper_profiles;
 };
 
 int dpaa2_distset_to_dpkg_profile_cfg(uint64_t req_dist_set,
drivers/net/dpaa2/dpaa2_tm.c new file +630 -0

630 lines not on this page · raw message

drivers/net/dpaa2/dpaa2_tm.h new file +32 -0
new file mode 100644
index 0000000000..6632fab687
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2020 NXP
+ */
+
+#ifndef _DPAA2_TM_H_
+#define _DPAA2_TM_H_
+
+#include <rte_tm.h>
+
+struct dpaa2_tm_shaper_profile {
+	LIST_ENTRY(dpaa2_tm_shaper_profile) next;
+	uint32_t id;
+	int refcnt;
+	struct rte_tm_shaper_params params;
+};
+
+struct dpaa2_tm_node {
+	LIST_ENTRY(dpaa2_tm_node) next;
+	uint32_t id;
+	uint32_t type;
+	int refcnt;
+	struct dpaa2_tm_node *parent;
+	struct dpaa2_tm_shaper_profile *profile;
+	uint32_t weight;
+	uint32_t priority;
+	uint64_t stats_mask;
+};
+
+int dpaa2_tm_init(struct rte_eth_dev *dev);
+void dpaa2_tm_deinit(struct rte_eth_dev *dev);
+
+#endif /* _DPAA2_TM_H_ */
drivers/net/dpaa2/mc/dpni.c +312 -1

337 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpni.h +209 -1

240 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpni_cmd.h +58 -1

89 lines not on this page · raw message

drivers/net/dpaa2/meson.build +2 -1
index 844dd25159..f5f411d592 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright 2018 NXP
+# Copyright 2018-2021 NXP
 
 if not is_linux
 	build = false
@@ -8,6 +8,7 @@ endif
 
 deps += ['mempool_dpaa2']
 sources = files('base/dpaa2_hw_dpni.c',
+		'dpaa2_tm.c',
 		'dpaa2_mux.c',
 		'dpaa2_ethdev.c',
 		'dpaa2_flow.c',
Signature · 1 line
2.17.1
#45 lore raw

PATCH v3 9/23 net/dpaa2: add support to configure dpdmux max Rx frame len

In reply to Hemant Agrawal

This patch introduce a new pmd api, which can help the applications to configure the max framelen for a given dpdmux interface

---
 drivers/net/dpaa2/dpaa2_mux.c     | 28 +++++++++++++++++++++++++++-
 drivers/net/dpaa2/rte_pmd_dpaa2.h | 18 +++++++++++++++++-
 drivers/net/dpaa2/version.map     |  1 +
 3 files changed, 45 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_mux.c +27 -1
index f8366e839e..b397d333d6 100644
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018-2020 NXP
+ * Copyright 2018-2021 NXP
  */
 
 #include <sys/queue.h>
@@ -205,6 +205,32 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 	return NULL;
 }
 
+int
+rte_pmd_dpaa2_mux_rx_frame_len(uint32_t dpdmux_id, uint16_t max_rx_frame_len)
+{
+	struct dpaa2_dpdmux_dev *dpdmux_dev;
+	int ret;
+
+	/* Find the DPDMUX from dpdmux_id in our list */
+	dpdmux_dev = get_dpdmux_from_id(dpdmux_id);
+	if (!dpdmux_dev) {
+		DPAA2_PMD_ERR("Invalid dpdmux_id: %d", dpdmux_id);
+		return -1;
+	}
+
+	ret = dpdmux_set_max_frame_length(&dpdmux_dev->dpdmux,
+			CMD_PRI_LOW, dpdmux_dev->token, max_rx_frame_len);
+	if (ret) {
+		DPAA2_PMD_ERR("DPDMUX:Unable to set mtu. check config %d", ret);
+		return ret;
+	}
+
+	DPAA2_PMD_INFO("dpdmux mtu set as %u",
+			DPAA2_MAX_RX_PKT_LEN - RTE_ETHER_CRC_LEN);
+
+	return ret;
+}
+
 static int
 dpaa2_create_dpdmux_device(int vdev_fd __rte_unused,
 			   struct vfio_device_info *obj_info __rte_unused,
drivers/net/dpaa2/rte_pmd_dpaa2.h +17 -1
index ec8df75af9..7204a8f951 100644
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018-2020 NXP
+ * Copyright 2018-2021 NXP
  */
 
 #ifndef _RTE_PMD_DPAA2_H
@@ -40,6 +40,22 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 			      struct rte_flow_item *pattern[],
 			      struct rte_flow_action *actions[]);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * demultiplex interface max rx frame length configure
+ *
+ * @param dpdmux_id
+ *    ID of the DPDMUX MC object.
+ * @param max_rx_frame_len
+ *    maximum receive frame length (will be checked to be minimux of all dpnis)
+ *
+ */
+__rte_experimental
+int
+rte_pmd_dpaa2_mux_rx_frame_len(uint32_t dpdmux_id, uint16_t max_rx_frame_len);
+
 /**
  * @warning
  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
drivers/net/dpaa2/version.map +1 -0
index 72d1b2b1c8..3c087c2423 100644
@@ -2,6 +2,7 @@ EXPERIMENTAL {
 	global:
 
 	rte_pmd_dpaa2_mux_flow_create;
+	rte_pmd_dpaa2_mux_rx_frame_len;
 	rte_pmd_dpaa2_set_custom_hash;
 };
 
Signature · 1 line
2.17.1
#46 lore raw

Re: [dpdk-dev] [PATCH v3 09/23] net/dpaa2: add support to configure dpdmux max Rx frame len

Quoted 5 lines · Hemant Agrawal

This patch introduce a new pmd api, which can help the applications to configure the max framelen for a given dpdmux interface

<...>

drivers/net/dpaa2/version.map EXPERIMENTAL { · line 7

Quoted 7 lines
drivers/net/dpaa2/version.map +1 -0
@@ -2,6 +2,7 @@ EXPERIMENTAL {
  	global:
 
  	rte_pmd_dpaa2_mux_flow_create;
+	rte_pmd_dpaa2_mux_rx_frame_len;
  	rte_pmd_dpaa2_set_custom_hash;
  };

Added version comment while merging.

#47 lore raw

PATCH v3 10/23 net/dpaa2: add support for raw pattern in dpdmux

In reply to Hemant Agrawal

From: Akhil Goyal <[email protected]>

Added support for flow raw pattern and check that the call for dpdmux_set_custom_key() which should be called only once for a particular DPDMUX as all previous rules will be erased with this call.
Hence calling it for the first time only.

---
 drivers/net/dpaa2/dpaa2_mux.c         | 39 ++++++++++++++++++++++-----
 drivers/net/dpaa2/mc/dpdmux.c         |  3 ++-
 drivers/net/dpaa2/mc/fsl_dpdmux.h     | 12 +++++++--
 drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h |  4 +--
 4 files changed, 46 insertions(+), 12 deletions(-)
drivers/net/dpaa2/dpaa2_mux.c +32 -7
index b397d333d6..b669a16fc1 100644
@@ -66,6 +66,7 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 	void *key_iova, *mask_iova, *key_cfg_iova = NULL;
 	uint8_t key_size = 0;
 	int ret;
+	static int i;
 
 	/* Find the DPDMUX from dpdmux_id in our list */
 	dpdmux_dev = get_dpdmux_from_id(dpdmux_id);
@@ -154,6 +155,23 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 	}
 	break;
 
+	case RTE_FLOW_ITEM_TYPE_RAW:
+	{
+		const struct rte_flow_item_raw *spec;
+
+		spec = (const struct rte_flow_item_raw *)pattern[0]->spec;
+		kg_cfg.extracts[0].extract.from_data.offset = spec->offset;
+		kg_cfg.extracts[0].extract.from_data.size = spec->length;
+		kg_cfg.extracts[0].type = DPKG_EXTRACT_FROM_DATA;
+		kg_cfg.num_extracts = 1;
+		memcpy((void *)key_iova, (const void *)spec->pattern,
+							spec->length);
+		memcpy(mask_iova, pattern[0]->mask, spec->length);
+
+		key_size = spec->length;
+	}
+	break;
+
 	default:
 		DPAA2_PMD_ERR("Not supported pattern type: %d",
 				pattern[0]->type);
@@ -166,20 +184,27 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 		goto creation_error;
 	}
 
-	ret = dpdmux_set_custom_key(&dpdmux_dev->dpdmux, CMD_PRI_LOW,
-				    dpdmux_dev->token,
-			(uint64_t)(DPAA2_VADDR_TO_IOVA(key_cfg_iova)));
-	if (ret) {
-		DPAA2_PMD_ERR("dpdmux_set_custom_key failed: err(%d)", ret);
-		goto creation_error;
+	/* Multiple rules with same DPKG extracts (kg_cfg.extracts) like same
+	 * offset and length values in raw is supported right now. Different
+	 * values of kg_cfg may not work.
+	 */
+	if (i == 0) {
+		ret = dpdmux_set_custom_key(&dpdmux_dev->dpdmux, CMD_PRI_LOW,
+					    dpdmux_dev->token,
+				(uint64_t)(DPAA2_VADDR_TO_IOVA(key_cfg_iova)));
+		if (ret) {
+			DPAA2_PMD_ERR("dpdmux_set_custom_key failed: err(%d)",
+					ret);
+			goto creation_error;
+		}
 	}
-
 	/* As now our key extract parameters are set, let us configure
 	 * the rule.
 	 */
 	flow->rule.key_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(key_iova));
 	flow->rule.mask_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(mask_iova));
 	flow->rule.key_size = key_size;
+	flow->rule.entry_index = i++;
 
 	vf_conf = (const struct rte_flow_action_vf *)(actions[0]->conf);
 	if (vf_conf->id == 0 || vf_conf->id > dpdmux_dev->num_ifs) {
drivers/net/dpaa2/mc/dpdmux.c +2 -1
index 63f1ec7d30..67d37ed4cd 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2013-2016 Freescale Semiconductor Inc.
- * Copyright 2018-2019 NXP
+ * Copyright 2018-2021 NXP
  *
  */
 #include <fsl_mc_sys.h>
@@ -852,6 +852,7 @@ int dpdmux_add_custom_cls_entry(struct fsl_mc_io *mc_io,
 
 	cmd_params = (struct dpdmux_cmd_add_custom_cls_entry *)cmd.params;
 	cmd_params->key_size = rule->key_size;
+	cmd_params->entry_index = rule->entry_index;
 	cmd_params->dest_if = cpu_to_le16(action->dest_if);
 	cmd_params->key_iova = cpu_to_le64(rule->key_iova);
 	cmd_params->mask_iova = cpu_to_le64(rule->mask_iova);
drivers/net/dpaa2/mc/fsl_dpdmux.h +10 -2
index accd1ef5c1..2f167ee00c 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2013-2016 Freescale Semiconductor Inc.
- * Copyright 2018-2019 NXP
+ * Copyright 2018-2021 NXP
  *
  */
 #ifndef __FSL_DPDMUX_H
@@ -367,15 +367,23 @@ int dpdmux_set_custom_key(struct fsl_mc_io *mc_io,
  * struct dpdmux_rule_cfg - Custom classification rule.
  *
  * @key_iova: DMA address of buffer storing the look-up value
- * @mask_iova: DMA address of the mask used for TCAM classification
+ * @mask_iova: DMA address of the mask used for TCAM classification. This
+ *  parameter is used only if dpdmux was created using option
+ *  DPDMUX_OPT_CLS_MASK_SUPPORT.
  * @key_size: size, in bytes, of the look-up value. This must match the size
  *	of the look-up key defined using dpdmux_set_custom_key, otherwise the
  *	entry will never be hit
+ * @entry_index: rule index into the table. This parameter is used only when
+ *  dpdmux object was created using option DPDMUX_OPT_CLS_MASK_SUPPORT. In
+ *  this case the rule is masking and the current frame may be a hit for
+ *  multiple rules. This parameter determines the order in which the rules
+ *  will be checked (smaller entry_index first).
  */
 struct dpdmux_rule_cfg {
 	uint64_t key_iova;
 	uint64_t mask_iova;
 	uint8_t key_size;
+	uint16_t entry_index;
 };
 
 /**
drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h +2 -2
index a60b2ebe3c..b6b8c38c41 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2013-2016 Freescale Semiconductor Inc.
- * Copyright 2018-2019 NXP
+ * Copyright 2018-2021 NXP
  *
  */
 #ifndef _FSL_DPDMUX_CMD_H
@@ -204,7 +204,7 @@ struct dpdmux_set_custom_key {
 struct dpdmux_cmd_add_custom_cls_entry {
 	uint8_t pad[3];
 	uint8_t key_size;
-	uint16_t pad1;
+	uint16_t entry_index;
 	uint16_t dest_if;
 	uint64_t key_iova;
 	uint64_t mask_iova;
Signature · 1 line
2.17.1
#48 lore raw

PATCH v3 11/23 net/dpaa2: dpdmux skip reset

In reply to Hemant Agrawal

From: Apeksha Gupta <[email protected]>

This is require as the interface is shared with linux and we do not want the dpdmux to be reset. rather the default interface to kernel shall continue.
command dpdmux_set_resetable is used to skip DPDMUX reset. By default the DPDMUX_RESET command will reset the DPDMUX completely, dpdmux_set_resetable command will be ignored in old MC firmware.

---
 drivers/net/dpaa2/dpaa2_mux.c         | 26 +++++++++
 drivers/net/dpaa2/mc/dpdmux.c         | 84 +++++++++++++++++++++++++++
 drivers/net/dpaa2/mc/fsl_dpdmux.h     | 32 ++++++++++
 drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h | 22 ++++++-
 4 files changed, 161 insertions(+), 3 deletions(-)
drivers/net/dpaa2/dpaa2_mux.c +26 -0
index b669a16fc1..1ff00ca8f7 100644
@@ -264,6 +264,8 @@ dpaa2_create_dpdmux_device(int vdev_fd __rte_unused,
 	struct dpaa2_dpdmux_dev *dpdmux_dev;
 	struct dpdmux_attr attr;
 	int ret;
+	uint16_t maj_ver;
+	uint16_t min_ver;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -298,6 +300,30 @@ dpaa2_create_dpdmux_device(int vdev_fd __rte_unused,
 		goto init_err;
 	}
 
+	ret = dpdmux_get_api_version(&dpdmux_dev->dpdmux, CMD_PRI_LOW,
+					&maj_ver, &min_ver);
+	if (ret) {
+		DPAA2_PMD_ERR("setting version failed in %s",
+				__func__);
+		goto init_err;
+	}
+
+	/* The new dpdmux_set/get_resetable() API are available starting with
+	 * DPDMUX_VER_MAJOR==6 and DPDMUX_VER_MINOR==6
+	 */
+	if (maj_ver >= 6 && min_ver >= 6) {
+		ret = dpdmux_set_resetable(&dpdmux_dev->dpdmux, CMD_PRI_LOW,
+				dpdmux_dev->token,
+				DPDMUX_SKIP_DEFAULT_INTERFACE |
+				DPDMUX_SKIP_UNICAST_RULES |
+				DPDMUX_SKIP_MULTICAST_RULES);
+		if (ret) {
+			DPAA2_PMD_ERR("setting default interface failed in %s",
+				      __func__);
+			goto init_err;
+		}
+	}
+
 	dpdmux_dev->dpdmux_id = dpdmux_id;
 	dpdmux_dev->num_ifs = attr.num_ifs;
 
drivers/net/dpaa2/mc/dpdmux.c +84 -0

106 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpdmux.h +32 -0
index 2f167ee00c..dc067b81cd 100644
@@ -79,6 +79,8 @@ enum dpdmux_method {
  * @method: Defines the operation method for the DPDMUX address table
  * @manip: Required manipulation operation
  * @num_ifs: Number of interfaces (excluding the uplink interface)
+ * @default_if: Default interface number (different from uplink,
+	maximum value num_ifs)
  * @adv: Advanced parameters; default is all zeros;
  *	use this structure to change default settings
  * @adv.options: DPDMUX options - combination of 'DPDMUX_OPT_<X>' flags.
@@ -89,16 +91,20 @@ enum dpdmux_method {
  * @adv.max_vlan_ids: Maximum vlan ids allowed in the system -
  *	relevant only case of working in mac+vlan method.
  *	0 - indicates default 16 vlan ids.
+ * @adv.mem_size: Size of the memory used for internal buffers expressed as
+ * number of 256byte buffers.
  */
 struct dpdmux_cfg {
 	enum dpdmux_method method;
 	enum dpdmux_manip manip;
 	uint16_t num_ifs;
+	uint16_t default_if;
 	struct {
 		uint64_t options;
 		uint16_t max_dmat_entries;
 		uint16_t max_mc_groups;
 		uint16_t max_vlan_ids;
+		uint16_t mem_size;
 	} adv;
 };
 
@@ -130,6 +136,29 @@ int dpdmux_reset(struct fsl_mc_io *mc_io,
 		 uint32_t cmd_flags,
 		 uint16_t token);
 
+/**
+ *Setting 1 DPDMUX_RESET will not reset default interface
+ */
+#define DPDMUX_SKIP_DEFAULT_INTERFACE	0x01
+/**
+ *Setting 1 DPDMUX_RESET will not reset unicast rules
+ */
+#define DPDMUX_SKIP_UNICAST_RULES	0x02
+/**
+ *Setting 1 DPDMUX_RESET will not reset multicast rules
+ */
+#define DPDMUX_SKIP_MULTICAST_RULES	0x04
+
+int dpdmux_set_resetable(struct fsl_mc_io *mc_io,
+				  uint32_t cmd_flags,
+				  uint16_t token,
+				  uint8_t skip_reset_flags);
+
+int dpdmux_get_resetable(struct fsl_mc_io *mc_io,
+				  uint32_t cmd_flags,
+				  uint16_t token,
+				  uint8_t *skip_reset_flags);
+
 /**
  * struct dpdmux_attr - Structure representing DPDMUX attributes
  * @id: DPDMUX object ID
@@ -138,6 +167,8 @@ int dpdmux_reset(struct fsl_mc_io *mc_io,
  * @manip: DPDMUX manipulation type
  * @num_ifs: Number of interfaces (excluding the uplink interface)
  * @mem_size: DPDMUX frame storage memory size
+ * @default_if: Default interface number (different from uplink,
+	maximum value num_ifs)
  */
 struct dpdmux_attr {
 	int id;
@@ -146,6 +177,7 @@ struct dpdmux_attr {
 	enum dpdmux_manip manip;
 	uint16_t num_ifs;
 	uint16_t mem_size;
+	uint16_t default_if;
 };
 
 int dpdmux_get_attributes(struct fsl_mc_io *mc_io,
drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h +19 -3
index b6b8c38c41..2444e9a2e5 100644
@@ -55,6 +55,9 @@
 #define DPDMUX_CMDID_IF_SET_DEFAULT		DPDMUX_CMD(0x0b8)
 #define DPDMUX_CMDID_IF_GET_DEFAULT		DPDMUX_CMD(0x0b9)
 
+#define DPDMUX_CMDID_SET_RESETABLE		DPDMUX_CMD(0x0ba)
+#define DPDMUX_CMDID_GET_RESETABLE		DPDMUX_CMD(0x0bb)
+
 #define DPDMUX_MASK(field)        \
 	GENMASK(DPDMUX_##field##_SHIFT + DPDMUX_##field##_SIZE - 1, \
 		DPDMUX_##field##_SHIFT)
@@ -72,12 +75,13 @@ struct dpdmux_cmd_create {
 	uint8_t method;
 	uint8_t manip;
 	uint16_t num_ifs;
-	uint32_t pad;
+	uint16_t default_if;
+	uint16_t pad;
 
 	uint16_t adv_max_dmat_entries;
 	uint16_t adv_max_mc_groups;
 	uint16_t adv_max_vlan_ids;
-	uint16_t pad1;
+	uint16_t mem_size;
 
 	uint64_t options;
 };
@@ -100,7 +104,7 @@ struct dpdmux_rsp_get_attr {
 	uint8_t manip;
 	uint16_t num_ifs;
 	uint16_t mem_size;
-	uint16_t pad;
+	uint16_t default_if;
 
 	uint64_t pad1;
 
@@ -217,5 +221,17 @@ struct dpdmux_cmd_remove_custom_cls_entry {
 	uint64_t key_iova;
 	uint64_t mask_iova;
 };
+
+#define DPDMUX_SKIP_RESET_FLAGS_SHIFT    0
+#define DPDMUX_SKIP_RESET_FLAGS_SIZE     3
+
+struct dpdmux_cmd_set_skip_reset_flags {
+	uint8_t skip_reset_flags;
+};
+
+struct dpdmux_rsp_get_skip_reset_flags {
+	uint8_t skip_reset_flags;
+};
+
 #pragma pack(pop)
 #endif /* _FSL_DPDMUX_CMD_H */
Signature · 1 line
2.17.1
#49 lore raw

PATCH v3 12/23 net/dpaa2: support dpdmux to not drop parse err pkts

In reply to Hemant Agrawal

DPDMUX should not drop parse error packets. They shall be left to the decision of the connected DPNI interfaces

---
 drivers/net/dpaa2/dpaa2_mux.c         |  18 ++++
 drivers/net/dpaa2/mc/dpdmux.c         |  37 +++++++++
 drivers/net/dpaa2/mc/fsl_dpdmux.h     | 113 +++++++++++++++++++++++++-
 drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h |  25 ++++--
 4 files changed, 187 insertions(+), 6 deletions(-)
drivers/net/dpaa2/dpaa2_mux.c +18 -0
index 1ff00ca8f7..811f417491 100644
@@ -324,6 +324,24 @@ dpaa2_create_dpdmux_device(int vdev_fd __rte_unused,
 		}
 	}
 
+	if (maj_ver >= 6 && min_ver >= 9) {
+		struct dpdmux_error_cfg mux_err_cfg;
+
+		memset(&mux_err_cfg, 0, sizeof(mux_err_cfg));
+		mux_err_cfg.error_action = DPDMUX_ERROR_ACTION_CONTINUE;
+		mux_err_cfg.errors = DPDMUX_ERROR_DISC;
+
+		ret = dpdmux_if_set_errors_behavior(&dpdmux_dev->dpdmux,
+				CMD_PRI_LOW,
+				dpdmux_dev->token, dpdmux_id,
+				&mux_err_cfg);
+		if (ret) {
+			DPAA2_PMD_ERR("dpdmux_if_set_errors_behavior %s err %d",
+				      __func__, ret);
+			goto init_err;
+		}
+	}
+
 	dpdmux_dev->dpdmux_id = dpdmux_id;
 	dpdmux_dev->num_ifs = attr.num_ifs;
 
drivers/net/dpaa2/mc/dpdmux.c +37 -0
index 57c811c70f..93912ef9d3 100644
@@ -1012,3 +1012,40 @@ int dpdmux_get_api_version(struct fsl_mc_io *mc_io,
 
 	return 0;
 }
+
+/**
+ * dpdmux_if_set_errors_behavior() - Set errors behavior
+ * @cmd_flags:	Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token:	Token of DPSW object
+ * @if_id:  Interface Identifier
+ * @cfg:	Errors configuration
+ *
+ * Provides a set of frame errors that will be rejected or accepted by the
+ * dpdmux interface. The frame with this errors will no longer be dropped by
+ * the dpdmux interface. When frame has parsing error the distribution to
+ * expected interface may fail. If the frame must be distributed using the
+ * information from a header that was not parsed due errors the frame may
+ * be discarded or end up on a default interface because needed data was not
+ * parsed properly.
+ * This function may be called numerous times with different error masks
+ *
+ * Return:	'0' on Success; Error code otherwise.
+ */
+int dpdmux_if_set_errors_behavior(struct fsl_mc_io *mc_io, uint32_t cmd_flags,
+		uint16_t token, uint16_t if_id, struct dpdmux_error_cfg *cfg)
+{
+	struct mc_command cmd = { 0 };
+	struct dpdmux_cmd_set_errors_behavior *cmd_params;
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_SET_ERRORS_BEHAVIOR,
+					cmd_flags,
+					token);
+	cmd_params = (struct dpdmux_cmd_set_errors_behavior *)cmd.params;
+	cmd_params->errors = cpu_to_le32(cfg->errors);
+	dpdmux_set_field(cmd_params->flags, ERROR_ACTION, cfg->error_action);
+	cmd_params->if_id = cpu_to_le16(if_id);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
drivers/net/dpaa2/mc/fsl_dpdmux.h +112 -1

135 lines not on this page · raw message

drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h +20 -5
index 2444e9a2e5..2ab4d75dfb 100644
@@ -9,30 +9,35 @@
 
 /* DPDMUX Version */
 #define DPDMUX_VER_MAJOR		6
-#define DPDMUX_VER_MINOR		3
+#define DPDMUX_VER_MINOR		9
 
 #define DPDMUX_CMD_BASE_VERSION		1
 #define DPDMUX_CMD_VERSION_2		2
+#define DPDMUX_CMD_VERSION_3		3
+#define DPDMUX_CMD_VERSION_4		4
 #define DPDMUX_CMD_ID_OFFSET		4
 
 #define DPDMUX_CMD(id)	(((id) << DPDMUX_CMD_ID_OFFSET) |\
 				DPDMUX_CMD_BASE_VERSION)
 #define DPDMUX_CMD_V2(id) (((id) << DPDMUX_CMD_ID_OFFSET) | \
 				DPDMUX_CMD_VERSION_2)
+#define DPDMUX_CMD_V3(id)	(((id) << DPDMUX_CMD_ID_OFFSET) |\
+				DPDMUX_CMD_VERSION_3)
+#define DPDMUX_CMD_V4(id)	(((id) << DPDMUX_CMD_ID_OFFSET) |\
+				DPDMUX_CMD_VERSION_4)
 
 /* Command IDs */
 #define DPDMUX_CMDID_CLOSE			DPDMUX_CMD(0x800)
 #define DPDMUX_CMDID_OPEN			DPDMUX_CMD(0x806)
-#define DPDMUX_CMDID_CREATE			DPDMUX_CMD(0x906)
+#define DPDMUX_CMDID_CREATE			DPDMUX_CMD_V4(0x906)
 #define DPDMUX_CMDID_DESTROY			DPDMUX_CMD(0x986)
 #define DPDMUX_CMDID_GET_API_VERSION		DPDMUX_CMD(0xa06)
 
 #define DPDMUX_CMDID_ENABLE			DPDMUX_CMD(0x002)
 #define DPDMUX_CMDID_DISABLE			DPDMUX_CMD(0x003)
-#define DPDMUX_CMDID_GET_ATTR			DPDMUX_CMD(0x004)
+#define DPDMUX_CMDID_GET_ATTR			DPDMUX_CMD_V2(0x004)
 #define DPDMUX_CMDID_RESET			DPDMUX_CMD(0x005)
 #define DPDMUX_CMDID_IS_ENABLED			DPDMUX_CMD(0x006)
-
 #define DPDMUX_CMDID_SET_MAX_FRAME_LENGTH	DPDMUX_CMD(0x0a1)
 
 #define DPDMUX_CMDID_UL_RESET_COUNTERS		DPDMUX_CMD(0x0a3)
@@ -49,7 +54,7 @@
 #define DPDMUX_CMDID_IF_GET_LINK_STATE		DPDMUX_CMD_V2(0x0b4)
 
 #define DPDMUX_CMDID_SET_CUSTOM_KEY		DPDMUX_CMD(0x0b5)
-#define DPDMUX_CMDID_ADD_CUSTOM_CLS_ENTRY	DPDMUX_CMD(0x0b6)
+#define DPDMUX_CMDID_ADD_CUSTOM_CLS_ENTRY	DPDMUX_CMD_V2(0x0b6)
 #define DPDMUX_CMDID_REMOVE_CUSTOM_CLS_ENTRY	DPDMUX_CMD(0x0b7)
 
 #define DPDMUX_CMDID_IF_SET_DEFAULT		DPDMUX_CMD(0x0b8)
@@ -57,6 +62,7 @@
 
 #define DPDMUX_CMDID_SET_RESETABLE		DPDMUX_CMD(0x0ba)
 #define DPDMUX_CMDID_GET_RESETABLE		DPDMUX_CMD(0x0bb)
+#define DPDMUX_CMDID_SET_ERRORS_BEHAVIOR	DPDMUX_CMD(0x0bf)
 
 #define DPDMUX_MASK(field)        \
 	GENMASK(DPDMUX_##field##_SHIFT + DPDMUX_##field##_SIZE - 1, \
@@ -233,5 +239,14 @@ struct dpdmux_rsp_get_skip_reset_flags {
 	uint8_t skip_reset_flags;
 };
 
+#define DPDMUX_ERROR_ACTION_SHIFT		0
+#define DPDMUX_ERROR_ACTION_SIZE		4
+
+struct dpdmux_cmd_set_errors_behavior {
+	uint32_t errors;
+	uint16_t flags;
+	uint16_t if_id;
+};
+
 #pragma pack(pop)
 #endif /* _FSL_DPDMUX_CMD_H */
Signature · 1 line
2.17.1
#50 lore raw

PATCH v3 13/23 net/dpaa2: add device args for enable Tx confirmation

In reply to Hemant Agrawal

Add support for dev arg ``fslmc:dpni.1,drv_tx_conf=1``

It is optional for dpaa2 to use TX confirmation. DPAA2 can free the transmitted packets. However some use-case requires the TX confirmation to be explicit.

---
 doc/guides/nics/dpaa2.rst        |  4 ++++
 drivers/net/dpaa2/dpaa2_ethdev.c | 35 +++++++++++++++++---------------
 drivers/net/dpaa2/dpaa2_ethdev.h |  5 +++--
 3 files changed, 26 insertions(+), 18 deletions(-)
doc/guides/nics/dpaa2.rst +4 -0
index 893e87e714..4eec8fcdd9 100644
@@ -484,6 +484,10 @@ for details.
   of the packet pull command which is issued  in the previous cycle.
   e.g. ``fslmc:dpni.1,drv_no_prefetch=1``
 
+* Use dev arg option  ``drv_tx_conf=1`` to enable TX confirmation mode.
+  In this mode tx conf queues need to be polled to free the buffers.
+  e.g. ``fslmc:dpni.1,drv_tx_conf=1``
+
 Enabling logs
 -------------
 
drivers/net/dpaa2/dpaa2_ethdev.c +19 -16
index 490eb4b3f4..4b3eb7f5c9 100644
@@ -31,6 +31,7 @@
 
 #define DRIVER_LOOPBACK_MODE "drv_loopback"
 #define DRIVER_NO_PREFETCH_MODE "drv_no_prefetch"
+#define DRIVER_TX_CONF "drv_tx_conf"
 #define CHECK_INTERVAL         100  /* 100ms */
 #define MAX_REPEAT_TIME        90   /* 9s (90 * 100ms) in total */
 
@@ -363,7 +364,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);
-	if (priv->tx_conf_en)
+	if (priv->flags & DPAA2_TX_CONF_ENABLE)
 		tot_queues = priv->nb_rx_queues + 2 * priv->nb_tx_queues;
 	else
 		tot_queues = priv->nb_rx_queues + priv->nb_tx_queues;
@@ -401,7 +402,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev)
 			goto fail_tx;
 	}
 
-	if (priv->tx_conf_en) {
+	if (priv->flags & DPAA2_TX_CONF_ENABLE) {
 		/*Setup tx confirmation queues*/
 		for (i = 0; i < priv->nb_tx_queues; i++) {
 			mc_q->eth_data = dev->data;
@@ -483,7 +484,7 @@ dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev)
 			dpaa2_q = (struct dpaa2_queue *)priv->tx_vq[i];
 			rte_free(dpaa2_q->cscn);
 		}
-		if (priv->tx_conf_en) {
+		if (priv->flags & DPAA2_TX_CONF_ENABLE) {
 			/* cleanup tx conf queue storage */
 			for (i = 0; i < priv->nb_tx_queues; i++) {
 				dpaa2_q = (struct dpaa2_queue *)
@@ -857,7 +858,7 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
 	if (tx_queue_id == 0) {
 		/*Set tx-conf and error configuration*/
-		if (priv->tx_conf_en)
+		if (priv->flags & DPAA2_TX_CONF_ENABLE)
 			ret = dpni_set_tx_confirmation_mode(dpni, CMD_PRI_LOW,
 							    priv->token,
 							    DPNI_CONF_AFFINE);
@@ -918,7 +919,7 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	dpaa2_q->cb_eqresp_free = dpaa2_dev_free_eqresp_buf;
 	dev->data->tx_queues[tx_queue_id] = dpaa2_q;
 
-	if (priv->tx_conf_en) {
+	if (priv->flags & DPAA2_TX_CONF_ENABLE) {
 		dpaa2_q->tx_conf_queue = dpaa2_tx_conf_q;
 		options = options | DPNI_QUEUE_OPT_USER_CTX;
 		tx_conf_cfg.user_context = (size_t)(dpaa2_q);
@@ -2614,10 +2615,14 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 	priv->max_vlan_filters = attr.vlan_filter_entries;
 	priv->flags = 0;
 #if defined(RTE_LIBRTE_IEEE1588)
-	priv->tx_conf_en = 1;
-#else
-	priv->tx_conf_en = 0;
+	printf("DPDK IEEE1588 is enabled\n");
+	priv->flags |= DPAA2_TX_CONF_ENABLE;
 #endif
+	/* Used with ``fslmc:dpni.1,drv_tx_conf=1`` */
+	if (dpaa2_get_devargs(dev->devargs, DRIVER_TX_CONF)) {
+		priv->flags |= DPAA2_TX_CONF_ENABLE;
+		DPAA2_PMD_INFO("TX_CONF Enabled");
+	}
 
 	/* Allocate memory for hardware structure for queues */
 	ret = dpaa2_alloc_rx_tx_queues(eth_dev);
@@ -2650,7 +2655,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 
 	/* ... tx buffer layout ... */
 	memset(&layout, 0, sizeof(struct dpni_buffer_layout));
-	if (priv->tx_conf_en) {
+	if (priv->flags & DPAA2_TX_CONF_ENABLE) {
 		layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS |
 				 DPNI_BUF_LAYOUT_OPT_TIMESTAMP;
 		layout.pass_timestamp = true;
@@ -2667,13 +2672,11 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
 
 	/* ... tx-conf and error buffer layout ... */
 	memset(&layout, 0, sizeof(struct dpni_buffer_layout));
-	if (priv->tx_conf_en) {
-		layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS |
-				 DPNI_BUF_LAYOUT_OPT_TIMESTAMP;
+	if (priv->flags & DPAA2_TX_CONF_ENABLE) {
+		layout.options = DPNI_BUF_LAYOUT_OPT_TIMESTAMP;
 		layout.pass_timestamp = true;
-	} else {
-		layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS;
 	}
+	layout.options |= DPNI_BUF_LAYOUT_OPT_FRAME_STATUS;
 	layout.pass_frame_status = 1;
 	ret = dpni_set_buffer_layout(dpni_dev, CMD_PRI_LOW, priv->token,
 				     DPNI_QUEUE_TX_CONFIRM, &layout);
@@ -2807,7 +2810,6 @@ rte_dpaa2_probe(struct rte_dpaa2_driver *dpaa2_drv,
 		eth_dev->data->dev_private = (void *)dev_priv;
 		/* Store a pointer to eth_dev in dev_private */
 		dev_priv->eth_dev = eth_dev;
-		dev_priv->tx_conf_en = 0;
 	} else {
 		eth_dev = rte_eth_dev_attach_secondary(dpaa2_dev->device.name);
 		if (!eth_dev) {
@@ -2860,5 +2862,6 @@ static struct rte_dpaa2_driver rte_dpaa2_pmd = {
 RTE_PMD_REGISTER_DPAA2(net_dpaa2, rte_dpaa2_pmd);
 RTE_PMD_REGISTER_PARAM_STRING(net_dpaa2,
 		DRIVER_LOOPBACK_MODE "=<int> "
-		DRIVER_NO_PREFETCH_MODE "=<int>");
+		DRIVER_NO_PREFETCH_MODE "=<int>"
+		DRIVER_TX_CONF "=<int>");
 RTE_LOG_REGISTER(dpaa2_logtype_pmd, pmd.net.dpaa2, NOTICE);
drivers/net/dpaa2/dpaa2_ethdev.h +3 -2
index 9837eb62c8..becdb50055 100644
@@ -60,6 +60,8 @@
 
 /* Disable RX tail drop, default is enable */
 #define DPAA2_RX_TAILDROP_OFF	0x04
+/* Tx confirmation enabled */
+#define DPAA2_TX_CONF_ENABLE	0x08
 
 #define DPAA2_RSS_OFFLOAD_ALL ( \
 	ETH_RSS_L2_PAYLOAD | \
@@ -152,14 +154,13 @@ struct dpaa2_dev_priv {
 	void *tx_vq[MAX_TX_QUEUES];
 	struct dpaa2_bp_list *bp_list; /**<Attached buffer pool list */
 	void *tx_conf_vq[MAX_TX_QUEUES];
-	uint8_t tx_conf_en;
+	uint8_t flags; /*dpaa2 config flags */
 	uint8_t max_mac_filters;
 	uint8_t max_vlan_filters;
 	uint8_t num_rx_tc;
 	uint16_t qos_entries;
 	uint16_t fs_entries;
 	uint8_t dist_queues;
-	uint8_t flags; /*dpaa2 config flags */
 	uint8_t en_ordered;
 	uint8_t en_loose_ordered;
 	uint8_t max_cgs;
Signature · 1 line
2.17.1
#51 lore raw

PATCH v3 14/23 net/dpaa2: optionally enable error queues

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

In case error packets are received by the ethernet interface, this patch enables the receival of packets on the error queue, printing the error and the error packet.

to enable, use the dev_arg as : fslmc:dpni.1,drv_error_queue=1

---
 doc/guides/nics/dpaa2.rst               |  6 ++
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h |  1 +
 drivers/net/dpaa2/dpaa2_ethdev.c        | 67 +++++++++++++++--
 drivers/net/dpaa2/dpaa2_ethdev.h        |  5 +-
 drivers/net/dpaa2/dpaa2_rxtx.c          | 97 ++++++++++++++++++++++++-
 5 files changed, 168 insertions(+), 8 deletions(-)
doc/guides/nics/dpaa2.rst +6 -0
index 4eec8fcdd9..6470f1c05a 100644
@@ -488,6 +488,12 @@ for details.
   In this mode tx conf queues need to be polled to free the buffers.
   e.g. ``fslmc:dpni.1,drv_tx_conf=1``
 
+* Use dev arg option  ``drv_error_queue=1`` to enable Packets in Error queue.
+  DPAA2 hardware drops the error packet in hardware. This option enables the
+  hardware to not drop the error packet and let the driver dump the error
+  packets, so that user can check what is wrong with those packets.
+  e.g. ``fslmc:dpni.1,drv_error_queue=1``
+
 Enabling logs
 -------------
 
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +1 -0
index 0f15750b6c..037c841ef5 100644
@@ -314,6 +314,7 @@ enum qbman_fd_format {
 #define DPAA2_GET_FD_FLC(fd) \
 	(((uint64_t)((fd)->simple.flc_hi) << 32) + (fd)->simple.flc_lo)
 #define DPAA2_GET_FD_ERR(fd)   ((fd)->simple.ctrl & 0x000000FF)
+#define DPAA2_GET_FD_FA_ERR(fd)   ((fd)->simple.ctrl & 0x00000040)
 #define DPAA2_GET_FLE_OFFSET(fle) (((fle)->fin_bpid_offset & 0x0FFF0000) >> 16)
 #define DPAA2_SET_FLE_SG_EXT(fle) ((fle)->fin_bpid_offset |= (uint64_t)1 << 29)
 #define DPAA2_IS_SET_FLE_SG_EXT(fle)	\
drivers/net/dpaa2/dpaa2_ethdev.c +62 -5

108 lines not on this page · raw message

drivers/net/dpaa2/dpaa2_ethdev.h +4 -1
index becdb50055..28341178e4 100644
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2016-2020 NXP
+ *   Copyright 2016-2021 NXP
  *
  */
 
@@ -117,6 +117,8 @@ extern enum rte_filter_type dpaa2_filter_type;
 
 extern const struct rte_tm_ops dpaa2_tm_ops;
 
+extern bool dpaa2_enable_err_queue;
+
 #define IP_ADDRESS_OFFSET_INVALID (-1)
 
 struct dpaa2_key_info {
@@ -154,6 +156,7 @@ struct dpaa2_dev_priv {
 	void *tx_vq[MAX_TX_QUEUES];
 	struct dpaa2_bp_list *bp_list; /**<Attached buffer pool list */
 	void *tx_conf_vq[MAX_TX_QUEUES];
+	void *rx_err_vq;
 	uint8_t flags; /*dpaa2 config flags */
 	uint8_t max_mac_filters;
 	uint8_t max_vlan_filters;
drivers/net/dpaa2/dpaa2_rxtx.c +95 -2

122 lines not on this page · raw message

Signature · 1 line
2.17.1
#52 lore raw

PATCH v3 15/23 net/dpaa2: change Tx queue congestion settings

In reply to Hemant Agrawal

change the tx queue congestion notification to
the ratio of current queue size instead of fixed.

---
 drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +2 -2
index 412f970800..586d116227 100644
@@ -922,9 +922,9 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
 		cong_notif_cfg.units = DPNI_CONGESTION_UNIT_FRAMES;
 		cong_notif_cfg.threshold_entry = nb_tx_desc;
 		/* Notify that the queue is not congested when the data in
-		 * the queue is below this thershold.
+		 * the queue is below this thershold.(90% of value)
 		 */
-		cong_notif_cfg.threshold_exit = nb_tx_desc - 24;
+		cong_notif_cfg.threshold_exit = (nb_tx_desc * 9) / 10;
 		cong_notif_cfg.message_ctx = 0;
 		cong_notif_cfg.message_iova =
 				(size_t)DPAA2_VADDR_TO_IOVA(dpaa2_q->cscn);
Signature · 1 line
2.17.1
#53 lore raw

PATCH v3 16/23 mempool/dpaa2: support stats for secondary process

In reply to Hemant Agrawal

DPAA2 DPBP object access need availability of MCP object pointer. In case of secondary process, we need to use local MCP pointer instead of primary process.

---
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +7 -1
index ca49a8d42a..bc146e4ce1 100644
@@ -393,6 +393,7 @@ rte_hw_mbuf_get_count(const struct rte_mempool *mp)
 	unsigned int num_of_bufs = 0;
 	struct dpaa2_bp_info *bp_info;
 	struct dpaa2_dpbp_dev *dpbp_node;
+	struct fsl_mc_io mc_io;
 
 	if (!mp || !mp->pool_data) {
 		DPAA2_MEMPOOL_ERR("Invalid mempool provided");
@@ -402,7 +403,12 @@ rte_hw_mbuf_get_count(const struct rte_mempool *mp)
 	bp_info = (struct dpaa2_bp_info *)mp->pool_data;
 	dpbp_node = bp_info->bp_list->buf_pool.dpbp_node;
 
-	ret = dpbp_get_num_free_bufs(&dpbp_node->dpbp, CMD_PRI_LOW,
+	/* In case as secondary process access stats, MCP portal in priv-hw may
+	 * have primary process address. Need the secondary process based MCP
+	 * portal address for this object.
+	 */
+	mc_io.regs = dpaa2_get_mcp_ptr(MC_PORTAL_INDEX);
+	ret = dpbp_get_num_free_bufs(&mc_io, CMD_PRI_LOW,
 				     dpbp_node->token, &num_of_bufs);
 	if (ret) {
 		DPAA2_MEMPOOL_ERR("Unable to obtain free buf count (err=%d)",
Signature · 1 line
2.17.1
#54 lore raw

PATCH v3 17/23 net/dpaa: do not release the cgr ranges

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

CGR are automatically freed up in the kernel. As we do not cleanup the queues, if we release the CGR here, kernel reports them in use. So have them freed up in the kernel

---
 drivers/net/dpaa/dpaa_ethdev.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/net/dpaa/dpaa_ethdev.c +0 -6
index c59873dd8a..0996edf9a9 100644
@@ -486,9 +486,6 @@ static int dpaa_eth_dev_close(struct rte_eth_dev *dev)
 	if (dpaa_intf->cgr_rx) {
 		for (loop = 0; loop < dpaa_intf->nb_rx_queues; loop++)
 			qman_delete_cgr(&dpaa_intf->cgr_rx[loop]);
-
-		qman_release_cgrid_range(dpaa_intf->cgr_rx[loop].cgrid,
-					 dpaa_intf->nb_rx_queues);
 	}
 
 	rte_free(dpaa_intf->cgr_rx);
@@ -497,9 +494,6 @@ static int dpaa_eth_dev_close(struct rte_eth_dev *dev)
 	if (dpaa_intf->cgr_tx) {
 		for (loop = 0; loop < MAX_DPAA_CORES; loop++)
 			qman_delete_cgr(&dpaa_intf->cgr_tx[loop]);
-
-		qman_release_cgrid_range(dpaa_intf->cgr_tx[loop].cgrid,
-					 MAX_DPAA_CORES);
 		rte_free(dpaa_intf->cgr_tx);
 		dpaa_intf->cgr_tx = NULL;
 	}
Signature · 1 line
2.17.1
#55 lore raw

PATCH v3 18/23 net/dpaa: prevent multiple mp config on an device

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

The current driver only support single buffer pool on a given pmd instance. return error, if trying to configure more.

---
 drivers/mempool/dpaa/dpaa_mempool.c | 1 +
 drivers/net/dpaa/dpaa_ethdev.c      | 6 ++++++
 2 files changed, 7 insertions(+)
drivers/mempool/dpaa/dpaa_mempool.c +1 -0
index e6b06f0575..1ee7ffb647 100644
@@ -134,6 +134,7 @@ dpaa_mbuf_free_pool(struct rte_mempool *mp)
 		DPAA_MEMPOOL_INFO("BMAN pool freed for bpid =%d",
 				  bp_info->bpid);
 		rte_free(mp->pool_data);
+		bp_info->bp = NULL;
 		mp->pool_data = NULL;
 	}
 }
drivers/net/dpaa/dpaa_ethdev.c +6 -0
index 0996edf9a9..a3a3e7cb24 100644
@@ -969,6 +969,12 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 		}
 	}
 
+	if (dpaa_intf->bp_info && dpaa_intf->bp_info->bp &&
+	    dpaa_intf->bp_info->mp != mp) {
+		DPAA_PMD_WARN("Multiple pools on same interface not supported");
+		return -EINVAL;
+	}
+
 	/* Max packet can fit in single buffer */
 	if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= buffsz) {
 		;
Signature · 1 line
2.17.1
#56 lore raw

PATCH v3 19/23 bus/dpaa: secondary process init support

In reply to Hemant Agrawal

Secondary process also need the access the qman and bman ccsr map.

---
 drivers/bus/dpaa/dpaa_bus.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)
drivers/bus/dpaa/dpaa_bus.c +12 -14
index 662cbfaae5..37cf55d60b 100644
@@ -582,20 +582,18 @@ rte_dpaa_bus_probe(void)
 	/* Device list creation is only done once */
 	if (!process_once) {
 		rte_dpaa_bus_dev_build();
-		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-			/* One time load of Qman/Bman drivers */
-			ret = qman_global_init();
-			if (ret) {
-				DPAA_BUS_ERR("QMAN initialization failed: %d",
-					     ret);
-				return ret;
-			}
-			ret = bman_global_init();
-			if (ret) {
-				DPAA_BUS_ERR("BMAN initialization failed: %d",
-					     ret);
-				return ret;
-			}
+		/* One time load of Qman/Bman drivers */
+		ret = qman_global_init();
+		if (ret) {
+			DPAA_BUS_ERR("QMAN initialization failed: %d",
+				     ret);
+			return ret;
+		}
+		ret = bman_global_init();
+		if (ret) {
+			DPAA_BUS_ERR("BMAN initialization failed: %d",
+				     ret);
+			return ret;
 		}
 	}
 	process_once = 1;
Signature · 1 line
2.17.1
#57 lore raw

PATCH v3 20/23 bus/dpaa: support shared ethernet MAC interface

In reply to Hemant Agrawal

From: Nipun Gupta <[email protected]>

DPAA can share an interface on classification criteria with kernel.

This patch enables default kernel driver to be used as a shared MAC interface with DPDK interface. (provided that VSP is enabled on that interface.)

---
 drivers/bus/dpaa/base/fman/fman.c | 149 +++++++++++++++++++++---------
 1 file changed, 105 insertions(+), 44 deletions(-)
drivers/bus/dpaa/base/fman/fman.c +105 -44
index 39102bc1f3..692071b4b0 100644
@@ -211,12 +211,16 @@ fman_if_init(const struct device_node *dpa_node)
 	const phandle *mac_phandle, *ports_phandle, *pools_phandle;
 	const phandle *tx_channel_id = NULL, *mac_addr, *cell_idx;
 	const phandle *rx_phandle, *tx_phandle;
+	const phandle *port_cell_idx, *ext_args_cell_idx;
+	const struct device_node *parent_node_ext_args;
 	uint64_t tx_phandle_host[4] = {0};
 	uint64_t rx_phandle_host[4] = {0};
 	uint64_t regs_addr_host = 0;
 	uint64_t cell_idx_host = 0;
+	uint64_t port_cell_idx_val = 0;
+	uint64_t ext_args_cell_idx_val = 0;
 
-	const struct device_node *mac_node = NULL, *tx_node;
+	const struct device_node *mac_node = NULL, *tx_node, *ext_args_node;
 	const struct device_node *pool_node, *fman_node, *rx_node;
 	const uint32_t *regs_addr = NULL;
 	const char *mname, *fname;
@@ -230,16 +234,112 @@ fman_if_init(const struct device_node *dpa_node)
 		return 0;
 
 	if (!of_device_is_compatible(dpa_node, "fsl,dpa-ethernet-init") &&
-		!of_device_is_compatible(dpa_node, "fsl,dpa-ethernet-shared")) {
+		!of_device_is_compatible(dpa_node, "fsl,dpa-ethernet")) {
 		return 0;
 	}
 
-	if (of_device_is_compatible(dpa_node, "fsl,dpa-ethernet-shared"))
-		is_shared = 1;
-
 	rprop = "fsl,qman-frame-queues-rx";
 	mprop = "fsl,fman-mac";
 
+	/* Obtain the MAC node used by this interface except macless */
+	mac_phandle = of_get_property(dpa_node, mprop, &lenp);
+	if (!mac_phandle) {
+		FMAN_ERR(-EINVAL, "%s: no %s\n", dname, mprop);
+		return -EINVAL;
+	}
+	assert(lenp == sizeof(phandle));
+	mac_node = of_find_node_by_phandle(*mac_phandle);
+	if (!mac_node) {
+		FMAN_ERR(-ENXIO, "%s: bad 'fsl,fman-mac\n", dname);
+		return -ENXIO;
+	}
+	mname = mac_node->full_name;
+
+	/* Extract the Rx and Tx ports */
+	ports_phandle = of_get_property(mac_node, "fsl,port-handles",
+					&lenp);
+	if (!ports_phandle)
+		ports_phandle = of_get_property(mac_node, "fsl,fman-ports",
+						&lenp);
+	if (!ports_phandle) {
+		FMAN_ERR(-EINVAL, "%s: no fsl,port-handles\n",
+			 mname);
+		return -EINVAL;
+	}
+	assert(lenp == (2 * sizeof(phandle)));
+	rx_node = of_find_node_by_phandle(ports_phandle[0]);
+	if (!rx_node) {
+		FMAN_ERR(-ENXIO, "%s: bad fsl,port-handle[0]\n", mname);
+		return -ENXIO;
+	}
+	tx_node = of_find_node_by_phandle(ports_phandle[1]);
+	if (!tx_node) {
+		FMAN_ERR(-ENXIO, "%s: bad fsl,port-handle[1]\n", mname);
+		return -ENXIO;
+	}
+
+	/* Check if the port is shared interface */
+	if (of_device_is_compatible(dpa_node, "fsl,dpa-ethernet")) {
+		port_cell_idx = of_get_property(rx_node, "cell-index", &lenp);
+		if (!port_cell_idx) {
+			FMAN_ERR(-ENXIO,
+				 "%s: no cell-index for port\n", mname);
+			return -ENXIO;
+		}
+		assert(lenp == sizeof(*port_cell_idx));
+		port_cell_idx_val =
+			of_read_number(port_cell_idx, lenp / sizeof(phandle));
+
+		if (of_device_is_compatible(rx_node, "fsl,fman-port-1g-rx"))
+			port_cell_idx_val -= 0x8;
+		else if (of_device_is_compatible(
+				rx_node, "fsl,fman-port-10g-rx"))
+			port_cell_idx_val -= 0x10;
+
+		parent_node_ext_args = of_find_compatible_node(NULL,
+			NULL, "fsl,fman-extended-args");
+		if (!parent_node_ext_args)
+			return 0;
+
+		for_each_child_node(parent_node_ext_args, ext_args_node) {
+			ext_args_cell_idx = of_get_property(ext_args_node,
+				"cell-index", &lenp);
+			if (!ext_args_cell_idx) {
+				FMAN_ERR(-ENXIO,
+					 "%s: no cell-index for ext args\n",
+					 mname);
+				return -ENXIO;
+			}
+			assert(lenp == sizeof(*ext_args_cell_idx));
+			ext_args_cell_idx_val =
+				of_read_number(ext_args_cell_idx, lenp /
+				sizeof(phandle));
+
+			if (port_cell_idx_val == ext_args_cell_idx_val) {
+				if (of_device_is_compatible(ext_args_node,
+					"fsl,fman-port-1g-rx-extended-args") &&
+					of_device_is_compatible(rx_node,
+					"fsl,fman-port-1g-rx")) {
+					if (of_get_property(ext_args_node,
+						"vsp-window", &lenp))
+						is_shared = 1;
+					break;
+				}
+				if (of_device_is_compatible(ext_args_node,
+					"fsl,fman-port-10g-rx-extended-args") &&
+					of_device_is_compatible(rx_node,
+					"fsl,fman-port-10g-rx")) {
+					if (of_get_property(ext_args_node,
+						"vsp-window", &lenp))
+						is_shared = 1;
+					break;
+				}
+			}
+		}
+		if (!is_shared)
+			return 0;
+	}
+
 	/* Allocate an object for this network interface */
 	__if = rte_malloc(NULL, sizeof(*__if), RTE_CACHE_LINE_SIZE);
 	if (!__if) {
@@ -253,20 +353,6 @@ fman_if_init(const struct device_node *dpa_node)
 	strlcpy(__if->node_path, dpa_node->full_name, PATH_MAX - 1);
 	__if->node_path[PATH_MAX - 1] = '\0';
 
-	/* Obtain the MAC node used by this interface except macless */
-	mac_phandle = of_get_property(dpa_node, mprop, &lenp);
-	if (!mac_phandle) {
-		FMAN_ERR(-EINVAL, "%s: no %s\n", dname, mprop);
-		goto err;
-	}
-	assert(lenp == sizeof(phandle));
-	mac_node = of_find_node_by_phandle(*mac_phandle);
-	if (!mac_node) {
-		FMAN_ERR(-ENXIO, "%s: bad 'fsl,fman-mac\n", dname);
-		goto err;
-	}
-	mname = mac_node->full_name;
-
 	/* Map the CCSR regs for the MAC node */
 	regs_addr = of_get_address(mac_node, 0, &__if->regs_size, NULL);
 	if (!regs_addr) {
@@ -290,7 +376,6 @@ fman_if_init(const struct device_node *dpa_node)
 	/* Get rid of endianness (issues). Convert to host byte order */
 	regs_addr_host = of_read_number(regs_addr, na);
 
-
 	/* Get the index of the Fman this i/f belongs to */
 	fman_node = of_get_parent(mac_node);
 	na = of_n_addr_cells(mac_node);
@@ -384,25 +469,6 @@ fman_if_init(const struct device_node *dpa_node)
 	}
 	memcpy(&__if->__if.mac_addr, mac_addr, ETHER_ADDR_LEN);
 
-	/* Extract the Tx port (it's the second of the two port handles)
-	 * and get its channel ID
-	 */
-	ports_phandle = of_get_property(mac_node, "fsl,port-handles",
-					&lenp);
-	if (!ports_phandle)
-		ports_phandle = of_get_property(mac_node, "fsl,fman-ports",
-						&lenp);
-	if (!ports_phandle) {
-		FMAN_ERR(-EINVAL, "%s: no fsl,port-handles\n",
-			 mname);
-		goto err;
-	}
-	assert(lenp == (2 * sizeof(phandle)));
-	tx_node = of_find_node_by_phandle(ports_phandle[1]);
-	if (!tx_node) {
-		FMAN_ERR(-ENXIO, "%s: bad fsl,port-handle[1]\n", mname);
-		goto err;
-	}
 	/* Extract the channel ID (from tx-port-handle) */
 	tx_channel_id = of_get_property(tx_node, "fsl,qman-channel-id",
 					&lenp);
@@ -412,11 +478,6 @@ fman_if_init(const struct device_node *dpa_node)
 		goto err;
 	}
 
-	rx_node = of_find_node_by_phandle(ports_phandle[0]);
-	if (!rx_node) {
-		FMAN_ERR(-ENXIO, "%s: bad fsl,port-handle[0]\n", mname);
-		goto err;
-	}
 	regs_addr = of_get_address(rx_node, 0, &__if->regs_size, NULL);
 	if (!regs_addr) {
 		FMAN_ERR(-EINVAL, "of_get_address(%s)\n", mname);
Signature · 1 line
2.17.1
#58 lore raw

PATCH v3 21/23 bus/dpaa: enhance checks for bus and device detection

In reply to Hemant Agrawal

1. It is not a error if no network device available. One can only use crypto device
2. Improve logging for failure in detecting the bus

---
 drivers/bus/dpaa/dpaa_bus.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/bus/dpaa/dpaa_bus.c +5 -3
index 37cf55d60b..173041c026 100644
@@ -521,16 +521,18 @@ rte_dpaa_bus_dev_build(void)
 	/* Get the interface configurations from device-tree */
 	dpaa_netcfg = netcfg_acquire();
 	if (!dpaa_netcfg) {
-		DPAA_BUS_LOG(ERR, "netcfg_acquire failed");
+		DPAA_BUS_LOG(ERR,
+			"netcfg failed: /dev/fsl_usdpaa device not available");
+		DPAA_BUS_WARN(
+			"Check if you are using USDPAA based device tree");
 		return -EINVAL;
 	}
 
 	RTE_LOG(NOTICE, EAL, "DPAA Bus Detected\n");
 
 	if (!dpaa_netcfg->num_ethports) {
-		DPAA_BUS_LOG(INFO, "no network interfaces available");
+		DPAA_BUS_LOG(INFO, "NO DPDK mapped net interfaces available");
 		/* This is not an error */
-		return 0;
 	}
 
 #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER
Signature · 1 line
2.17.1
#59 lore raw

PATCH v3 22/23 net/dpaa2: add Rx buf size support

In reply to Hemant Agrawal

This patch adds RX buf size support in queue info

---
 drivers/net/dpaa2/dpaa2_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/dpaa2/dpaa2_ethdev.c +6 -0
index 586d116227..0e7ebf4dc0 100644
@@ -2368,12 +2368,18 @@ dpaa2_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	struct rte_eth_rxq_info *qinfo)
 {
 	struct dpaa2_queue *rxq;
+	struct dpaa2_dev_priv *priv = dev->data->dev_private;
+	struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;
+	uint16_t max_frame_length;
 
 	rxq = (struct dpaa2_queue *)dev->data->rx_queues[queue_id];
 
 	qinfo->mp = rxq->mb_pool;
 	qinfo->scattered_rx = dev->data->scattered_rx;
 	qinfo->nb_desc = rxq->nb_desc;
+	if (dpni_get_max_frame_length(dpni, CMD_PRI_LOW, priv->token,
+				&max_frame_length) == 0)
+		qinfo->rx_buf_size = max_frame_length;
 
 	qinfo->conf.rx_free_thresh = 1;
 	qinfo->conf.rx_drop_en = 1;
Signature · 1 line
2.17.1
#60 lore raw

PATCH v3 23/23 net/dpaa: add Rx buf size support

In reply to Hemant Agrawal

This patch adds rx buf size support in rxq info for dpaa

---
 drivers/bus/dpaa/include/fsl_fman.h | 1 +
 drivers/bus/dpaa/version.map        | 1 +
 drivers/net/dpaa/dpaa_ethdev.c      | 7 +++++++
 3 files changed, 9 insertions(+)
drivers/bus/dpaa/include/fsl_fman.h +1 -0
index a3cf77f0e3..f3a5d05970 100644
@@ -139,6 +139,7 @@ __rte_internal
 void fman_if_set_sg(struct fman_if *fm_if, int enable);
 
 /* Get interface Max Frame length (MTU) */
+__rte_internal
 uint16_t fman_if_get_maxfrm(struct fman_if *fm_if);
 
 /* Set interface  Max Frame length (MTU) */
drivers/bus/dpaa/version.map +1 -0
index fe4f9ac5aa..1bd5a01ec5 100644
@@ -30,6 +30,7 @@ INTERNAL {
 	fman_if_get_fc_quanta;
 	fman_if_get_fc_threshold;
 	fman_if_get_fdoff;
+	fman_if_get_maxfrm;
 	fman_if_get_sg_enable;
 	fman_if_loopback_disable;
 	fman_if_loopback_enable;
drivers/net/dpaa/dpaa_ethdev.c +7 -0
index a3a3e7cb24..176943a8ea 100644
@@ -1521,12 +1521,19 @@ dpaa_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 {
 	struct dpaa_if *dpaa_intf = dev->data->dev_private;
 	struct qman_fq *rxq;
+	int ret;
 
 	rxq = dev->data->rx_queues[queue_id];
 
 	qinfo->mp = dpaa_intf->bp_info->mp;
 	qinfo->scattered_rx = dev->data->scattered_rx;
 	qinfo->nb_desc = rxq->nb_desc;
+
+	/* Report the HW Rx buffer length to user */
+	ret = fman_if_get_maxfrm(dev->process_private);
+	if (ret > 0)
+		qinfo->rx_buf_size = ret;
+
 	qinfo->conf.rx_free_thresh = 1;
 	qinfo->conf.rx_drop_en = 1;
 	qinfo->conf.rx_deferred_start = 0;
Signature · 1 line
2.17.1
#61 lore raw
In reply to Hemant Agrawal
Quoted 42 lines · Hemant Agrawal

This patch series adds changes to dpaaX ethernet pmd

1. Basic Traffic Management support for shaper and scheduler
2. Support external buffer in Transmit side.
3. Optimize the SG packet handling
4. Add support APIs in DPDMUX (SRIOV equivalent for DPAA2)
5. Fix isssues

v3: fix spelling issues, add rx buf size support
v2: add more patches and add TM documentation

Akhil Goyal (1):
net/dpaa2: add support for raw pattern in dpdmux

Apeksha Gupta (1):
net/dpaa2: dpdmux skip reset

Gagandeep Singh (1):
net/dpaa2: add traffic management driver

Hemant Agrawal (11):
net/dpaa2: allocate SGT table from first segment net/dpaa: support external buffers in Tx net/dpaa2: add support to configure dpdmux max Rx frame len net/dpaa2: support dpdmux to not drop parse err pkts net/dpaa2: add device args for enable Tx confirmation net/dpaa2: change Tx queue congestion settings mempool/dpaa2: support stats for secondary process bus/dpaa: secondary process init support bus/dpaa: enhance checks for bus and device detection net/dpaa2: add Rx buf size support
net/dpaa: add Rx buf size support

Nipun Gupta (6):
bus/dpaa: fix statistics reading net/dpaa2: support external buffers in Tx net/dpaa2: optionally enable error queues net/dpaa: do not release the cgr ranges net/dpaa: prevent multiple mp config on an device bus/dpaa: support shared ethernet MAC interface

Quoted 7 lines

Rohit Raj (2):
net/dpaa2: fix link get API implementation
net/dpaa: fix link get API implementation

Youri Querry (1):
bus/fslmc: fix to use ci value for qbman 5.0

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

Hemant, can you please send a release notes update for the added features, I will squash it later in next-net?