DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org, ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH v2 13/20] net/dpaa2: add device args for enable Tx confirmation
Date: Thu, 11 Feb 2021 19:46:13 +0530
Message-ID: <20210211141620.12482-14-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20210211141620.12482-1-hemant.agrawal@nxp.com>

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.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 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(-)

diff --git a/doc/guides/nics/dpaa2.rst b/doc/guides/nics/dpaa2.rst
index 893e87e714..4eec8fcdd9 100644
--- a/doc/guides/nics/dpaa2.rst
+++ b/doc/guides/nics/dpaa2.rst
@@ -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
 -------------
 
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 490eb4b3f4..4b3eb7f5c9 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -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);
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h
index 9837eb62c8..becdb50055 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.h
+++ b/drivers/net/dpaa2/dpaa2_ethdev.h
@@ -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;
-- 
2.17.1


  parent reply	other threads:[~2021-02-11 14:29 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20 14:27 [dpdk-dev] [PATCH 0/7] NXP DPAAx ethernet PMD changes Hemant Agrawal
2021-01-20 14:27 ` [dpdk-dev] [PATCH 1/7] bus/fslmc: fix to use ci value for qbman 5.0 Hemant Agrawal
2021-02-02 11:36   ` Ferruh Yigit
2021-02-04 12:42     ` Hemant Agrawal
2021-01-20 14:27 ` [dpdk-dev] [PATCH 2/7] net/dpaa2: fix link get API implementation Hemant Agrawal
2021-01-20 14:27 ` [dpdk-dev] [PATCH 3/7] net/dpaa2: allocate SGT table from first segment Hemant Agrawal
2021-01-20 14:27 ` [dpdk-dev] [PATCH 4/7] net/dpaa2: support external buffers in Tx Hemant Agrawal
2021-01-20 14:27 ` [dpdk-dev] [PATCH 5/7] net/dpaa: " Hemant Agrawal
2021-01-20 14:27 ` [dpdk-dev] [PATCH 6/7] net/dpaa2: add traffic management driver Hemant Agrawal
2021-02-02 11:41   ` Ferruh Yigit
2021-02-04 10:47     ` Hemant Agrawal
2021-01-20 14:27 ` [dpdk-dev] [PATCH 7/7] net/dpaa2: add support to configure dpdmux max Rx frame len Hemant Agrawal
2021-02-02 11:38   ` Ferruh Yigit
2021-02-04 10:46     ` Hemant Agrawal
2021-01-20 14:27 ` [dpdk-dev] [PATCH 0/7] NXP DPAAx ethernet PMD changes Hemant Agrawal
2021-02-11 14:16 ` [dpdk-dev] [PATCH v2 00/20] " Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 01/20] bus/fslmc: fix to use ci value for qbman 5.0 Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 02/20] bus/dpaa: fix statistics reading Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 03/20] net/dpaa2: fix link get API implementation Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 04/20] net/dpaa: " Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 05/20] net/dpaa2: allocate SGT table from first segment Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 06/20] net/dpaa2: support external buffers in Tx Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 07/20] net/dpaa: " Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 08/20] net/dpaa2: add traffic management driver Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 09/20] net/dpaa2: add support to configure dpdmux max Rx frame len Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 10/20] net/dpaa2: add support for raw pattern in dpdmux Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 11/20] net/dpaa2: dpdmux skip reset Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 12/20] net/dpaa2: support dpdmux to not drop parse err pkts Hemant Agrawal
2021-02-11 14:16   ` Hemant Agrawal [this message]
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 14/20] net/dpaa2: optionally enable error queues Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 15/20] mempool/dpaa2: support stats for secondary process Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 16/20] net/dpaa: do not release the cgr ranges Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 17/20] net/dpaa: prevent multiple mp config on an device Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 18/20] bus/dpaa: secondary process init support Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 19/20] bus/dpaa: support shared ethernet MAC interface Hemant Agrawal
2021-02-11 14:16   ` [dpdk-dev] [PATCH v2 20/20] bus/dpaa: enhance checks for bus and device detection Hemant Agrawal
2021-02-24 12:42   ` [dpdk-dev] [PATCH v3 00/23] NXP DPAAx ethernet PMD changes Hemant Agrawal
2021-02-24 12:42     ` [dpdk-dev] [PATCH v3 01/23] bus/fslmc: fix to use ci value for qbman 5.0 Hemant Agrawal
2021-02-24 12:42     ` [dpdk-dev] [PATCH v3 02/23] bus/dpaa: fix statistics reading Hemant Agrawal
2021-02-24 12:42     ` [dpdk-dev] [PATCH v3 03/23] net/dpaa2: fix link get API implementation Hemant Agrawal
2021-02-24 12:42     ` [dpdk-dev] [PATCH v3 04/23] net/dpaa: " Hemant Agrawal
2021-02-24 12:42     ` [dpdk-dev] [PATCH v3 05/23] net/dpaa2: allocate SGT table from first segment Hemant Agrawal
2021-02-24 12:42     ` [dpdk-dev] [PATCH v3 06/23] net/dpaa2: support external buffers in Tx Hemant Agrawal
2021-02-24 12:42     ` [dpdk-dev] [PATCH v3 07/23] net/dpaa: " Hemant Agrawal
2021-02-24 12:42     ` [dpdk-dev] [PATCH v3 08/23] net/dpaa2: add traffic management driver Hemant Agrawal
2021-02-24 12:42     ` [dpdk-dev] [PATCH v3 09/23] net/dpaa2: add support to configure dpdmux max Rx frame len Hemant Agrawal
2021-02-24 17:22       ` Ferruh Yigit
2021-02-24 12:42     ` [dpdk-dev] [PATCH v3 10/23] net/dpaa2: add support for raw pattern in dpdmux Hemant Agrawal
2021-02-24 12:42     ` [dpdk-dev] [PATCH v3 11/23] net/dpaa2: dpdmux skip reset Hemant Agrawal
2021-02-24 12:43     ` [dpdk-dev] [PATCH v3 12/23] net/dpaa2: support dpdmux to not drop parse err pkts Hemant Agrawal
2021-02-24 12:43     ` [dpdk-dev] [PATCH v3 13/23] net/dpaa2: add device args for enable Tx confirmation Hemant Agrawal
2021-02-24 12:43     ` [dpdk-dev] [PATCH v3 14/23] net/dpaa2: optionally enable error queues Hemant Agrawal
2021-02-24 12:43     ` [dpdk-dev] [PATCH v3 15/23] net/dpaa2: change Tx queue congestion settings Hemant Agrawal
2021-02-24 12:43     ` [dpdk-dev] [PATCH v3 16/23] mempool/dpaa2: support stats for secondary process Hemant Agrawal
2021-02-24 12:43     ` [dpdk-dev] [PATCH v3 17/23] net/dpaa: do not release the cgr ranges Hemant Agrawal
2021-02-24 12:43     ` [dpdk-dev] [PATCH v3 18/23] net/dpaa: prevent multiple mp config on an device Hemant Agrawal
2021-02-24 12:43     ` [dpdk-dev] [PATCH v3 19/23] bus/dpaa: secondary process init support Hemant Agrawal
2021-02-24 12:43     ` [dpdk-dev] [PATCH v3 20/23] bus/dpaa: support shared ethernet MAC interface Hemant Agrawal
2021-02-24 12:43     ` [dpdk-dev] [PATCH v3 21/23] bus/dpaa: enhance checks for bus and device detection Hemant Agrawal
2021-02-24 12:43     ` [dpdk-dev] [PATCH v3 22/23] net/dpaa2: add Rx buf size support Hemant Agrawal
2021-02-24 12:43     ` [dpdk-dev] [PATCH v3 23/23] net/dpaa: " Hemant Agrawal
2021-02-24 17:23     ` [dpdk-dev] [PATCH v3 00/23] NXP DPAAx ethernet PMD changes Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210211141620.12482-14-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

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

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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

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

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

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


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