Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Rename
details: https://anonhg.NetBSD.org/src/rev/a4aec431bc25
branches: trunk
changeset: 319502:a4aec431bc25
user: maxv <maxv%NetBSD.org@localhost>
date: Fri Jun 01 08:56:00 2018 +0000
description:
Rename
M_CSUM_DATA_IPv6_HL -> M_CSUM_DATA_IPv6_IPHL
M_CSUM_DATA_IPv6_HL_SET -> M_CSUM_DATA_IPv6_SET
Reduces the diff against IPv4. Also, clarify the definitions.
diffstat:
sys/arch/powerpc/booke/dev/pq3etsec.c | 6 +++---
sys/arch/x86/pci/if_vmx.c | 6 +++---
sys/dev/marvell/if_mvxpe.c | 6 +++---
sys/dev/pci/if_jme.c | 6 +++---
sys/dev/pci/if_wm.c | 8 ++++----
sys/netinet6/in6_offload.c | 6 +++---
sys/netinet6/ip6_output.c | 10 +++++-----
sys/sys/mbuf.h | 24 +++++++++---------------
8 files changed, 33 insertions(+), 39 deletions(-)
diffs (266 lines):
diff -r 16128f21434e -r a4aec431bc25 sys/arch/powerpc/booke/dev/pq3etsec.c
--- a/sys/arch/powerpc/booke/dev/pq3etsec.c Fri Jun 01 08:04:57 2018 +0000
+++ b/sys/arch/powerpc/booke/dev/pq3etsec.c Fri Jun 01 08:56:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pq3etsec.c,v 1.32 2017/10/23 09:23:48 msaitoh Exp $ */
+/* $NetBSD: pq3etsec.c,v 1.33 2018/06/01 08:56:00 maxv Exp $ */
/*-
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -41,7 +41,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.32 2017/10/23 09:23:48 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.33 2018/06/01 08:56:00 maxv Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -2063,7 +2063,7 @@
if (csum_flags & M_CSUM_IPv4)
fcb.txfcb_l4os = M_CSUM_DATA_IPv4_IPHL(m->m_pkthdr.csum_data);
else
- fcb.txfcb_l4os = M_CSUM_DATA_IPv6_HL(m->m_pkthdr.csum_data);
+ fcb.txfcb_l4os = M_CSUM_DATA_IPv6_IPHL(m->m_pkthdr.csum_data);
fcb.txfcb_l3os = ETHER_HDR_LEN;
fcb.txfcb_phcs = 0;
fcb.txfcb_vlctl = vtag;
diff -r 16128f21434e -r a4aec431bc25 sys/arch/x86/pci/if_vmx.c
--- a/sys/arch/x86/pci/if_vmx.c Fri Jun 01 08:04:57 2018 +0000
+++ b/sys/arch/x86/pci/if_vmx.c Fri Jun 01 08:56:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vmx.c,v 1.24 2018/04/16 09:12:52 nonaka Exp $ */
+/* $NetBSD: if_vmx.c,v 1.25 2018/06/01 08:56:00 maxv Exp $ */
/* $OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $ */
/*
@@ -19,7 +19,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.24 2018/04/16 09:12:52 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.25 2018/06/01 08:56:00 maxv Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -2536,7 +2536,7 @@
iphl = M_CSUM_DATA_IPv4_IPHL(m->m_pkthdr.csum_data);
v4 = true;
} else {
- iphl = M_CSUM_DATA_IPv6_HL(m->m_pkthdr.csum_data);
+ iphl = M_CSUM_DATA_IPv6_IPHL(m->m_pkthdr.csum_data);
v4 = false;
}
*start = offset + iphl;
diff -r 16128f21434e -r a4aec431bc25 sys/dev/marvell/if_mvxpe.c
--- a/sys/dev/marvell/if_mvxpe.c Fri Jun 01 08:04:57 2018 +0000
+++ b/sys/dev/marvell/if_mvxpe.c Fri Jun 01 08:56:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mvxpe.c,v 1.17 2016/12/15 09:28:05 ozaki-r Exp $ */
+/* $NetBSD: if_mvxpe.c,v 1.18 2018/06/01 08:56:00 maxv Exp $ */
/*
* Copyright (c) 2015 Internet Initiative Japan Inc.
* All rights reserved.
@@ -25,7 +25,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.17 2016/12/15 09:28:05 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvxpe.c,v 1.18 2018/06/01 08:56:00 maxv Exp $");
#include "opt_multiprocessor.h"
@@ -2239,7 +2239,7 @@
t->command |= MVXPE_TX_CMD_L3_IP4;
}
else if (csum_flags & (M_CSUM_TCPv6|M_CSUM_UDPv6)) {
- iphl = M_CSUM_DATA_IPv6_HL(m->m_pkthdr.csum_data);
+ iphl = M_CSUM_DATA_IPv6_IPHL(m->m_pkthdr.csum_data);
t->command |= MVXPE_TX_CMD_L3_IP6;
}
else {
diff -r 16128f21434e -r a4aec431bc25 sys/dev/pci/if_jme.c
--- a/sys/dev/pci/if_jme.c Fri Jun 01 08:04:57 2018 +0000
+++ b/sys/dev/pci/if_jme.c Fri Jun 01 08:56:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_jme.c,v 1.32 2017/09/26 07:42:06 knakahara Exp $ */
+/* $NetBSD: if_jme.c,v 1.33 2018/06/01 08:56:00 maxv Exp $ */
/*
* Copyright (c) 2008 Manuel Bouyer. All rights reserved.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.32 2017/09/26 07:42:06 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.33 2018/06/01 08:56:00 maxv Exp $");
#include <sys/param.h>
@@ -1361,7 +1361,7 @@
bool v4 = ((*m_head)->m_pkthdr.csum_flags & M_CSUM_TSOv4) != 0;
int iphl = v4 ?
M_CSUM_DATA_IPv4_IPHL((*m_head)->m_pkthdr.csum_data) :
- M_CSUM_DATA_IPv6_HL((*m_head)->m_pkthdr.csum_data);
+ M_CSUM_DATA_IPv6_IPHL((*m_head)->m_pkthdr.csum_data);
/*
* note: we support vlan offloading, so we should never have
* a ETHERTYPE_VLAN packet here - so ETHER_HDR_LEN is always
diff -r 16128f21434e -r a4aec431bc25 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c Fri Jun 01 08:04:57 2018 +0000
+++ b/sys/dev/pci/if_wm.c Fri Jun 01 08:56:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.580 2018/05/25 04:40:26 ozaki-r Exp $ */
+/* $NetBSD: if_wm.c,v 1.581 2018/06/01 08:56:00 maxv Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.580 2018/05/25 04:40:26 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.581 2018/06/01 08:56:00 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -6917,7 +6917,7 @@
(M_CSUM_TSOv4 | M_CSUM_UDPv4 | M_CSUM_TCPv4 | M_CSUM_IPv4)) != 0) {
iphl = M_CSUM_DATA_IPv4_IPHL(m0->m_pkthdr.csum_data);
} else {
- iphl = M_CSUM_DATA_IPv6_HL(m0->m_pkthdr.csum_data);
+ iphl = M_CSUM_DATA_IPv6_IPHL(m0->m_pkthdr.csum_data);
}
ipcse = offset + iphl - 1;
@@ -7524,7 +7524,7 @@
(M_CSUM_TSOv4 | M_CSUM_UDPv4 | M_CSUM_TCPv4 | M_CSUM_IPv4)) != 0) {
iphl = M_CSUM_DATA_IPv4_IPHL(m0->m_pkthdr.csum_data);
} else {
- iphl = M_CSUM_DATA_IPv6_HL(m0->m_pkthdr.csum_data);
+ iphl = M_CSUM_DATA_IPv6_IPHL(m0->m_pkthdr.csum_data);
}
vl_len |= (iphl << NQTXC_VLLEN_IPLEN_SHIFT);
KASSERT((iphl & ~NQTXC_VLLEN_IPLEN_MASK) == 0);
diff -r 16128f21434e -r a4aec431bc25 sys/netinet6/in6_offload.c
--- a/sys/netinet6/in6_offload.c Fri Jun 01 08:04:57 2018 +0000
+++ b/sys/netinet6/in6_offload.c Fri Jun 01 08:56:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_offload.c,v 1.7 2017/02/14 03:05:06 ozaki-r Exp $ */
+/* $NetBSD: in6_offload.c,v 1.8 2018/06/01 08:56:00 maxv Exp $ */
/*-
* Copyright (c)2006 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_offload.c,v 1.7 2017/02/14 03:05:06 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_offload.c,v 1.8 2018/06/01 08:56:00 maxv Exp $");
#include <sys/param.h>
#include <sys/mbuf.h>
@@ -214,7 +214,7 @@
}
plen = ntohs(plen);
- l4hdroff = M_CSUM_DATA_IPv6_HL(m->m_pkthdr.csum_data);
+ l4hdroff = M_CSUM_DATA_IPv6_IPHL(m->m_pkthdr.csum_data);
l4offset = hdrlen + l4hdroff;
csum = in6_cksum(m, 0, l4offset, plen - l4hdroff);
diff -r 16128f21434e -r a4aec431bc25 sys/netinet6/ip6_output.c
--- a/sys/netinet6/ip6_output.c Fri Jun 01 08:04:57 2018 +0000
+++ b/sys/netinet6/ip6_output.c Fri Jun 01 08:56:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6_output.c,v 1.210 2018/05/29 16:21:30 maxv Exp $ */
+/* $NetBSD: ip6_output.c,v 1.211 2018/06/01 08:56:00 maxv Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.210 2018/05/29 16:21:30 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.211 2018/06/01 08:56:00 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -241,7 +241,7 @@
}
#endif
- M_CSUM_DATA_IPv6_HL_SET(m->m_pkthdr.csum_data, sizeof(struct ip6_hdr));
+ M_CSUM_DATA_IPv6_SET(m->m_pkthdr.csum_data, sizeof(struct ip6_hdr));
#define MAKE_EXTHDR(hp, mp) \
do { \
@@ -400,7 +400,7 @@
MAKE_CHAIN(exthdrs.ip6e_rthdr, mprev, nexthdrp,
IPPROTO_ROUTING);
- M_CSUM_DATA_IPv6_HL_SET(m->m_pkthdr.csum_data,
+ M_CSUM_DATA_IPv6_SET(m->m_pkthdr.csum_data,
sizeof(struct ip6_hdr) + optlen);
}
@@ -1084,7 +1084,7 @@
KASSERT((m->m_pkthdr.csum_flags
& (M_CSUM_UDPv4|M_CSUM_TCPv4|M_CSUM_TSOv4)) == 0);
- offset = M_CSUM_DATA_IPv6_HL(m->m_pkthdr.csum_data);
+ offset = M_CSUM_DATA_IPv6_IPHL(m->m_pkthdr.csum_data);
csum = in6_cksum(m, 0, offset, m->m_pkthdr.len - offset);
if (csum == 0 && (m->m_pkthdr.csum_flags & M_CSUM_UDPv6) != 0) {
csum = 0xffff;
diff -r 16128f21434e -r a4aec431bc25 sys/sys/mbuf.h
--- a/sys/sys/mbuf.h Fri Jun 01 08:04:57 2018 +0000
+++ b/sys/sys/mbuf.h Fri Jun 01 08:56:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mbuf.h,v 1.206 2018/05/18 18:52:17 maxv Exp $ */
+/* $NetBSD: mbuf.h,v 1.207 2018/06/01 08:56:00 maxv Exp $ */
/*
* Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -166,7 +166,7 @@
* o For the out-bound direction, the low 16 bits indicates the offset after
* the L4 header where the final L4 checksum value is to be stored and the
* high 16 bits is the length of the L3 header (the start of the data to
- * be checksummed):
+ * be checksummed).
*
* o For the in-bound direction, it is only valid if the M_CSUM_DATA flag is
* set. In this case, an L4 checksum has been calculated by hardware and
@@ -227,24 +227,18 @@
"\11TSOv4\12TSOv6\40NO_PSEUDOHDR"
/*
- * Macros for manipulating csum_data on outgoing packets. These are
+ * Macros for manipulating csum_data on outgoing packets. These are
* used to pass information down from the L4/L3 to the L2.
+ *
+ * _IPHL: Length of the IPv{4/6} header, plus the options; in other
+ * words the offset of the UDP/TCP header in the packet.
+ * _OFFSET: Offset of the checksum field in the UDP/TCP header.
*/
#define M_CSUM_DATA_IPv4_IPHL(x) ((x) >> 16)
#define M_CSUM_DATA_IPv4_OFFSET(x) ((x) & 0xffff)
-
-/*
- * Macros for M_CSUM_TCPv6 and M_CSUM_UDPv6
- *
- * M_CSUM_DATA_IPv6_HL: length of ip6_hdr + ext header.
- * ie. offset of UDP/TCP header in the packet.
- *
- * M_CSUM_DATA_IPv6_OFFSET: offset of the checksum field in UDP/TCP header.
- */
-
-#define M_CSUM_DATA_IPv6_HL(x) ((x) >> 16)
-#define M_CSUM_DATA_IPv6_HL_SET(x, v) (x) = ((x) & 0xffff) | ((v) << 16)
+#define M_CSUM_DATA_IPv6_IPHL(x) ((x) >> 16)
#define M_CSUM_DATA_IPv6_OFFSET(x) ((x) & 0xffff)
+#define M_CSUM_DATA_IPv6_SET(x, v) (x) = ((x) & 0xffff) | ((v) << 16)
/*
* Max # of pages we can attach to m_ext. This is carefully chosen
Home |
Main Index |
Thread Index |
Old Index