FreeBSD Bugzilla – Attachment 13039 Details for
Bug 24959
[patch] proper TCP_NOPUSH/TCP_CORK compatibility
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 5.95 KB, created by
Tony Finch
on 2001-02-08 22:30:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Tony Finch
Created:
2001-02-08 22:30:01 UTC
Size:
5.95 KB
patch
obsolete
>Index: alpha/linux/linux.h >=================================================================== >RCS file: /home/ncvs/src/sys/alpha/linux/linux.h,v >retrieving revision 1.46.2.2 >diff -u -r1.46.2.2 linux.h >--- alpha/linux/linux.h 2000/11/22 15:22:43 1.46.2.2 >+++ alpha/linux/linux.h 2001/02/05 23:35:51 >@@ -377,6 +377,10 @@ > #define LINUX_IP_ADD_MEMBERSHIP 35 > #define LINUX_IP_DROP_MEMBERSHIP 36 > >+#define LINUX_TCP_NODELAY 1 >+#define LINUX_TCP_MAXSEG 2 >+#define LINUX_TCP_CORK 3 >+ > struct linux_sockaddr { > u_short sa_family; > char sa_data[14]; >Index: compat/linux/linux_socket.c >=================================================================== >RCS file: /home/ncvs/src/sys/compat/linux/linux_socket.c,v >retrieving revision 1.19.2.3 >diff -u -r1.19.2.3 linux_socket.c >--- compat/linux/linux_socket.c 2000/11/22 15:39:01 1.19.2.3 >+++ compat/linux/linux_socket.c 2001/02/08 21:25:38 >@@ -46,6 +46,7 @@ > #include <netinet/in.h> > #include <netinet/in_systm.h> > #include <netinet/ip.h> >+#include <netinet/tcp.h> > > #include <machine/../linux/linux.h> > #ifdef __alpha__ >@@ -89,6 +90,21 @@ > } > > static int >+linux_to_bsd_tcp_sockopt(int opt) >+{ >+ >+ switch (opt) { >+ case LINUX_TCP_NODELAY: >+ return (TCP_NODELAY); >+ case LINUX_TCP_MAXSEG: >+ return (TCP_MAXSEG); >+ case LINUX_TCP_CORK: >+ return (TCP_CORK); >+ } >+ return (-1); >+} >+ >+static int > linux_to_bsd_ip_sockopt(int opt) > { > >@@ -768,8 +784,7 @@ > name = linux_to_bsd_ip_sockopt(linux_args.optname); > break; > case IPPROTO_TCP: >- /* Linux TCP option values match BSD's */ >- name = linux_args.optname; >+ name = linux_to_bsd_tcp_sockopt(linux_args.optname); > break; > default: > name = -1; >Index: i386/linux/linux.h >=================================================================== >RCS file: /home/ncvs/src/sys/i386/linux/linux.h,v >retrieving revision 1.41.2.1 >diff -u -r1.41.2.1 linux.h >--- i386/linux/linux.h 2000/05/09 17:41:24 1.41.2.1 >+++ i386/linux/linux.h 2001/02/05 23:35:24 >@@ -375,6 +375,10 @@ > #define LINUX_IP_ADD_MEMBERSHIP 35 > #define LINUX_IP_DROP_MEMBERSHIP 36 > >+#define LINUX_TCP_NODELAY 1 >+#define LINUX_TCP_MAXSEG 2 >+#define LINUX_TCP_CORK 3 >+ > struct linux_sockaddr { > u_short sa_family; > char sa_data[14]; >Index: netinet/tcp.h >=================================================================== >RCS file: /home/ncvs/src/sys/netinet/tcp.h,v >retrieving revision 1.13.2.2 >diff -u -r1.13.2.2 tcp.h >--- netinet/tcp.h 2001/01/09 18:25:18 1.13.2.2 >+++ netinet/tcp.h 2001/02/08 21:10:37 >@@ -129,7 +129,8 @@ > */ > #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ > #define TCP_MAXSEG 0x02 /* set maximum segment size */ >-#define TCP_NOPUSH 0x04 /* don't push last block of write */ >+#define TCP_CORK 0x03 /* don't push last block of write */ >+#define TCP_NOPUSH 0x04 /* ditto and also allow TAO on listen */ > #define TCP_NOOPT 0x08 /* don't use TCP options */ > > #endif >Index: netinet/tcp_input.c >=================================================================== >RCS file: /home/ncvs/src/sys/netinet/tcp_input.c,v >retrieving revision 1.107.2.4 >diff -u -r1.107.2.4 tcp_input.c >--- netinet/tcp_input.c 2000/08/16 06:14:23 1.107.2.4 >+++ netinet/tcp_input.c 2001/02/08 21:23:29 >@@ -817,7 +817,7 @@ > #endif > tp = intotcpcb(inp); > tp->t_state = TCPS_LISTEN; >- tp->t_flags |= tp0->t_flags & (TF_NOPUSH|TF_NOOPT); >+ tp->t_flags |= tp0->t_flags & (TF_CORK|TF_NOOPT); > > /* Compute proper scaling value from buffer space */ > while (tp->request_r_scale < TCP_MAX_WINSHIFT && >Index: netinet/tcp_output.c >=================================================================== >RCS file: /home/ncvs/src/sys/netinet/tcp_output.c,v >retrieving revision 1.39.2.6 >diff -u -r1.39.2.6 tcp_output.c >--- netinet/tcp_output.c 2000/09/13 04:27:06 1.39.2.6 >+++ netinet/tcp_output.c 2001/02/08 21:23:07 >@@ -280,7 +280,7 @@ > goto send; > if (!(tp->t_flags & TF_MORETOCOME) && > (idle || tp->t_flags & TF_NODELAY) && >- (tp->t_flags & TF_NOPUSH) == 0 && >+ (tp->t_flags & TF_CORK) == 0 && > len + off >= so->so_snd.sb_cc) > goto send; > if (tp->t_force) >Index: netinet/tcp_usrreq.c >=================================================================== >RCS file: /home/ncvs/src/sys/netinet/tcp_usrreq.c,v >retrieving revision 1.51 >diff -u -r1.51 tcp_usrreq.c >--- netinet/tcp_usrreq.c 2000/01/09 19:17:28 1.51 >+++ netinet/tcp_usrreq.c 2001/02/08 21:22:35 >@@ -896,6 +896,7 @@ > switch (sopt->sopt_name) { > case TCP_NODELAY: > case TCP_NOOPT: >+ case TCP_CORK: > case TCP_NOPUSH: > error = sooptcopyin(sopt, &optval, sizeof optval, > sizeof optval); >@@ -909,8 +910,11 @@ > case TCP_NOOPT: > opt = TF_NOOPT; > break; >+ case TCP_CORK: >+ opt = TF_CORK; >+ break; > case TCP_NOPUSH: >- opt = TF_NOPUSH; >+ opt = TF_NOPUSH | TF_CORK; > break; > default: > opt = 0; /* dead code to fool gcc */ >@@ -919,8 +923,11 @@ > > if (optval) > tp->t_flags |= opt; >- else >+ else { > tp->t_flags &= ~opt; >+ if (opt & TF_CORK) >+ error = tcp_output(tp); >+ } > break; > > case TCP_MAXSEG: >Index: netinet/tcp_var.h >=================================================================== >RCS file: /home/ncvs/src/sys/netinet/tcp_var.h,v >retrieving revision 1.56.2.2 >diff -u -r1.56.2.2 tcp_var.h >--- netinet/tcp_var.h 2000/08/16 06:14:23 1.56.2.2 >+++ netinet/tcp_var.h 2001/02/08 21:25:09 >@@ -89,12 +89,13 @@ > #define TF_SACK_PERMIT 0x00200 /* other side said I could SACK */ > #define TF_NEEDSYN 0x00400 /* send SYN (implicit state) */ > #define TF_NEEDFIN 0x00800 /* send FIN (implicit state) */ >-#define TF_NOPUSH 0x01000 /* don't push */ >+#define TF_NOPUSH 0x01000 /* enable TAO on listen */ > #define TF_REQ_CC 0x02000 /* have/will request CC */ > #define TF_RCVD_CC 0x04000 /* a CC was received in SYN */ > #define TF_SENDCCNEW 0x08000 /* send CCnew instead of CC in SYN */ > #define TF_MORETOCOME 0x10000 /* More data to be appended to sock */ > #define TF_LQ_OVERFLOW 0x20000 /* listen queue overflow */ >+#define TF_CORK 0x40000 /* don't push */ > int t_force; /* 1 if forcing out a byte */ > > tcp_seq snd_una; /* send unacknowledged */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 24959
: 13039 |
13040