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

Message ID 20180223040121.22056-1-3chas3@gmail.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Chas Williams Feb. 23, 2018, 4:01 a.m. UTC
  From: Chas Williams <chas3@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@att.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

Radu Nicolau March 14, 2018, 12:11 p.m. UTC | #1
On 2/23/2018 4:01 AM, Chas Williams wrote:
> From: Chas Williams <chas3@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@att.com>
> ---
>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
  
Ferruh Yigit March 16, 2018, 1:43 p.m. UTC | #2
On 3/14/2018 12:11 PM, Radu Nicolau wrote:
> 
> On 2/23/2018 4:01 AM, Chas Williams wrote:
>> From: Chas Williams <chas3@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@att.com>
>> ---
>>
> Acked-by: Radu Nicolau <radu.nicolau@intel.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

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,