[dpdk-dev,v2] net/sfc: fix crash on Tx queue release

Message ID 1490806435-16945-1-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Andrew Rybchenko March 29, 2017, 4:53 p.m. UTC
  Datapath TxQ handle is passed to release function, not control path.

Fixes: 19f92f3ec37c ("net/sfc: factor out libefx-based Tx datapath")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
Please, squash the patch into 19f92f3ec37c.

 drivers/net/sfc/sfc_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Ferruh Yigit March 31, 2017, 12:31 p.m. UTC | #1
On 3/29/2017 5:53 PM, Andrew Rybchenko wrote:
> Datapath TxQ handle is passed to release function, not control path.
> 
> Fixes: 19f92f3ec37c ("net/sfc: factor out libefx-based Tx datapath")
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
> Please, squash the patch into 19f92f3ec37c.

In next-net, squashed on top of relevant commit, thanks.
  

Patch

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index b745714..bba8b01 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -485,13 +485,15 @@  sfc_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 static void
 sfc_tx_queue_release(void *queue)
 {
-	struct sfc_txq *txq = queue;
+	struct sfc_dp_txq *dp_txq = queue;
+	struct sfc_txq *txq;
 	unsigned int sw_index;
 	struct sfc_adapter *sa;
 
-	if (txq == NULL)
+	if (dp_txq == NULL)
 		return;
 
+	txq = sfc_txq_by_dp_txq(dp_txq);
 	sw_index = sfc_txq_sw_index(txq);
 
 	SFC_ASSERT(txq->evq != NULL);