DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v2] ethdev: account for smaller MTU when setting default
@ 2023-11-08  6:05 Joshua Washington
  2023-11-08 15:07 ` Andrew Rybchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Joshua Washington @ 2023-11-08  6:05 UTC (permalink / raw)
  To: Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Hyong Youb Kim,
	Rosen Xu, Somnath Kotur, Huisong Li
  Cc: dev, Rushil Gupta, Joshua Washington

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.

Fixes: 1bb4a528c4 ("ethdev: fix max Rx packet length")
Signed-off-by: Joshua Washington <joshwash@google.com>
Signed-off-by: Rushil Gupta <rushilg@google.com>
---
 lib/ethdev/rte_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 9163ef47ea..3858983fcc 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -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);
-- 
2.42.0.869.gea05f2083d-goog


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ethdev: account for smaller MTU when setting default
  2023-11-08  6:05 [PATCH v2] ethdev: account for smaller MTU when setting default Joshua Washington
@ 2023-11-08 15:07 ` Andrew Rybchenko
  2023-11-08 17:05   ` Ajit Khaparde
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Rybchenko @ 2023-11-08 15:07 UTC (permalink / raw)
  To: Joshua Washington, Thomas Monjalon, Ferruh Yigit, Hyong Youb Kim,
	Rosen Xu, Somnath Kotur, Huisong Li
  Cc: dev, Rushil Gupta

On 11/8/23 09:05, Joshua Washington wrote:
> 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.
> 
> Fixes: 1bb4a528c4 ("ethdev: fix max Rx packet length")
> Signed-off-by: Joshua Washington <joshwash@google.com>
> Signed-off-by: Rushil Gupta <rushilg@google.com>

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ethdev: account for smaller MTU when setting default
  2023-11-08 15:07 ` Andrew Rybchenko
@ 2023-11-08 17:05   ` Ajit Khaparde
  2023-11-08 17:23     ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Ajit Khaparde @ 2023-11-08 17:05 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: Joshua Washington, Thomas Monjalon, Ferruh Yigit, Hyong Youb Kim,
	Rosen Xu, Somnath Kotur, Huisong Li, dev, Rushil Gupta

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

On Wed, Nov 8, 2023 at 7:07 AM Andrew Rybchenko
<andrew.rybchenko@oktetlabs.ru> wrote:
>
> On 11/8/23 09:05, Joshua Washington wrote:
> > 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.
> >
> > Fixes: 1bb4a528c4 ("ethdev: fix max Rx packet length")
> > Signed-off-by: Joshua Washington <joshwash@google.com>
> > Signed-off-by: Rushil Gupta <rushilg@google.com>
>
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

>
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ethdev: account for smaller MTU when setting default
  2023-11-08 17:05   ` Ajit Khaparde
@ 2023-11-08 17:23     ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2023-11-08 17:23 UTC (permalink / raw)
  To: Ajit Khaparde, Andrew Rybchenko
  Cc: Joshua Washington, Thomas Monjalon, Hyong Youb Kim, Rosen Xu,
	Somnath Kotur, Huisong Li, dev, Rushil Gupta

On 11/8/2023 5:05 PM, Ajit Khaparde wrote:
> On Wed, Nov 8, 2023 at 7:07 AM Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru> wrote:
>>
>> On 11/8/23 09:05, Joshua Washington wrote:
>>> 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.
>>>
>>> Fixes: 1bb4a528c4 ("ethdev: fix max Rx packet length")
>>> Signed-off-by: Joshua Washington <joshwash@google.com>
>>> Signed-off-by: Rushil Gupta <rushilg@google.com>
>>
>> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> 

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-08 17:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-08  6:05 [PATCH v2] ethdev: account for smaller MTU when setting default Joshua Washington
2023-11-08 15:07 ` Andrew Rybchenko
2023-11-08 17:05   ` Ajit Khaparde
2023-11-08 17:23     ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).