ethdev: account for smaller MTU when setting default
PATCH v2 1/1 ethdev: account for smaller MTU when setting default
Currently, if not specified in the user configuration, rte_eth_dev_configure() sets the MTU of the device to RTE_EHTER_MTU. This value could potentially be larger than the MTU that the device supports. This change updates the configured MTU to be the minimum of the maximum suported MTU and the default DPDK MTU.
--- lib/ethdev/rte_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
lib/ethdev/rte_ethdev.c +3 -1
@@ -1419,7 +1419,9 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, }if (dev_conf->rxmode.mtu ==0 ) - dev->data->dev_conf.rxmode.mtu =RTE_ETHER_MTU ; + dev->data->dev_conf.rxmode.mtu = + (dev_info.max_mtu ==0 ) ?RTE_ETHER_MTU : +RTE_MIN (dev_info.max_mtu,RTE_ETHER_MTU ); ret =eth_dev_validate_mtu (port_id, &dev_info, dev->data->dev_conf.rxmode.mtu);
Signature · 1 line
2.42.0.869.gea05f2083d-goog
Quoted 9 lines · Joshua Washington
Currently, if not specified in the user configuration,
rte_eth_dev_configure()sets the MTU of the device toRTE_EHTER_MTU. This value could potentially be larger than the MTU that the device supports. This change updates the configured MTU to be the minimum of the maximum suported MTU and the default DPDK MTU.Fixes 1bb4a528c4 ("ethdev: fix max Rx packet length")Signed-off-by Joshua Washington <[email protected]>Signed-off-by Rushil Gupta <[email protected]>
Ajit Khaparde
Acked-byQuoted 8 lines · Andrew Rybchenko
Quoted 6 lines · Joshua Washington
Currently, if not specified in the user configuration,
rte_eth_dev_configure()sets the MTU of the device toRTE_EHTER_MTU. This value could potentially be larger than the MTU that the device supports. This change updates the configured MTU to be the minimum of the maximum suported MTU and the default DPDK MTU.
Quoted 5 lines
Quoted 3 lines
Fixes 1bb4a528c4 ("ethdev: fix max Rx packet length")Signed-off-by Joshua Washington <[email protected]>Signed-off-by Rushil Gupta <[email protected]>Acked-by Andrew Rybchenko <[email protected]>
Quoted 2 lines
Ferruh Yigit
AppliedQuoted 10 lines · Ajit Khaparde
Quoted 8 lines · Andrew Rybchenko
Quoted 6 lines · Joshua Washington
Currently, if not specified in the user configuration,
rte_eth_dev_configure()sets the MTU of the device toRTE_EHTER_MTU. This value could potentially be larger than the MTU that the device supports. This change updates the configured MTU to be the minimum of the maximum suported MTU and the default DPDK MTU.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Fixes 1bb4a528c4 ("ethdev: fix max Rx packet length")Signed-off-by Joshua Washington <[email protected]>Signed-off-by Rushil Gupta <[email protected]>Acked-by Andrew Rybchenko <[email protected]>Acked-by Ajit Khaparde <[email protected]>
Applied to dpdk-next-net/main, thanks.