From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A5820A046B for ; Tue, 23 Jul 2019 03:03:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 959A21BFC7; Tue, 23 Jul 2019 03:03:45 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id CBCB11BFB9 for ; Tue, 23 Jul 2019 03:03:44 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Jul 2019 04:03:40 +0300 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x6N11Hg6026580; Tue, 23 Jul 2019 04:03:39 +0300 From: Yongseok Koh To: Shahed Shaikh Cc: dpdk stable Date: Mon, 22 Jul 2019 18:00:47 -0700 Message-Id: <20190723010115.6446-80-yskoh@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190723010115.6446-1-yskoh@mellanox.com> References: <20190723010115.6446-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnx2x: fix DMAE timeout' has been queued to LTS release 17.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 17.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objection by 07/27/19. So please shout if anyone has objection. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Yongseok --- >From 78d871bd76608549cd0f2f74755a82085f1da99b Mon Sep 17 00:00:00 2001 From: Shahed Shaikh Date: Thu, 11 Apr 2019 18:47:40 -0700 Subject: [PATCH] net/bnx2x: fix DMAE timeout [ upstream commit e166e0db8cf6c0e391a40f1a75a678bec930c970 ] In some cases, DPDK application may send packets while PMD is going through load or unload flow. This causes firmware to access invalid/unallocated memory to process transmit buffer. Which results in error on PCI bus and chip further blocks access to host, causing a DMAE timeout. Fix this issue by installing dummy empty transmit and receive handlers at the beginning of unload path (rte_eth_dev_stop()) and install actual transmit and receive handlers after successful load of the PMD port (rte_eth_dev_start()). This way, application won't be able to send packets while device is going through load/unload flow. Fixes: 540a211084a7 ("bnx2x: driver core") Signed-off-by: Shahed Shaikh --- drivers/net/bnx2x/bnx2x_ethdev.c | 9 ++++----- drivers/net/bnx2x/bnx2x_rxtx.c | 21 ++++++++++++++++----- drivers/net/bnx2x/bnx2x_rxtx.h | 3 ++- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index 70f5d797db..997e9ba1a0 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -297,6 +297,7 @@ bnx2x_dev_configure(struct rte_eth_dev *dev) return -ENXIO; } + bnx2x_dev_rxtx_init_dummy(dev); return 0; } @@ -326,11 +327,7 @@ bnx2x_dev_start(struct rte_eth_dev *dev) PMD_DRV_LOG(ERR, sc, "rte_intr_enable failed"); } - ret = bnx2x_dev_rx_init(dev); - if (ret != 0) { - PMD_DRV_LOG(DEBUG, sc, "bnx2x_dev_rx_init returned error code"); - return -3; - } + bnx2x_dev_rxtx_init(dev); bnx2x_print_device_info(sc); @@ -345,6 +342,8 @@ bnx2x_dev_stop(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(sc); + bnx2x_dev_rxtx_init_dummy(dev); + if (IS_PF(sc)) { rte_intr_disable(&sc->pci_dev->intr_handle); rte_intr_callback_unregister(&sc->pci_dev->intr_handle, diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c index fdbc90e9bb..5ebe66790a 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.c +++ b/drivers/net/bnx2x/bnx2x_rxtx.c @@ -323,7 +323,6 @@ bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev, txq->tx_bd_tail = 0; txq->tx_bd_head = 0; txq->nb_tx_avail = txq->nb_tx_desc; - dev->tx_pkt_burst = bnx2x_xmit_pkts; dev->data->tx_queues[queue_idx] = txq; if (!sc->tx_queues) sc->tx_queues = dev->data->tx_queues; @@ -452,14 +451,26 @@ next_rx: return nb_rx; } -int -bnx2x_dev_rx_init(struct rte_eth_dev *dev) +static uint16_t +bnx2x_rxtx_pkts_dummy(__rte_unused void *p_rxq, + __rte_unused struct rte_mbuf **rx_pkts, + __rte_unused uint16_t nb_pkts) { - dev->rx_pkt_burst = bnx2x_recv_pkts; - return 0; } +void bnx2x_dev_rxtx_init_dummy(struct rte_eth_dev *dev) +{ + dev->rx_pkt_burst = bnx2x_rxtx_pkts_dummy; + dev->tx_pkt_burst = bnx2x_rxtx_pkts_dummy; +} + +void bnx2x_dev_rxtx_init(struct rte_eth_dev *dev) +{ + dev->rx_pkt_burst = bnx2x_recv_pkts; + dev->tx_pkt_burst = bnx2x_xmit_pkts; +} + void bnx2x_dev_clear_queues(struct rte_eth_dev *dev) { diff --git a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h index 9600e0f1ce..b2c1f881b1 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.h +++ b/drivers/net/bnx2x/bnx2x_rxtx.h @@ -77,7 +77,8 @@ int bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, void bnx2x_dev_rx_queue_release(void *rxq); void bnx2x_dev_tx_queue_release(void *txq); -int bnx2x_dev_rx_init(struct rte_eth_dev *dev); +void bnx2x_dev_rxtx_init(struct rte_eth_dev *dev); +void bnx2x_dev_rxtx_init_dummy(struct rte_eth_dev *dev); void bnx2x_dev_clear_queues(struct rte_eth_dev *dev); #endif /* _BNX2X_RXTX_H_ */ -- 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-07-22 17:55:10.786067293 -0700 +++ 0080-net-bnx2x-fix-DMAE-timeout.patch 2019-07-22 17:55:06.345473000 -0700 @@ -1,8 +1,10 @@ -From e166e0db8cf6c0e391a40f1a75a678bec930c970 Mon Sep 17 00:00:00 2001 +From 78d871bd76608549cd0f2f74755a82085f1da99b Mon Sep 17 00:00:00 2001 From: Shahed Shaikh Date: Thu, 11 Apr 2019 18:47:40 -0700 Subject: [PATCH] net/bnx2x: fix DMAE timeout +[ upstream commit e166e0db8cf6c0e391a40f1a75a678bec930c970 ] + In some cases, DPDK application may send packets while PMD is going through load or unload flow. This causes firmware to access invalid/unallocated @@ -18,7 +20,6 @@ load/unload flow. Fixes: 540a211084a7 ("bnx2x: driver core") -Cc: stable@dpdk.org Signed-off-by: Shahed Shaikh --- @@ -28,10 +29,10 @@ 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c -index bcb899a57c..f85766c687 100644 +index 70f5d797db..997e9ba1a0 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c -@@ -213,6 +213,7 @@ bnx2x_dev_configure(struct rte_eth_dev *dev) +@@ -297,6 +297,7 @@ bnx2x_dev_configure(struct rte_eth_dev *dev) return -ENXIO; } @@ -39,7 +40,7 @@ return 0; } -@@ -242,11 +243,7 @@ bnx2x_dev_start(struct rte_eth_dev *dev) +@@ -326,11 +327,7 @@ bnx2x_dev_start(struct rte_eth_dev *dev) PMD_DRV_LOG(ERR, sc, "rte_intr_enable failed"); } @@ -52,7 +53,7 @@ bnx2x_print_device_info(sc); -@@ -261,6 +258,8 @@ bnx2x_dev_stop(struct rte_eth_dev *dev) +@@ -345,6 +342,8 @@ bnx2x_dev_stop(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(sc); @@ -62,10 +63,10 @@ rte_intr_disable(&sc->pci_dev->intr_handle); rte_intr_callback_unregister(&sc->pci_dev->intr_handle, diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c -index ca28aaccfa..e5a2b25b56 100644 +index fdbc90e9bb..5ebe66790a 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.c +++ b/drivers/net/bnx2x/bnx2x_rxtx.c -@@ -311,7 +311,6 @@ bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev, +@@ -323,7 +323,6 @@ bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev, txq->tx_bd_tail = 0; txq->tx_bd_head = 0; txq->nb_tx_avail = txq->nb_tx_desc; @@ -73,7 +74,7 @@ dev->data->tx_queues[queue_idx] = txq; if (!sc->tx_queues) sc->tx_queues = dev->data->tx_queues; -@@ -441,14 +440,26 @@ next_rx: +@@ -452,14 +451,26 @@ next_rx: return nb_rx; } @@ -105,10 +106,10 @@ bnx2x_dev_clear_queues(struct rte_eth_dev *dev) { diff --git a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h -index 6ad4928c10..3f4692b47d 100644 +index 9600e0f1ce..b2c1f881b1 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.h +++ b/drivers/net/bnx2x/bnx2x_rxtx.h -@@ -74,7 +74,8 @@ int bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, +@@ -77,7 +77,8 @@ int bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, void bnx2x_dev_rx_queue_release(void *rxq); void bnx2x_dev_tx_queue_release(void *txq);