Skip to content

Commit

Permalink
net/bonding: fix MTU set for slaves
Browse files Browse the repository at this point in the history
[ upstream commit 20a53b1 ]

ethdev requires device to be configured before setting MTU.

In bonding PMD, while configuring slaves, bonding first sets MTU later
configures them, which causes failure if slaves are not configured in
advance.

Fixing by changing the order in slave configure as requested in ethdev
layer, configure first and set MTU later.

Bugzilla ID: 864
Fixes: b26bee1 ("ethdev: forbid MTU set before device configure")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Yu Jiang <yux.jiang@intel.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
Ferruh Yigit authored and kevintraynor committed Feb 21, 2022
1 parent 9ac1343 commit 2c27da1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/net/bonding/rte_eth_bond_pmd.c
Expand Up @@ -1741,14 +1741,6 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
}
}

errval = rte_eth_dev_set_mtu(slave_eth_dev->data->port_id,
bonded_eth_dev->data->mtu);
if (errval != 0 && errval != -ENOTSUP) {
RTE_BOND_LOG(ERR, "rte_eth_dev_set_mtu: port %u, err (%d)",
slave_eth_dev->data->port_id, errval);
return errval;
}

/* Configure device */
errval = rte_eth_dev_configure(slave_eth_dev->data->port_id,
nb_rx_queues, nb_tx_queues,
Expand All @@ -1759,6 +1751,14 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
return errval;
}

errval = rte_eth_dev_set_mtu(slave_eth_dev->data->port_id,
bonded_eth_dev->data->mtu);
if (errval != 0 && errval != -ENOTSUP) {
RTE_BOND_LOG(ERR, "rte_eth_dev_set_mtu: port %u, err (%d)",
slave_eth_dev->data->port_id, errval);
return errval;
}

/* Setup Rx Queues */
for (q_id = 0; q_id < bonded_eth_dev->data->nb_rx_queues; q_id++) {
bd_rx_q = (struct bond_rx_queue *)bonded_eth_dev->data->rx_queues[q_id];
Expand Down

0 comments on commit 2c27da1

Please sign in to comment.