summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2015-10-08 08:30:40 +0000
committerhselasky <hselasky@FreeBSD.org>2015-10-08 08:30:40 +0000
commit7ff6dd508c4b1f7e015e548ec82f1bf936b529c0 (patch)
tree6af525c8e6da724ab25fd566f53589d0a1b2e47a /sys/netinet
parent7ba3672103058a6825dfa6d5734ca8acb8eadc4e (diff)
downloadFreeBSD-src-7ff6dd508c4b1f7e015e548ec82f1bf936b529c0.zip
FreeBSD-src-7ff6dd508c4b1f7e015e548ec82f1bf936b529c0.tar.gz
MFC r287775:
Update TSO limits to include all headers. To make driver programming easier the TSO limits are changed to reflect the values used in the BUSDMA tag a network adapter driver is using. The TCP/IP network stack will subtract space for all linklevel and protocol level headers and ensure that the full mbuf chain passed to the network adapter fits within the given limits. See r287775 for a more detailed description. Differential Revision: https://reviews.freebsd.org/D3477 Reviewed by: rmacklem
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_output.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index ba0ec40..f1196e1 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -807,7 +807,8 @@ send:
*/
if (if_hw_tsomax != 0) {
/* compute maximum TSO length */
- max_len = (if_hw_tsomax - hdrlen);
+ max_len = (if_hw_tsomax - hdrlen -
+ max_linkhdr);
if (max_len <= 0) {
len = 0;
} else if (len > max_len) {
@@ -822,6 +823,15 @@ send:
*/
if (if_hw_tsomaxsegcount != 0 &&
if_hw_tsomaxsegsize != 0) {
+ /*
+ * Subtract one segment for the LINK
+ * and TCP/IP headers mbuf that will
+ * be prepended to this mbuf chain
+ * after the code in this section
+ * limits the number of mbufs in the
+ * chain to if_hw_tsomaxsegcount.
+ */
+ if_hw_tsomaxsegcount -= 1;
max_len = 0;
mb = sbsndmbuf(&so->so_snd, off, &moff);
OpenPOWER on IntegriCloud