patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix maximum packet headers size for TSO
@ 2022-01-13 14:32 Alexander Kozyrev
  2022-01-18  8:33 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kozyrev @ 2022-01-13 14:32 UTC (permalink / raw)
  To: dev; +Cc: stable, rasland, viacheslavo, matan

The maximum packet headers size for TSO is calculated as a sum of
Ethernet, VLAN, IPv6 and TCP headers (plus inner headers).
The rationale  behind choosing IPv6 and TCP is their headers
are bigger than IPv4 and UDP respectively, giving us the maximum
possible headers size. But it is not true for L3 headers.
IPv4 header size (20 bytes) is smaller than IPv6 header size
(40 bytes) only in the default case. There are up to 10
optional header fields called Options in case IHL > 5.
This means that the maximum size of the IPv4 header is 60 bytes.

Choosing the wrong maximum packets headers size causes inability
to transmit multi-segment TSO packets with IPv4 Options present.
PMD check that it is possible to inline all the packet headers
and the packet headers size exceeds the expected maximum size.
The maximum packet headers size was set to 192 bytes before,
but its value has been reduced during Tx path refactor activity.
Restore the proper maximum packet headers size for TSO.

Fixes: 50724e1 ("net/mlx5: update Tx definitions")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_defs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h
index 36b384fa08..2d48fde010 100644
--- a/drivers/net/mlx5/mlx5_defs.h
+++ b/drivers/net/mlx5/mlx5_defs.h
@@ -50,7 +50,7 @@
 #define MLX5_MAX_XSTATS 32
 
 /* Maximum Packet headers size (L2+L3+L4) for TSO. */
-#define MLX5_MAX_TSO_HEADER (128u + 34u)
+#define MLX5_MAX_TSO_HEADER 192U
 
 /* Inline data size required by NICs. */
 #define MLX5_INLINE_HSIZE_NONE 0
-- 
2.18.2


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

* RE: [PATCH] net/mlx5: fix maximum packet headers size for TSO
  2022-01-13 14:32 [PATCH] net/mlx5: fix maximum packet headers size for TSO Alexander Kozyrev
@ 2022-01-18  8:33 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2022-01-18  8:33 UTC (permalink / raw)
  To: Alexander Kozyrev, dev; +Cc: stable, Slava Ovsiienko, Matan Azrad

Hi,

> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Thursday, January 13, 2022 4:32 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>
> Subject: [PATCH] net/mlx5: fix maximum packet headers size for TSO
> 
> The maximum packet headers size for TSO is calculated as a sum of
> Ethernet, VLAN, IPv6 and TCP headers (plus inner headers).
> The rationale  behind choosing IPv6 and TCP is their headers
> are bigger than IPv4 and UDP respectively, giving us the maximum
> possible headers size. But it is not true for L3 headers.
> IPv4 header size (20 bytes) is smaller than IPv6 header size
> (40 bytes) only in the default case. There are up to 10
> optional header fields called Options in case IHL > 5.
> This means that the maximum size of the IPv4 header is 60 bytes.
> 
> Choosing the wrong maximum packets headers size causes inability
> to transmit multi-segment TSO packets with IPv4 Options present.
> PMD check that it is possible to inline all the packet headers
> and the packet headers size exceeds the expected maximum size.
> The maximum packet headers size was set to 192 bytes before,
> but its value has been reduced during Tx path refactor activity.
> Restore the proper maximum packet headers size for TSO.
> 
> Fixes: 50724e1 ("net/mlx5: update Tx definitions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2022-01-18  8:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 14:32 [PATCH] net/mlx5: fix maximum packet headers size for TSO Alexander Kozyrev
2022-01-18  8:33 ` Raslan Darawsheh

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git