Skip to content

Commit

Permalink
net/qede: fix setting MTU
Browse files Browse the repository at this point in the history
[ upstream commit 29bb154 ]

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: d121a6b ("net/qede: fix VF MTU update")

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Reviewed-by: Rasesh Mody <rmody@marvell.com>
  • Loading branch information
Shahed Shaikh authored and kevintraynor committed Dec 11, 2019
1 parent 5e8a1c2 commit 9e72106
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/qede/qede_ethdev.c
Expand Up @@ -1020,9 +1020,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 */
Expand Down Expand Up @@ -2206,7 +2208,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++) {
Expand Down
1 change: 1 addition & 0 deletions drivers/net/qede/qede_ethdev.h
Expand Up @@ -217,6 +217,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;
Expand Down

0 comments on commit 9e72106

Please sign in to comment.