Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Willem de Bruijn <willemb@google.com>,
	Sunil Goutham <sgoutham@marvell.com>,
	Antoine Tenart <antoine.tenart@bootlin.com>
Subject: [PATCH v2 net-next 2/6] net: tso: double TSO_HEADER_SIZE value
Date: Wed, 17 Jun 2020 20:53:22 -0700	[thread overview]
Message-ID: <20200618035326.39686-3-edumazet@google.com> (raw)
In-Reply-To: <20200618035326.39686-1-edumazet@google.com>

Transport header size could be 60 bytes, and network header
size can also be 60 bytes. Add the Ethernet header and we
are above 128 bytes.

Since drivers using net/core/tso.c usually allocates
one DMA coherent piece of memory per TX queue, this patch
might cause issues if a driver was using too many slots.

For 1024 slots, we would need 256 KB of physically
contiguous memory instead of 128 KB.

Alternative fix would be to add checks in the fast path,
but this involves more work in all drivers using net/core/tso.c.

Fixes: f9cbe9a556af ("net: define the TSO header size in net/tso.h")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Antoine Tenart <antoine.tenart@bootlin.com>
---
 include/net/tso.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/tso.h b/include/net/tso.h
index 7e166a5703497fadf4662acc474f827b2754da78..c33dd00c161f7a6aa65f586b0ceede46af2e8730 100644
--- a/include/net/tso.h
+++ b/include/net/tso.h
@@ -4,7 +4,7 @@
 
 #include <net/ip.h>
 
-#define TSO_HEADER_SIZE		128
+#define TSO_HEADER_SIZE		256
 
 struct tso_t {
 	int next_frag_idx;
-- 
2.27.0.290.gba653c62da-goog


  parent reply	other threads:[~2020-06-18  3:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18  3:53 [PATCH v2 net-next 0/6] net: tso: expand to UDP support Eric Dumazet
2020-06-18  3:53 ` [PATCH v2 net-next 1/6] octeontx2-af: change (struct qmem)->entry_sz from u8 to u16 Eric Dumazet
2020-06-18  3:53 ` Eric Dumazet [this message]
2020-06-18  3:53 ` [PATCH v2 net-next 3/6] net: tso: shrink struct tso_t Eric Dumazet
2020-06-18  3:53 ` [PATCH v2 net-next 4/6] net: tso: constify tso_count_descs() and friends Eric Dumazet
2020-06-18  3:53 ` [PATCH v2 net-next 5/6] net: tso: cache transport header length Eric Dumazet
2020-06-18  3:53 ` [PATCH v2 net-next 6/6] net: tso: add UDP segmentation support Eric Dumazet
2020-06-19  3:46 ` [PATCH v2 net-next 0/6] net: tso: expand to UDP support David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200618035326.39686-3-edumazet@google.com \
    --to=edumazet@google.com \
    --cc=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sgoutham@marvell.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox