summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_reass.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2006-09-06 21:51:59 +0000
committerandre <andre@FreeBSD.org>2006-09-06 21:51:59 +0000
commitcb05913fd251edc3d35bcbeca73a8b681e2e58e8 (patch)
treeb5d4180eab9fff2a64a310b178d7e69374bbdacf /sys/netinet/tcp_reass.c
parent0dddb6a1cc063906ce418aa1a75805e68b4ec971 (diff)
downloadFreeBSD-src-cb05913fd251edc3d35bcbeca73a8b681e2e58e8.zip
FreeBSD-src-cb05913fd251edc3d35bcbeca73a8b681e2e58e8.tar.gz
First step of TSO (TCP segmentation offload) support in our network stack.
o add IFCAP_TSO[46] for drivers to announce this capability for IPv4 and IPv6 o add CSUM_TSO flag to mbuf pkthdr csum_flags field o add tso_segsz field to mbuf pkthdr o enhance ip_output() packet length check to allow for large TSO packets o extend tcp_maxmtu[46]() with a flag pointer to pass interface capabilities o adjust all callers of tcp_maxmtu[46]() accordingly Discussed on: -current, -net Sponsored by: TCP/IP Optimization Fundraise 2005
Diffstat (limited to 'sys/netinet/tcp_reass.c')
-rw-r--r--sys/netinet/tcp_reass.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index 86f9325..0699193 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -2857,6 +2857,7 @@ tcp_mss(tp, offer)
struct socket *so;
struct hc_metrics_lite metrics;
int origoffer = offer;
+ int mtuflags = 0;
#ifdef INET6
int isipv6 = ((inp->inp_vflag & INP_IPV6) != 0) ? 1 : 0;
size_t min_protoh = isipv6 ?
@@ -2869,12 +2870,12 @@ tcp_mss(tp, offer)
/* initialize */
#ifdef INET6
if (isipv6) {
- maxmtu = tcp_maxmtu6(&inp->inp_inc);
+ maxmtu = tcp_maxmtu6(&inp->inp_inc, &mtuflags);
tp->t_maxopd = tp->t_maxseg = tcp_v6mssdflt;
} else
#endif
{
- maxmtu = tcp_maxmtu(&inp->inp_inc);
+ maxmtu = tcp_maxmtu(&inp->inp_inc, &mtuflags);
tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
}
so = inp->inp_socket;
@@ -3081,6 +3082,10 @@ tcp_mss(tp, offer)
tp->snd_cwnd = mss * ss_fltsz_local;
else
tp->snd_cwnd = mss * ss_fltsz;
+
+ /* Check the interface for TSO capabilities. */
+ if (mtuflags & CSUM_TSO)
+ tp->t_flags |= TF_TSO;
}
/*
@@ -3103,14 +3108,14 @@ tcp_mssopt(inc)
#ifdef INET6
if (isipv6) {
mss = tcp_v6mssdflt;
- maxmtu = tcp_maxmtu6(inc);
+ maxmtu = tcp_maxmtu6(inc, NULL);
thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */
min_protoh = sizeof(struct ip6_hdr) + sizeof(struct tcphdr);
} else
#endif
{
mss = tcp_mssdflt;
- maxmtu = tcp_maxmtu(inc);
+ maxmtu = tcp_maxmtu(inc, NULL);
thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */
min_protoh = sizeof(struct tcpiphdr);
}
OpenPOWER on IntegriCloud