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 <shshaikh@marvell.com>
Reviewed-by: Rasesh Mody <rmody@marvell.com>
This commit is contained in:
Shahed Shaikh 2019-10-19 22:20:50 -07:00 committed by Ferruh Yigit
parent 58bb1ee4a5
commit 29bb154ff0
2 changed files with 6 additions and 3 deletions

View 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++) {

View 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;