|
|
c7ffa4 |
From 33a2d6594945eb3278bfa441f79ae9a38ea538a0 Mon Sep 17 00:00:00 2001
|
|
|
c7ffa4 |
From: John Daley <johndale@cisco.com>
|
|
|
c7ffa4 |
Date: Wed, 4 Apr 2018 16:54:53 -0700
|
|
|
c7ffa4 |
Subject: [PATCH] net/enic: fix crash on MTU update with non-setup queues
|
|
|
c7ffa4 |
|
|
|
c7ffa4 |
The enic code called from rte_eth_dev_set_mtu() was assuming that the
|
|
|
c7ffa4 |
Rx queues are already set up via a call to rte_eth_tx_queue_setup().
|
|
|
c7ffa4 |
OVS calls rte_eth_dev_set_mtu() before rte_eth_rx_queue_setup() and
|
|
|
c7ffa4 |
a null pointer was dereferenced.
|
|
|
c7ffa4 |
|
|
|
c7ffa4 |
Fixes: c3e09182bcd6 ("net/enic: support scatter Rx in MTU update")
|
|
|
c7ffa4 |
Cc: stable@dpdk.org
|
|
|
c7ffa4 |
|
|
|
c7ffa4 |
Signed-off-by: John Daley <johndale@cisco.com>
|
|
|
c7ffa4 |
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
|
|
|
c7ffa4 |
---
|
|
|
c7ffa4 |
drivers/net/enic/enic_main.c | 2 ++
|
|
|
c7ffa4 |
1 file changed, 2 insertions(+)
|
|
|
c7ffa4 |
|
|
|
c7ffa4 |
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
|
|
|
c7ffa4 |
index d15d236f7..98d47752c 100644
|
|
|
c7ffa4 |
--- a/drivers/net/enic/enic_main.c
|
|
|
c7ffa4 |
+++ b/drivers/net/enic/enic_main.c
|
|
|
c7ffa4 |
@@ -1440,6 +1440,8 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
|
|
|
c7ffa4 |
/* free and reallocate RQs with the new MTU */
|
|
|
c7ffa4 |
for (rq_idx = 0; rq_idx < enic->rq_count; rq_idx++) {
|
|
|
c7ffa4 |
rq = &enic->rq[enic_rte_rq_idx_to_sop_idx(rq_idx)];
|
|
|
c7ffa4 |
+ if (!rq->in_use)
|
|
|
c7ffa4 |
+ continue;
|
|
|
c7ffa4 |
|
|
|
c7ffa4 |
enic_free_rq(rq);
|
|
|
c7ffa4 |
rc = enic_alloc_rq(enic, rq_idx, rq->socket_id, rq->mp,
|
|
|
c7ffa4 |
--
|
|
|
c7ffa4 |
2.14.3
|
|
|
c7ffa4 |
|