Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys move {tcp, udp}_do_loopback_cksum back to tcp/udp



details:   https://anonhg.NetBSD.org/src/rev/157ebf755f4c
branches:  trunk
changeset: 583518:157ebf755f4c
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Aug 10 13:06:49 2005 +0000

description:
move {tcp,udp}_do_loopback_cksum back to tcp/udp
so that they can be referenced by ipv6.

diffstat:

 sys/netinet/in_offload.h   |  18 ++++++++++++++----
 sys/netinet/ip_output.c    |   6 ++----
 sys/netinet/tcp_input.c    |   5 +++--
 sys/netinet/tcp_subr.c     |   5 +++--
 sys/netinet/tcp_usrreq.c   |   5 +++--
 sys/netinet/tcp_var.h      |   3 +--
 sys/netinet/udp_usrreq.c   |   5 +++--
 sys/netinet/udp_var.h      |   3 +--
 sys/netinet6/udp6_usrreq.c |   5 +++--
 9 files changed, 33 insertions(+), 22 deletions(-)

diffs (227 lines):

diff -r 09b9997acd5c -r 157ebf755f4c sys/netinet/in_offload.h
--- a/sys/netinet/in_offload.h  Wed Aug 10 13:05:16 2005 +0000
+++ b/sys/netinet/in_offload.h  Wed Aug 10 13:06:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in_offload.h,v 1.1 2005/04/18 21:55:06 yamt Exp $      */
+/*     $NetBSD: in_offload.h,v 1.2 2005/08/10 13:06:49 yamt Exp $      */
 
 /*-
  * Copyright (c)2005 YAMAMOTO Takashi,
@@ -26,13 +26,23 @@
  * SUCH DAMAGE.
  */
 
+#if !defined(_NETINET_IN_OFFLOAD_H_)
+#define        _NETINET_IN_OFFLOAD_H_
+
 /*
  * subroutines to do software-only equivalent of h/w offloading.
  */
 
-#if !defined(_NETINET_IN_OFFLOAD_H_)
-#define        _NETINET_IN_OFFLOAD_H_
-
 int tcp4_segment(struct mbuf *, int (*)(void *, struct mbuf *), void *);
 
+/*
+ * offloading related sysctl variables.
+ *
+ * they are here because it violates protocol layering in unusual way.
+ * ie. while they are TCP/UDP sysctls, they are used by IP layer.
+ */
+
+extern int tcp_do_loopback_cksum; /* do TCP checksum on loopback? */
+extern int udp_do_loopback_cksum; /* do UDP checksum on loopback? */
+
 #endif /* !defined(_NETINET_IN_OFFLOAD_H_) */
diff -r 09b9997acd5c -r 157ebf755f4c sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c   Wed Aug 10 13:05:16 2005 +0000
+++ b/sys/netinet/ip_output.c   Wed Aug 10 13:06:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_output.c,v 1.153 2005/05/29 21:41:23 christos Exp $ */
+/*     $NetBSD: ip_output.c,v 1.154 2005/08/10 13:06:49 yamt Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -98,7 +98,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.153 2005/05/29 21:41:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.154 2005/08/10 13:06:49 yamt Exp $");
 
 #include "opt_pfil_hooks.h"
 #include "opt_inet.h"
@@ -159,8 +159,6 @@
 extern struct pfil_head inet_pfil_hook;                        /* XXX */
 #endif
 
-int    udp_do_loopback_cksum = 0;
-int    tcp_do_loopback_cksum = 0;
 int    ip_do_loopback_cksum = 0;
 
 #define        IN_NEED_CHECKSUM(ifp, csum_flags) \
diff -r 09b9997acd5c -r 157ebf755f4c sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c   Wed Aug 10 13:05:16 2005 +0000
+++ b/sys/netinet/tcp_input.c   Wed Aug 10 13:06:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_input.c,v 1.232 2005/08/10 13:05:16 yamt Exp $     */
+/*     $NetBSD: tcp_input.c,v 1.233 2005/08/10 13:06:49 yamt Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -150,7 +150,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.232 2005/08/10 13:05:16 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.233 2005/08/10 13:06:49 yamt Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -183,6 +183,7 @@
 #include <netinet/in_pcb.h>
 #include <netinet/in_var.h>
 #include <netinet/ip_var.h>
+#include <netinet/in_offload.h>
 
 #ifdef INET6
 #ifndef INET
diff -r 09b9997acd5c -r 157ebf755f4c sys/netinet/tcp_subr.c
--- a/sys/netinet/tcp_subr.c    Wed Aug 10 13:05:16 2005 +0000
+++ b/sys/netinet/tcp_subr.c    Wed Aug 10 13:06:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_subr.c,v 1.194 2005/08/10 13:05:16 yamt Exp $      */
+/*     $NetBSD: tcp_subr.c,v 1.195 2005/08/10 13:06:49 yamt Exp $      */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -98,7 +98,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.194 2005/08/10 13:05:16 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.195 2005/08/10 13:06:49 yamt Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -200,6 +200,7 @@
 #endif
 int    tcp_rst_ppslim = 100;   /* 100pps */
 int    tcp_ackdrop_ppslim = 100;       /* 100pps */
