Skip to content

Conversation

@rjarry
Copy link
Collaborator

@rjarry rjarry commented Jun 27, 2025

No description provided.

@rjarry rjarry force-pushed the max-mtu branch 3 times, most recently from 5b0c6a6 to e83d3e9 Compare June 27, 2025 12:45
@rjarry rjarry force-pushed the max-mtu branch 4 times, most recently from 7c1c790 to 081c683 Compare June 27, 2025 13:55
This partially reverts commit 62071f3.

This is too risky, the stack does not support multi segment in a safe
way. Keep the high MTU test.

Also, enabling scatter/gather lowers performance with some drivers:

	DRIVER  TEST      RX/TX           PKT/S
	mlx5    ipv4_fwd  scatter/gather  15.5M (-0.6%)
	mlx5    ipv4_fwd  simple          15.6M
	ice     ipv4_fwd  scatter/gather  13.8M (-12.7%)
	ice     ipv4_fwd  simple          15.8M

Signed-off-by: Maxime Leroy <[email protected]>
Signed-off-by: Robin Jarry <[email protected]>
rjarry added 3 commits June 27, 2025 17:24
Add a new parameter to enforce the maximum MTU on ports. Use the
provided value to determine the size of mbuf segments.

By default, the maximum MTU is set to 1800 which should cover most
standard use cases.

Increase the amount of allocated memory in test mode to allow creating
ports with bigger mbufs.

NB: larger mbufs lowers performance with some drivers:

	DRIVER  TEST      MBUF_SIZE  PERF
	mlx5    ipv4_fwd  2K         15.6M
	mlx5    ipv4_fwd  16K        15.5M (-0.6%)
	ice     ipv4_fwd  2K         15.8M
	ice     ipv4_fwd  16K        14.7M (-7.0%)

Signed-off-by: Robin Jarry <[email protected]>
Only ports have a MTU value which is initialized from whatever hardware
has. Ensure VLAN interfaces always have the same MTU as their parent
port. Initialize IPIP interfaces at 1480 bytes (1500 minus an extra IP
header).

Signed-off-by: Robin Jarry <[email protected]>
Currently, we don't check if the packets transmitted will fit in the
configured MTU of the output port.

Before proceeding further, drop the packets if they are larger than the
configured MTU.

Some day, we will need to support fragmentation for IPv4 and sending an
ICMP6 "packet too big" error for IPv6.

Signed-off-by: Robin Jarry <[email protected]>
const struct gr_iface conf = {
.flags = iface->flags,
.mtu = iface->mtu,
.mtu = iface->mtu ?: 1480,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which case, iface->mtu is zero ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless users have specified a value for mtu in the initial interface creation message, it will be 0. It was OK until now since we'll drop packets that are bigger than output interface MTU.

I chose to initialize it to 1480 which seems like a good default.

Copy link
Collaborator

@maxime-leroy maxime-leroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ICMP too big must also sent for IPV4 with DF bit set.

We don't have any function to send packets ?

@rjarry
Copy link
Collaborator Author

rjarry commented Jun 29, 2025

ICMP too big must also sent for IPV4 with DF bit set.

We don't have any function to send packets ?

We do but at the moment, we don't support neither fragmentation nor sending ICMP too big packets.

This will be implemented later.

@maxime-leroy maxime-leroy merged commit 3e58701 into DPDK:main Jun 30, 2025
8 checks passed
@rjarry rjarry deleted the max-mtu branch July 1, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants