[dpdk-dev] [PATCH] net/bonding: set MTU on slave configure

Chas Williams 3chas3 at gmail.com
Fri Feb 23 05:01:21 CET 2018


From: Chas Williams <chas3 at att.com>

When a slave is configured make sure that the slave's MTU
matches the bonding's idea of the MTU.

Signed-off-by: Chas Williams <chas3 at att.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index c34c3251f..b59ba9f7c 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1831,6 +1831,14 @@ 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,
-- 
2.13.6



More information about the dev mailing list