+int    tcp_do_loopback_cksum = 0;
 int    tcp_sack_tp_maxholes = 32;
 int    tcp_sack_globalmaxholes = 1024;
 int    tcp_sack_globalholes = 0;
diff -r 09b9997acd5c -r 157ebf755f4c sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c  Wed Aug 10 13:05:16 2005 +0000
+++ b/sys/netinet/tcp_usrreq.c  Wed Aug 10 13:06:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_usrreq.c,v 1.107 2005/08/05 09:21:26 elad Exp $    */
+/*     $NetBSD: tcp_usrreq.c,v 1.108 2005/08/10 13:06:49 yamt Exp $    */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -100,7 +100,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.107 2005/08/05 09:21:26 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.108 2005/08/10 13:06:49 yamt Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -130,6 +130,7 @@
 #include <netinet/ip.h>
 #include <netinet/in_pcb.h>
 #include <netinet/ip_var.h>
+#include <netinet/in_offload.h>
 
 #ifdef INET6
 #ifndef INET
diff -r 09b9997acd5c -r 157ebf755f4c sys/netinet/tcp_var.h
--- a/sys/netinet/tcp_var.h     Wed Aug 10 13:05:16 2005 +0000
+++ b/sys/netinet/tcp_var.h     Wed Aug 10 13:06:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_var.h,v 1.128 2005/08/05 09:21:26 elad Exp $       */
+/*     $NetBSD: tcp_var.h,v 1.129 2005/08/10 13:06:49 yamt Exp $       */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -729,7 +729,6 @@
 extern int tcp_syn_cache_limit; /* max entries for compressed state engine */
 extern int tcp_syn_bucket_limit;/* max entries per hash bucket */
 extern int tcp_log_refused;    /* log refused connections */
-extern int tcp_do_loopback_cksum;/* do TCP checksum on loopback? */
 extern int tcp_sack_tp_maxholes;       /* Max holes per connection. */
 extern int tcp_sack_globalmaxholes;    /* Max holes per system. */
 extern int tcp_sack_globalholes;       /* Number of holes present. */
diff -r 09b9997acd5c -r 157ebf755f4c sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c  Wed Aug 10 13:05:16 2005 +0000
+++ b/sys/netinet/udp_usrreq.c  Wed Aug 10 13:06:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: udp_usrreq.c,v 1.140 2005/08/10 13:05:17 yamt Exp $    */
+/*     $NetBSD: udp_usrreq.c,v 1.141 2005/08/10 13:06:49 yamt Exp $    */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.140 2005/08/10 13:05:17 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.141 2005/08/10 13:06:49 yamt Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -146,6 +146,7 @@
 #else
 int    udpcksum = 0;           /* XXX */
 #endif
+int    udp_do_loopback_cksum = 0;
 
 struct inpcbtable udbtable;
 struct udpstat udpstat;
diff -r 09b9997acd5c -r 157ebf755f4c sys/netinet/udp_var.h
--- a/sys/netinet/udp_var.h     Wed Aug 10 13:05:16 2005 +0000
+++ b/sys/netinet/udp_var.h     Wed Aug 10 13:06:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: udp_var.h,v 1.28 2005/08/05 09:21:26 elad Exp $        */
+/*     $NetBSD: udp_var.h,v 1.29 2005/08/10 13:06:49 yamt Exp $        */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -87,7 +87,6 @@
 #ifdef _KERNEL
 extern struct  inpcbtable udbtable;
 extern struct  udpstat udpstat;
-extern int     udp_do_loopback_cksum;
 
 #ifdef __NO_STRICT_ALIGNMENT
 #define        UDP_HDR_ALIGNED_P(uh)   1
diff -r 09b9997acd5c -r 157ebf755f4c sys/netinet6/udp6_usrreq.c
--- a/sys/netinet6/udp6_usrreq.c        Wed Aug 10 13:05:16 2005 +0000
+++ b/sys/netinet6/udp6_usrreq.c        Wed Aug 10 13:06:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: udp6_usrreq.c,v 1.68 2005/05/29 21:43:51 christos Exp $        */
+/*     $NetBSD: udp6_usrreq.c,v 1.69 2005/08/10 13:06:49 yamt Exp $    */
 /*     $KAME: udp6_usrreq.c,v 1.86 2001/05/27 17:33:00 itojun Exp $    */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.68 2005/05/29 21:43:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.69 2005/08/10 13:06:49 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -95,6 +95,7 @@
 #include <netinet/icmp6.h>
 #include <netinet6/udp6_var.h>
 #include <netinet6/ip6protosw.h>
+#include <netinet/in_offload.h>
 
 #include "faith.h"
 #if defined(NFAITH) && NFAITH > 0



Home | Main Index | Thread Index | Old Index