DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rmody@marvell.com>
To: <dev@dpdk.org>, <jerinj@marvell.com>, <ferruh.yigit@intel.com>
Cc: Rasesh Mody <rmody@marvell.com>,
	<GR-Everest-DPDK-Dev@marvell.com>, <stable@dpdk.org>,
	Igor Russkikh <irusskikh@marvell.com>
Subject: [dpdk-dev] [PATCH v3 1/2] net/qede: fix assignment of Rx/Tx handlers
Date: Thu, 14 May 2020 23:34:18 -0700	[thread overview]
Message-ID: <20200515063419.14525-1-rmody@marvell.com> (raw)
In-Reply-To: <20200505030943.1091-1-rmody@marvell.com>

Fix to assign dummy Rx/Tx handlers in dev_stop.
For MTU set, assignment of the appropriate Rx/Tx handlers will be
handled by dev_start/dev_stop.

Fixes: 81f8804992c9 ("net/qede: enhance Rx CPU utilization")
Fixes: 8de0c4201926 ("net/qede: fix odd number of queues usage in 100G mode")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
---
 drivers/net/qede/qede_ethdev.c | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 0b1fca9ac..d3d916e81 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -320,13 +320,19 @@ qede_interrupt_handler(void *param)
 }
 
 static void
-qede_assign_rxtx_handlers(struct rte_eth_dev *dev)
+qede_assign_rxtx_handlers(struct rte_eth_dev *dev, bool is_dummy)
 {
 	uint64_t tx_offloads = dev->data->dev_conf.txmode.offloads;
 	struct qede_dev *qdev = dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
 	bool use_tx_offload = false;
 
+	if (is_dummy) {
+		dev->rx_pkt_burst = qede_rxtx_pkts_dummy;
+		dev->tx_pkt_burst = qede_rxtx_pkts_dummy;
+		return;
+	}
+
 	if (ECORE_IS_CMT(edev)) {
 		dev->rx_pkt_burst = qede_recv_pkts_cmt;
 		dev->tx_pkt_burst = qede_xmit_pkts_cmt;
@@ -1153,7 +1159,9 @@ static int qede_dev_start(struct rte_eth_dev *eth_dev)
 	/* Start/resume traffic */
 	qede_fastpath_start(edev);
 
-	qede_assign_rxtx_handlers(eth_dev);
+	/* Assign I/O handlers */
+	qede_assign_rxtx_handlers(eth_dev, false);
+
 	DP_INFO(edev, "Device started\n");
 
 	return 0;
@@ -1175,6 +1183,11 @@ static void qede_dev_stop(struct rte_eth_dev *eth_dev)
 	/* Update link status */
 	qede_link_update(eth_dev, 0);
 
+	/* Replace I/O functions with dummy ones. It cannot
+	 * be set to NULL because rte_eth_rx_burst() doesn't check for NULL.
+	 */
+	qede_assign_rxtx_handlers(eth_dev, true);
+
 	/* Disable vport */
 	if (qede_activate_vport(eth_dev, false))
 		return;
@@ -2323,11 +2336,6 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
 			dev->data->min_rx_buf_size);
 		return -EINVAL;
 	}
-	/* Temporarily replace I/O functions with dummy ones. It cannot
-	 * be set to NULL because rte_eth_rx_burst() doesn't check for NULL.
-	 */
-	dev->rx_pkt_burst = qede_rxtx_pkts_dummy;
-	dev->tx_pkt_burst = qede_rxtx_pkts_dummy;
 	if (dev->data->dev_started) {
 		dev->data->dev_started = 0;
 		qede_dev_stop(dev);
@@ -2366,15 +2374,6 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
 	/* update max frame size */
 	dev->data->dev_conf.rxmode.max_rx_pkt_len = max_rx_pkt_len;
 
-	/* Reassign back */
-	qede_assign_rxtx_handlers(dev);
-	if (ECORE_IS_CMT(edev)) {
-		dev->rx_pkt_burst = qede_recv_pkts_cmt;
-		dev->tx_pkt_burst = qede_xmit_pkts_cmt;
-	} else {
-		dev->rx_pkt_burst = qede_recv_pkts;
-		dev->tx_pkt_burst = qede_xmit_pkts;
-	}
 	return 0;
 }
 
@@ -2577,7 +2576,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 	strncpy((char *)params.name, QEDE_PMD_VER_PREFIX,
 		QEDE_PMD_DRV_VER_STR_SIZE);
 
-	qede_assign_rxtx_handlers(eth_dev);
+	qede_assign_rxtx_handlers(eth_dev, true);
 	eth_dev->tx_pkt_prepare = qede_xmit_prep_pkts;
 
 	/* For CMT mode device do periodic polling for slowpath events.
-- 
2.18.0


  parent reply	other threads:[~2020-05-15  6:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05  3:09 [dpdk-dev] [PATCH " Rasesh Mody
2020-05-05  3:09 ` [dpdk-dev] [PATCH 2/2] net/qede: restore Tx queue setup Rasesh Mody
2020-05-05  6:44   ` Jerin Jacob
2020-05-05  8:59     ` Ferruh Yigit
2020-05-05  9:15       ` Thomas Monjalon
2020-05-06  2:43         ` [dpdk-dev] [EXT] " Rasesh Mody
2020-05-10  7:04           ` Jerin Jacob
2020-05-14  4:10             ` Rasesh Mody
2020-05-14  7:56               ` Jerin Jacob
2020-05-14 14:32           ` Ferruh Yigit
2020-05-14 22:43             ` Rasesh Mody
2020-05-15 10:39               ` Ferruh Yigit
2020-05-05  9:01 ` [dpdk-dev] [PATCH 1/2] net/qede: fix assignment of Rx/Tx handlers Ferruh Yigit
2020-05-06  2:34   ` [dpdk-dev] [EXT] " Rasesh Mody
2020-05-14  4:09 ` [dpdk-dev] [PATCH v2 " Rasesh Mody
2020-05-14  4:09 ` [dpdk-dev] [PATCH v2 2/2] examples/kni: fix MTU change to setup Tx queue Rasesh Mody
2020-05-14 15:33   ` Ferruh Yigit
2020-05-15 11:29   ` Ferruh Yigit
2020-05-19 16:31     ` Thomas Monjalon
2020-05-15  6:34 ` Rasesh Mody [this message]
2020-05-15 12:26   ` [dpdk-dev] [PATCH v3 1/2] net/qede: fix assignment of Rx/Tx handlers Jerin Jacob
2020-05-15  6:34 ` [dpdk-dev] [PATCH v3 2/2] net/qede: fix port reconfiguration Rasesh Mody

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=20200515063419.14525-1-rmody@marvell.com \
    --to=rmody@marvell.com \
    --cc=GR-Everest-DPDK-Dev@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=irusskikh@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).