From: Shahed Shaikh Date: Sun, 20 Oct 2019 05:20:50 +0000 (-0700) Subject: net/qede: fix setting MTU X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=29bb154ff047d7fd7b0d4f08ce3ca25f1abfd1fe;p=dpdk.git net/qede: fix setting MTU New MTU value is not propagated to vport in HW when MTU update request is sent while ports are stopped. This patch fixes the logic error for above mentioned condition. Fixes: d121a6b5f781 ("net/qede: fix VF MTU update") Cc: stable@dpdk.org Signed-off-by: Shahed Shaikh Reviewed-by: Rasesh Mody --- diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 53fdfde9a8..42e2b50831 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1038,9 +1038,11 @@ static int qede_dev_start(struct rte_eth_dev *eth_dev) PMD_INIT_FUNC_TRACE(edev); /* Update MTU only if it has changed */ - if (eth_dev->data->mtu != qdev->mtu) { - if (qede_update_mtu(eth_dev, qdev->mtu)) + if (qdev->new_mtu && qdev->new_mtu != qdev->mtu) { + if (qede_update_mtu(eth_dev, qdev->new_mtu)) goto err; + qdev->mtu = qdev->new_mtu; + qdev->new_mtu = 0; } /* Configure TPA parameters */ @@ -2248,7 +2250,7 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) restart = true; } rte_delay_ms(1000); - qdev->mtu = mtu; + qdev->new_mtu = mtu; /* Fix up RX buf size for all queues of the port */ for (i = 0; i < qdev->num_rx_queues; i++) { diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h index 21115a077e..b988a73f23 100644 --- a/drivers/net/qede/qede_ethdev.h +++ b/drivers/net/qede/qede_ethdev.h @@ -225,6 +225,7 @@ struct qede_dev { struct qede_fastpath *fp_array; struct qede_fastpath_cmt *fp_array_cmt; uint16_t mtu; + uint16_t new_mtu; bool enable_tx_switching; bool rss_enable; struct rte_eth_rss_conf rss_conf;