]> git.droids-corp.org - dpdk.git/commitdiff
net/qede: fix setting MTU
authorShahed Shaikh <shshaikh@marvell.com>
Sun, 20 Oct 2019 05:20:50 +0000 (22:20 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Nov 2019 22:15:04 +0000 (23:15 +0100)
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 <shshaikh@marvell.com>
Reviewed-by: Rasesh Mody <rmody@marvell.com>
drivers/net/qede/qede_ethdev.c
drivers/net/qede/qede_ethdev.h

index 53fdfde9a8604bbba984c7c20113ab6118a6a128..42e2b50831e956f2d50bd893578691882deef7eb 100644 (file)
@@ -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++) {
index 21115a077e112cc35d9983ff3d966fae6d9494dc..b988a73f2363cb8413860738f23fc61749a4139d 100644 (file)
@@ -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;