svn commit: r341813 - in projects/clang700-import: . lib/libc/sys libexec/rc sbin/ipfw sbin/ping share/vt/keymaps stand/powerpc/uboot sys/arm/include sys/cam/scsi sys/compat/linuxkpi/common/include...
Dimitry Andric
dim at FreeBSD.org
Tue Dec 11 06:47:13 UTC 2018
Author: dim
Date: Tue Dec 11 06:47:04 2018
New Revision: 341813
URL: https://svnweb.freebsd.org/changeset/base/341813
Log:
Merge ^/head r341764 through r341812.
Added:
projects/clang700-import/share/vt/keymaps/uk.macbook.kbd
- copied unchanged from r341812, head/share/vt/keymaps/uk.macbook.kbd
projects/clang700-import/stand/powerpc/uboot/ppc64_elf_freebsd.c
- copied unchanged from r341812, head/stand/powerpc/uboot/ppc64_elf_freebsd.c
Deleted:
projects/clang700-import/sys/mips/conf/ADM5120.hints
projects/clang700-import/sys/mips/conf/IDT.hints
Modified:
projects/clang700-import/Makefile.inc1
projects/clang700-import/lib/libc/sys/getfh.2
projects/clang700-import/libexec/rc/rc.subr
projects/clang700-import/sbin/ipfw/ipfw2.c
projects/clang700-import/sbin/ping/ping.c
projects/clang700-import/share/vt/keymaps/INDEX.keymaps
projects/clang700-import/share/vt/keymaps/Makefile
projects/clang700-import/stand/powerpc/uboot/Makefile
projects/clang700-import/stand/powerpc/uboot/conf.c
projects/clang700-import/sys/arm/include/atomic.h
projects/clang700-import/sys/cam/scsi/scsi_all.c
projects/clang700-import/sys/compat/linuxkpi/common/include/asm/atomic-long.h
projects/clang700-import/sys/compat/linuxkpi/common/include/asm/atomic.h
projects/clang700-import/sys/dev/ahci/ahci_pci.c
projects/clang700-import/sys/dev/md/md.c
projects/clang700-import/sys/dev/rtwn/usb/rtwn_usb_attach.h
projects/clang700-import/sys/dev/sfxge/common/efx.h
projects/clang700-import/sys/dev/sfxge/common/efx_nic.c
projects/clang700-import/sys/dev/sfxge/sfxge.c
projects/clang700-import/sys/dev/sfxge/sfxge.h
projects/clang700-import/sys/dev/sfxge/sfxge_ev.c
projects/clang700-import/sys/dev/sfxge/sfxge_tx.c
projects/clang700-import/sys/dev/sfxge/sfxge_tx.h
projects/clang700-import/sys/dev/usb/usbdevs
projects/clang700-import/sys/dev/usb/wlan/if_rsu.c
projects/clang700-import/sys/kern/kern_sig.c
projects/clang700-import/sys/kern/kern_thread.c
projects/clang700-import/sys/kern/subr_blist.c
projects/clang700-import/sys/kern/vfs_syscalls.c
projects/clang700-import/sys/mips/include/atomic.h
projects/clang700-import/sys/modules/Makefile
projects/clang700-import/sys/powerpc/aim/aim_machdep.c
projects/clang700-import/sys/powerpc/booke/locore.S
projects/clang700-import/sys/powerpc/include/atomic.h
projects/clang700-import/sys/powerpc/include/trap.h
projects/clang700-import/sys/powerpc/mpc85xx/platform_mpc85xx.c
projects/clang700-import/sys/powerpc/powerpc/db_trace.c
projects/clang700-import/sys/powerpc/powerpc/trap.c
projects/clang700-import/sys/riscv/riscv/pmap.c
projects/clang700-import/sys/x86/x86/mp_x86.c
projects/clang700-import/tests/sys/kern/ptrace_test.c
projects/clang700-import/usr.bin/truss/main.c
Directory Properties:
projects/clang700-import/ (props changed)
Modified: projects/clang700-import/Makefile.inc1
==============================================================================
--- projects/clang700-import/Makefile.inc1 Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/Makefile.inc1 Tue Dec 11 06:47:04 2018 (r341813)
@@ -977,6 +977,14 @@ _cleanobj_fast_depend_hack: .PHONY
rm -f ${OBJTOP}/usr.sbin/ntp/libntpevent/.depend.*; \
fi
+# 20181209 r341759 track migration across wpa update
+ @if [ -e "${OBJTOP}/usr.sbin/wpa/wpa_supplicant/.depend.rrm.o" ] && \
+ egrep -q 'src/ap/rrm.c' \
+ ${OBJTOP}/usr.sbin/wpa/wpa_supplicant/.depend.rrm.o; then \
+ echo "Removing stale wpa dependencies and objects"; \
+ rm -f ${OBJTOP}/usr.sbin/wpa/*/.depend*; \
+ fi
+
_worldtmp: .PHONY
@echo
@echo "--------------------------------------------------------------"
Modified: projects/clang700-import/lib/libc/sys/getfh.2
==============================================================================
--- projects/clang700-import/lib/libc/sys/getfh.2 Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/lib/libc/sys/getfh.2 Tue Dec 11 06:47:04 2018 (r341813)
@@ -29,7 +29,7 @@
.\" @(#)getfh.2 8.1 (Berkeley) 6/9/93
.\" $FreeBSD$
.\"
-.Dd December 7, 2018
+.Dd December 11, 2018
.Dt GETFH 2
.Os
.Sh NAME
@@ -76,12 +76,12 @@ and
.Fn lgetfh
except when the
.Fa path
-specifies a relative or NULL path, or the
+specifies a relative path, or the
.Dv AT_BENEATH
flag is provided.
For
.Fn getfhat
-and relative or NULL
+and relative
.Fa path ,
the status is retrieved from a file relative to
the directory associated with the file descriptor
Modified: projects/clang700-import/libexec/rc/rc.subr
==============================================================================
--- projects/clang700-import/libexec/rc/rc.subr Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/libexec/rc/rc.subr Tue Dec 11 06:47:04 2018 (r341813)
@@ -58,17 +58,29 @@ JID=0
# ---------
# list_vars pattern
-# List vars matching pattern.
+# List variables matching glob pattern.
#
list_vars()
{
- set | { while read LINE; do
- var="${LINE%%=*}"
- case "$var" in
- "$LINE"|*[!a-zA-Z0-9_]*) continue ;;
- $1) echo $var
+ # Localize 'set' option below.
+ local -
+ local IFS=$'\n' line varname
+
+ # Disable path expansion in unquoted 'for' parameters below.
+ set -o noglob
+
+ for line in $(set); do
+ varname="${line%%=*}"
+
+ case "$varname" in
+ "$line"|*[!a-zA-Z0-9_]*)
+ continue
+ ;;
+ $1)
+ echo $varname
+ ;;
esac
- done; }
+ done
}
# set_rcvar [var] [defval] [desc]
Modified: projects/clang700-import/sbin/ipfw/ipfw2.c
==============================================================================
--- projects/clang700-import/sbin/ipfw/ipfw2.c Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sbin/ipfw/ipfw2.c Tue Dec 11 06:47:04 2018 (r341813)
@@ -1256,7 +1256,8 @@ print_ip(struct buf_pr *bp, const struct format_opts *
(cmd->o.opcode == O_IP_SRC || cmd->o.opcode == O_IP_DST) ?
32 : contigmask((uint8_t *)&(a[1]), 32);
if (mb == 32 && co.do_resolv)
- he = gethostbyaddr((char *)&(a[0]), sizeof(u_long), AF_INET);
+ he = gethostbyaddr((char *)&(a[0]), sizeof(in_addr_t),
+ AF_INET);
if (he != NULL) /* resolved to name */
bprintf(bp, "%s", he->h_name);
else if (mb == 0) /* any */
@@ -1510,6 +1511,7 @@ print_instruction(struct buf_pr *bp, const struct form
bprintf(bp, " %s", pe->p_name);
else
bprintf(bp, " %u", cmd->arg1);
+ state->proto = cmd->arg1;
break;
case O_MACADDR2:
print_mac(bp, insntod(cmd, mac));
@@ -1991,10 +1993,10 @@ print_proto(struct buf_pr *bp, struct format_opts *fo,
struct show_state *state)
{
ipfw_insn *cmd;
- int l, proto, ip4, ip6, tmp;
+ int l, proto, ip4, ip6;
/* Count all O_PROTO, O_IP4, O_IP6 instructions. */
- proto = tmp = ip4 = ip6 = 0;
+ proto = ip4 = ip6 = 0;
for (l = state->rule->act_ofs, cmd = state->rule->cmd;
l > 0; l -= F_LEN(cmd), cmd += F_LEN(cmd)) {
switch (cmd->opcode) {
@@ -2030,18 +2032,13 @@ print_proto(struct buf_pr *bp, struct format_opts *fo,
if (cmd == NULL || (cmd->len & F_OR))
for (l = proto; l > 0; l--) {
cmd = print_opcode(bp, fo, state, O_PROTO);
- if (cmd != NULL && (cmd->len & F_OR) == 0)
+ if (cmd == NULL || (cmd->len & F_OR) == 0)
break;
- tmp = cmd->arg1;
}
/* Initialize proto, it is used by print_newports() */
- if (tmp != 0)
- state->proto = tmp;
- else if (ip6 != 0)
- state->proto = IPPROTO_IPV6;
- else
- state->proto = IPPROTO_IP;
state->flags |= HAVE_PROTO;
+ if (state->proto == 0 && ip6 != 0)
+ state->proto = IPPROTO_IPV6;
}
static int
Modified: projects/clang700-import/sbin/ping/ping.c
==============================================================================
--- projects/clang700-import/sbin/ping/ping.c Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sbin/ping/ping.c Tue Dec 11 06:47:04 2018 (r341813)
@@ -313,7 +313,7 @@ main(int argc, char *const *argv)
break;
case 'c':
ltmp = strtol(optarg, &ep, 0);
- if (*ep || ep == optarg || ltmp > LONG_MAX || ltmp <=0)
+ if (*ep || ep == optarg || ltmp <= 0)
errx(EX_USAGE,
"invalid count of packets to transmit: `%s'",
optarg);
Modified: projects/clang700-import/share/vt/keymaps/INDEX.keymaps
==============================================================================
--- projects/clang700-import/share/vt/keymaps/INDEX.keymaps Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/share/vt/keymaps/INDEX.keymaps Tue Dec 11 06:47:04 2018 (r341813)
@@ -520,6 +520,12 @@ uk.dvorak.kbd:fr:Royaume Uni Dvorak
uk.dvorak.kbd:pt:Reino Unido Dvorak
uk.dvorak.kbd:es:Británico Dvorak
+uk.macbook.kbd:en:United Kingdom Macbook
+uk.macbook.kbd:de:Vereinigtes Königreich Macbook
+uk.macbook.kbd:fr:Royaume Uni Macbook
+uk.macbook.kbd:pt:Reino Unido Macbook
+uk.macbook.kbd:es:Británico Macbook
+
us.kbd:en:United States of America
us.kbd:de:US-amerikanisch
us.kbd:fr:États Unis d'Amérique
Modified: projects/clang700-import/share/vt/keymaps/Makefile
==============================================================================
--- projects/clang700-import/share/vt/keymaps/Makefile Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/share/vt/keymaps/Makefile Tue Dec 11 06:47:04 2018 (r341813)
@@ -74,6 +74,7 @@ FILES= INDEX.keymaps \
uk.capsctrl.kbd \
uk.dvorak.kbd \
uk.kbd \
+ uk.macbook.kbd \
us.acc.kbd \
us.ctrl.kbd \
us.dvorak.kbd \
Copied: projects/clang700-import/share/vt/keymaps/uk.macbook.kbd (from r341812, head/share/vt/keymaps/uk.macbook.kbd)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/clang700-import/share/vt/keymaps/uk.macbook.kbd Tue Dec 11 06:47:04 2018 (r341813, copy of r341812, head/share/vt/keymaps/uk.macbook.kbd)
@@ -0,0 +1,115 @@
+# $FreeBSD$
+# by James Wright <james.wright at jigsawdezign.com>
+# alt
+# scan cntrl alt alt cntrl lock
+# code base shift cntrl shift alt shift cntrl shift state
+# ------------------------------------------------------------------
+ 000 nop nop nop nop nop nop nop nop O
+ 001 esc esc esc esc esc esc debug esc O
+ 002 '1' '!' nop nop '1' '!' nop nop O
+ 003 '2' '@' nul nul 0x20ac '@' nul nul O
+ 004 '3' 0xa3 nop nop '#' 0xa3 nop nop O
+ 005 '4' '$' nop nop '4' '$' nop nop O
+ 006 '5' '%' nop nop '5' '%' nop nop O
+ 007 '6' '^' rs rs '6' '^' rs rs O
+ 008 '7' '&' nop nop '7' '&' nop nop O
+ 009 '8' '*' nop nop '8' '*' nop nop O
+ 010 '9' '(' nop nop '9' '(' nop nop O
+ 011 '0' ')' nop nop '0' ')' nop nop O
+ 012 '-' '_' us us '-' '_' us us O
+ 013 '=' '+' nop nop '=' '+' nop nop O
+ 014 bs bs del del bs bs del del O
+ 015 ht btab nop nop ht btab nop nop O
+ 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C
+ 017 'w' 'W' etb etb 'w' 'W' etb etb C
+ 018 'e' 'E' enq enq 'e' 'E' enq enq C
+ 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
+ 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
+ 021 'y' 'Y' em em 'y' 'Y' em em C
+ 022 'u' 'U' nak nak 'u' 'U' nak nak C
+ 023 'i' 'I' ht ht 'i' 'I' ht ht C
+ 024 'o' 'O' si si 'o' 'O' si si C
+ 025 'p' 'P' dle dle 'p' 'P' dle dle C
+ 026 '[' '{' esc esc '[' '{' esc esc O
+ 027 ']' '}' gs gs ']' '}' gs gs O
+ 028 cr cr nl nl cr cr nl nl O
+ 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
+ 030 'a' 'A' soh soh 'a' 'A' soh soh C
+ 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
+ 032 'd' 'D' eot eot 'd' 'D' eot eot C
+ 033 'f' 'F' ack ack 'f' 'F' ack ack C
+ 034 'g' 'G' bel bel 'g' 'G' bel bel C
+ 035 'h' 'H' bs bs 'h' 'H' bs bs C
+ 036 'j' 'J' nl nl 'j' 'J' nl nl C
+ 037 'k' 'K' vt vt 'k' 'K' vt vt C
+ 038 'l' 'L' ff ff 'l' 'L' ff ff C
+ 039 ';' ':' nop nop ';' ':' nop nop O
+ 040 ''' '"' nop nop ''' '"' nop nop O
+ 041 0xa7 0xb1 nop nop 0xa7 0xb1 nop nop O
+ 042 lshift lshift lshift lshift lshift lshift lshift lshift O
+ 043 '\' '|' fs fs '\' '|' fs fs O
+ 044 'z' 'Z' sub sub 'z' 'Z' sub sub C
+ 045 'x' 'X' can can 'x' 'X' can can C
+ 046 'c' 'C' etx etx 'c' 'C' etx etx C
+ 047 'v' 'V' syn syn 'v' 'V' syn syn C
+ 048 'b' 'B' stx stx 'b' 'B' stx stx C
+ 049 'n' 'N' so so 'n' 'N' so so C
+ 050 'm' 'M' cr cr 'm' 'M' cr cr C
+ 051 ',' '<' nop nop ',' '<' nop nop O
+ 052 '.' '>' nop nop '.' '>' nop nop O
+ 053 '/' '?' nop nop '/' '?' nop nop O
+ 054 rshift rshift rshift rshift rshift rshift rshift rshift O
+ 055 '*' '*' '*' '*' '*' '*' '*' '*' O
+ 056 lalt lalt lalt lalt lalt lalt lalt lalt O
+ 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O
+ 058 clock clock clock clock clock clock clock clock O
+ 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O
+ 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O
+ 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O
+ 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O
+ 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O
+ 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O
+ 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
+ 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
+ 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
+ 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
+ 069 nlock nlock nlock nlock nlock nlock nlock nlock O
+ 070 slock slock slock slock slock slock slock slock O
+ 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N
+ 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N
+ 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N
+ 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N
+ 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N
+ 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N
+ 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N
+ 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N
+ 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N
+ 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N
+ 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N
+ 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N
+ 083 del '.' '.' '.' '.' '.' boot boot N
+ 084 nop nop nop nop nop nop nop nop O
+ 085 nop nop nop nop nop nop nop nop O
+ 086 '`' '~' nop nop '`' '~' nop nop O
+ 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
+ 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
+ 089 cr cr nl nl cr cr nl nl O
+ 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O
+ 091 '/' '/' '/' '/' '/' '/' '/' '/' N
+ 092 nscr pscr debug debug nop nop nop nop O
+ 093 ralt ralt ralt ralt ralt ralt ralt ralt O
+ 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
+ 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
+ 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
+ 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
+ 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
+ 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
+ 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
+ 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
+ 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
+ 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O
+ 104 slock saver slock saver susp nop susp nop O
+ 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O
+ 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O
+ 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O
+ 108 nop nop nop nop nop nop nop nop O
Modified: projects/clang700-import/stand/powerpc/uboot/Makefile
==============================================================================
--- projects/clang700-import/stand/powerpc/uboot/Makefile Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/stand/powerpc/uboot/Makefile Tue Dec 11 06:47:04 2018 (r341813)
@@ -16,7 +16,7 @@ NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH}
INSTALLFLAGS= -b
# Architecture-specific loader code
-SRCS= start.S conf.c vers.c
+SRCS= start.S conf.c vers.c ppc64_elf_freebsd.c
SRCS+= ucmpdi2.c
# Always add MI sources
Modified: projects/clang700-import/stand/powerpc/uboot/conf.c
==============================================================================
--- projects/clang700-import/stand/powerpc/uboot/conf.c Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/stand/powerpc/uboot/conf.c Tue Dec 11 06:47:04 2018 (r341813)
@@ -95,9 +95,11 @@ struct netif_driver *netif_drivers[] = {
* Sort formats so that those that can detect based on arguments
* rather than reading the file go first.
*/
+extern struct file_format uboot_elf64;
struct file_format *file_formats[] = {
&uboot_elf,
+ &uboot_elf64,
NULL
};
Copied: projects/clang700-import/stand/powerpc/uboot/ppc64_elf_freebsd.c (from r341812, head/stand/powerpc/uboot/ppc64_elf_freebsd.c)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/clang700-import/stand/powerpc/uboot/ppc64_elf_freebsd.c Tue Dec 11 06:47:04 2018 (r341813, copy of r341812, head/stand/powerpc/uboot/ppc64_elf_freebsd.c)
@@ -0,0 +1,101 @@
+/*-
+ * Copyright (c) 2001 Benno Rice <benno at FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#define __ELF_WORD_SIZE 64
+
+#include <sys/param.h>
+#include <sys/linker.h>
+
+#include <machine/metadata.h>
+#include <machine/elf.h>
+#include <machine/md_var.h>
+
+#include <stand.h>
+
+#include "bootstrap.h"
+#include "libuboot.h"
+
+vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
+extern char end[];
+extern vm_offset_t reloc; /* From <arch>/conf.c */
+
+int
+ppc64_uboot_elf_loadfile(char *filename, uint64_t dest,
+ struct preloaded_file **result)
+{
+ int r;
+
+ r = __elfN(loadfile)(filename, dest, result);
+ if (r != 0)
+ return (r);
+
+ /*
+ * No need to sync the icache for modules: this will
+ * be done by the kernel after relocation.
+ */
+ if (!strcmp((*result)->f_type, "elf kernel"))
+ __syncicache((void *) (*result)->f_addr, (*result)->f_size);
+ return (0);
+}
+
+int
+ppc64_uboot_elf_exec(struct preloaded_file *fp)
+{
+ struct file_metadata *fmp;
+ vm_offset_t mdp, dtbp;
+ Elf_Ehdr *e;
+ int error;
+ void (*entry)(void *);
+
+ if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) {
+ return(EFTYPE);
+ }
+ e = (Elf_Ehdr *)&fmp->md_data;
+
+ /* Handle function descriptor for ELFv1 kernels */
+ if ((e->e_flags & 3) == 2)
+ entry = (void (*)(void*))(intptr_t)e->e_entry;
+ else
+ entry = *(void (*)(void*))(uint64_t *)(intptr_t)e->e_entry;
+
+ if ((error = md_load64(fp->f_args, &mdp, &dtbp)) != 0)
+ return (error);
+
+ dev_cleanup();
+ printf("Kernel args: %s\n", fp->f_args);
+
+ (*entry)((void *)mdp);
+ panic("exec returned");
+}
+
+struct file_format uboot_elf64 =
+{
+ ppc64_uboot_elf_loadfile,
+ ppc64_uboot_elf_exec
+};
Modified: projects/clang700-import/sys/arm/include/atomic.h
==============================================================================
--- projects/clang700-import/sys/arm/include/atomic.h Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/arm/include/atomic.h Tue Dec 11 06:47:04 2018 (r341813)
@@ -55,6 +55,13 @@
#include <machine/atomic-v4.h>
#endif /* Arch >= v6 */
+static __inline u_long
+atomic_swap_long(volatile u_long *p, u_long v)
+{
+
+ return (atomic_swap_32((volatile uint32_t *)p, v));
+}
+
#define atomic_clear_ptr atomic_clear_32
#define atomic_clear_acq_ptr atomic_clear_acq_32
#define atomic_clear_rel_ptr atomic_clear_rel_32
Modified: projects/clang700-import/sys/cam/scsi/scsi_all.c
==============================================================================
--- projects/clang700-import/sys/cam/scsi/scsi_all.c Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/cam/scsi/scsi_all.c Tue Dec 11 06:47:04 2018 (r341813)
@@ -1165,7 +1165,7 @@ static struct asc_table_entry asc_table[] = {
{ SST(0x04, 0x1B, SS_RDEF, /* XXX TBD */
"Logical unit not ready, sanitize in progress") },
/* DT MAEB */
- { SST(0x04, 0x1C, SS_RDEF, /* XXX TBD */
+ { SST(0x04, 0x1C, SS_START | SSQ_DECREMENT_COUNT | ENXIO,
"Logical unit not ready, additional power use not yet granted") },
/* D */
{ SST(0x04, 0x1D, SS_RDEF, /* XXX TBD */
Modified: projects/clang700-import/sys/compat/linuxkpi/common/include/asm/atomic-long.h
==============================================================================
--- projects/clang700-import/sys/compat/linuxkpi/common/include/asm/atomic-long.h Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/compat/linuxkpi/common/include/asm/atomic-long.h Tue Dec 11 06:47:04 2018 (r341813)
@@ -78,15 +78,7 @@ atomic_long_dec(atomic_long_t *v)
static inline long
atomic_long_xchg(atomic_long_t *v, long val)
{
-#if defined(__i386__) || defined(__amd64__) || defined(__aarch64__)
return atomic_swap_long(&v->counter, val);
-#else
- long ret = atomic_long_read(v);
-
- while (!atomic_fcmpset_long(&v->counter, &ret, val))
- ;
- return (ret);
-#endif
}
static inline long
Modified: projects/clang700-import/sys/compat/linuxkpi/common/include/asm/atomic.h
==============================================================================
--- projects/clang700-import/sys/compat/linuxkpi/common/include/asm/atomic.h Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/compat/linuxkpi/common/include/asm/atomic.h Tue Dec 11 06:47:04 2018 (r341813)
@@ -128,15 +128,7 @@ atomic_clear_mask(unsigned int mask, atomic_t *v)
static inline int
atomic_xchg(atomic_t *v, int i)
{
-#if !defined(__mips__)
return (atomic_swap_int(&v->counter, i));
-#else
- int ret = atomic_read(v);
-
- while (!atomic_fcmpset_int(&v->counter, &ret, i))
- ;
- return (ret);
-#endif
}
static inline int
Modified: projects/clang700-import/sys/dev/ahci/ahci_pci.c
==============================================================================
--- projects/clang700-import/sys/dev/ahci/ahci_pci.c Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/dev/ahci/ahci_pci.c Tue Dec 11 06:47:04 2018 (r341813)
@@ -358,10 +358,7 @@ static int
ahci_pci_ctlr_reset(device_t dev)
{
- if (pci_read_config(dev, PCIR_DEVVENDOR, 4) == 0x28298086 &&
- (pci_read_config(dev, 0x92, 1) & 0xfe) == 0x04)
- pci_write_config(dev, 0x92, 0x01, 1);
- return ahci_ctlr_reset(dev);
+ return(ahci_ctlr_reset(dev));
}
static int
Modified: projects/clang700-import/sys/dev/md/md.c
==============================================================================
--- projects/clang700-import/sys/dev/md/md.c Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/dev/md/md.c Tue Dec 11 06:47:04 2018 (r341813)
@@ -1241,10 +1241,10 @@ md_kthread(void *arg)
if (error != -1) {
bp->bio_completed = bp->bio_length;
- if ((bp->bio_cmd == BIO_READ) || (bp->bio_cmd == BIO_WRITE))
- devstat_end_transaction_bio(sc->devstat, bp);
g_io_deliver(bp, error);
}
+ if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE)
+ devstat_end_transaction_bio(sc->devstat, bp);
}
}
Modified: projects/clang700-import/sys/dev/rtwn/usb/rtwn_usb_attach.h
==============================================================================
--- projects/clang700-import/sys/dev/rtwn/usb/rtwn_usb_attach.h Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/dev/rtwn/usb/rtwn_usb_attach.h Tue Dec 11 06:47:04 2018 (r341813)
@@ -118,6 +118,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = {
RTWN_RTL8188EU_DEV(DLINK, DWA123D1),
RTWN_RTL8188EU_DEV(DLINK, DWA125D1),
RTWN_RTL8188EU_DEV(ELECOM, WDC150SU2M),
+ RTWN_RTL8188EU_DEV(TPLINK, WN722N),
RTWN_RTL8188EU_DEV(REALTEK, RTL8188ETV),
RTWN_RTL8188EU_DEV(REALTEK, RTL8188EU),
#undef RTWN_RTL8188EU_DEV
Modified: projects/clang700-import/sys/dev/sfxge/common/efx.h
==============================================================================
--- projects/clang700-import/sys/dev/sfxge/common/efx.h Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/dev/sfxge/common/efx.h Tue Dec 11 06:47:04 2018 (r341813)
@@ -1261,6 +1261,7 @@ efx_bist_stop(
#define EFX_FEATURE_FW_ASSISTED_TSO 0x00001000
#define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000
#define EFX_FEATURE_PACKED_STREAM 0x00004000
+#define EFX_FEATURE_TXQ_CKSUM_OP_DESC 0x00008000
typedef enum efx_tunnel_protocol_e {
EFX_TUNNEL_PROTOCOL_NONE = 0,
Modified: projects/clang700-import/sys/dev/sfxge/common/efx_nic.c
==============================================================================
--- projects/clang700-import/sys/dev/sfxge/common/efx_nic.c Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/dev/sfxge/common/efx_nic.c Tue Dec 11 06:47:04 2018 (r341813)
@@ -257,7 +257,8 @@ efx_nic_create(
EFX_FEATURE_PIO_BUFFERS |
EFX_FEATURE_FW_ASSISTED_TSO |
EFX_FEATURE_FW_ASSISTED_TSO_V2 |
- EFX_FEATURE_PACKED_STREAM;
+ EFX_FEATURE_PACKED_STREAM |
+ EFX_FEATURE_TXQ_CKSUM_OP_DESC;
break;
#endif /* EFSYS_OPT_HUNTINGTON */
@@ -277,7 +278,8 @@ efx_nic_create(
EFX_FEATURE_MCDI_DMA |
EFX_FEATURE_PIO_BUFFERS |
EFX_FEATURE_FW_ASSISTED_TSO_V2 |
- EFX_FEATURE_PACKED_STREAM;
+ EFX_FEATURE_PACKED_STREAM |
+ EFX_FEATURE_TXQ_CKSUM_OP_DESC;
break;
#endif /* EFSYS_OPT_MEDFORD */
@@ -293,7 +295,8 @@ efx_nic_create(
EFX_FEATURE_MCDI_DMA |
EFX_FEATURE_PIO_BUFFERS |
EFX_FEATURE_FW_ASSISTED_TSO_V2 |
- EFX_FEATURE_PACKED_STREAM;
+ EFX_FEATURE_PACKED_STREAM |
+ EFX_FEATURE_TXQ_CKSUM_OP_DESC;
break;
#endif /* EFSYS_OPT_MEDFORD2 */
Modified: projects/clang700-import/sys/dev/sfxge/sfxge.c
==============================================================================
--- projects/clang700-import/sys/dev/sfxge/sfxge.c Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/dev/sfxge/sfxge.c Tue Dec 11 06:47:04 2018 (r341813)
@@ -151,8 +151,8 @@ sfxge_estimate_rsrc_limits(struct sfxge_softc *sc)
limits.edl_min_evq_count = 1;
limits.edl_max_evq_count = evq_max;
- limits.edl_min_txq_count = SFXGE_TXQ_NTYPES;
- limits.edl_max_txq_count = evq_max + SFXGE_TXQ_NTYPES - 1;
+ limits.edl_min_txq_count = SFXGE_EVQ0_N_TXQ(sc);
+ limits.edl_max_txq_count = evq_max + SFXGE_EVQ0_N_TXQ(sc) - 1;
limits.edl_min_rxq_count = 1;
limits.edl_max_rxq_count = evq_max;
@@ -168,12 +168,12 @@ sfxge_estimate_rsrc_limits(struct sfxge_softc *sc)
return (rc);
}
- KASSERT(txq_allocated >= SFXGE_TXQ_NTYPES,
- ("txq_allocated < SFXGE_TXQ_NTYPES"));
+ KASSERT(txq_allocated >= SFXGE_EVQ0_N_TXQ(sc),
+ ("txq_allocated < %u", SFXGE_EVQ0_N_TXQ(sc)));
sc->evq_max = MIN(evq_allocated, evq_max);
sc->evq_max = MIN(rxq_allocated, sc->evq_max);
- sc->evq_max = MIN(txq_allocated - (SFXGE_TXQ_NTYPES - 1),
+ sc->evq_max = MIN(txq_allocated - (SFXGE_EVQ0_N_TXQ(sc) - 1),
sc->evq_max);
KASSERT(sc->evq_max <= evq_max,
@@ -205,7 +205,7 @@ sfxge_set_drv_limits(struct sfxge_softc *sc)
limits.edl_min_evq_count = limits.edl_max_evq_count =
sc->intr.n_alloc;
limits.edl_min_txq_count = limits.edl_max_txq_count =
- sc->intr.n_alloc + SFXGE_TXQ_NTYPES - 1;
+ sc->intr.n_alloc + SFXGE_EVQ0_N_TXQ(sc) - 1;
limits.edl_min_rxq_count = limits.edl_max_rxq_count =
sc->intr.n_alloc;
@@ -761,6 +761,11 @@ sfxge_create(struct sfxge_softc *sc)
goto fail_rx_ring_entries;
}
sc->rxq_entries = sfxge_rx_ring_entries;
+
+ if (efx_nic_cfg_get(enp)->enc_features & EFX_FEATURE_TXQ_CKSUM_OP_DESC)
+ sc->txq_dynamic_cksum_toggle_supported = B_TRUE;
+ else
+ sc->txq_dynamic_cksum_toggle_supported = B_FALSE;
if (!ISP2(sfxge_tx_ring_entries) ||
(sfxge_tx_ring_entries < EFX_TXQ_MINNDESCS) ||
Modified: projects/clang700-import/sys/dev/sfxge/sfxge.h
==============================================================================
--- projects/clang700-import/sys/dev/sfxge/sfxge.h Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/dev/sfxge/sfxge.h Tue Dec 11 06:47:04 2018 (r341813)
@@ -184,6 +184,10 @@ struct sfxge_evq {
unsigned int buf_base_id;
unsigned int entries;
char lock_name[SFXGE_LOCK_NAME_MAX];
+#if EFSYS_OPT_QSTATS
+ clock_t stats_update_time;
+ uint64_t stats[EV_NQSTATS];
+#endif
} __aligned(CACHE_LINE_SIZE);
#define SFXGE_NDESCS 1024
@@ -275,6 +279,9 @@ struct sfxge_softc {
struct ifnet *ifnet;
unsigned int if_flags;
struct sysctl_oid *stats_node;
+#if EFSYS_OPT_QSTATS
+ struct sysctl_oid *evqs_stats_node;
+#endif
struct sysctl_oid *txqs_node;
struct task task_reset;
@@ -286,6 +293,8 @@ struct sfxge_softc {
size_t vpd_size;
efx_nic_t *enp;
efsys_lock_t enp_lock;
+
+ boolean_t txq_dynamic_cksum_toggle_supported;
unsigned int rxq_entries;
unsigned int txq_entries;
Modified: projects/clang700-import/sys/dev/sfxge/sfxge_ev.c
==============================================================================
--- projects/clang700-import/sys/dev/sfxge/sfxge_ev.c Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/dev/sfxge/sfxge_ev.c Tue Dec 11 06:47:04 2018 (r341813)
@@ -269,9 +269,13 @@ sfxge_get_txq_by_label(struct sfxge_evq *evq, enum sfx
{
unsigned int index;
- KASSERT((evq->index == 0 && label < SFXGE_TXQ_NTYPES) ||
- (label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label"));
- index = (evq->index == 0) ? label : (evq->index - 1 + SFXGE_TXQ_NTYPES);
+ KASSERT((evq->sc->txq_dynamic_cksum_toggle_supported) ? (label == 0) :
+ ((evq->index == 0 && label < SFXGE_TXQ_NTYPES) ||
+ (label == SFXGE_TXQ_IP_TCP_UDP_CKSUM)),
+ ("unexpected txq label"));
+
+ index = (evq->index == 0) ?
+ label : (evq->index - 1 + SFXGE_EVQ0_N_TXQ(evq->sc));
return (evq->sc->txq[index]);
}
@@ -443,29 +447,94 @@ sfxge_ev_wake_up(void *arg, uint32_t index)
#if EFSYS_OPT_QSTATS
static void
+sfxge_evq_stat_update(struct sfxge_evq *evq)
+{
+ clock_t now;
+
+ SFXGE_EVQ_LOCK(evq);
+
+ if (__predict_false(evq->init_state != SFXGE_EVQ_STARTED))
+ goto out;
+
+ now = ticks;
+ if ((unsigned int)(now - evq->stats_update_time) < (unsigned int)hz)
+ goto out;
+
+ evq->stats_update_time = now;
+ efx_ev_qstats_update(evq->common, evq->stats);
+
+out:
+ SFXGE_EVQ_UNLOCK(evq);
+}
+
+static int
+sfxge_evq_stat_handler(SYSCTL_HANDLER_ARGS)
+{
+ struct sfxge_evq *evq = arg1;
+ struct sfxge_softc *sc = evq->sc;
+ unsigned int id = arg2;
+
+ SFXGE_ADAPTER_LOCK(sc);
+
+ sfxge_evq_stat_update(evq);
+
+ SFXGE_ADAPTER_UNLOCK(sc);
+
+ return (SYSCTL_OUT(req, &evq->stats[id], sizeof(evq->stats[id])));
+}
+
+static int
+sfxge_evq_stat_init(struct sfxge_evq *evq)
+{
+ struct sfxge_softc *sc = evq->sc;
+ struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev);
+ char name[16];
+ struct sysctl_oid *evq_stats_node;
+ unsigned int id;
+
+ snprintf(name, sizeof(name), "%u", evq->index);
+ evq_stats_node = SYSCTL_ADD_NODE(ctx,
+ SYSCTL_CHILDREN(sc->evqs_stats_node),
+ OID_AUTO, name, CTLFLAG_RD, NULL, "");
+ if (evq_stats_node == NULL)
+ return (ENOMEM);
+
+ for (id = 0; id < EV_NQSTATS; id++) {
+ SYSCTL_ADD_PROC(
+ ctx, SYSCTL_CHILDREN(evq_stats_node),
+ OID_AUTO, efx_ev_qstat_name(sc->enp, id),
+ CTLTYPE_U64|CTLFLAG_RD,
+ evq, id, sfxge_evq_stat_handler, "Q",
+ "");
+ }
+
+ return (0);
+}
+
+static void
sfxge_ev_stat_update(struct sfxge_softc *sc)
{
struct sfxge_evq *evq;
unsigned int index;
clock_t now;
+ unsigned int id;
SFXGE_ADAPTER_LOCK(sc);
- if (__predict_false(sc->evq[0]->init_state != SFXGE_EVQ_STARTED))
- goto out;
-
now = ticks;
if ((unsigned int)(now - sc->ev_stats_update_time) < (unsigned int)hz)
goto out;
sc->ev_stats_update_time = now;
- /* Add event counts from each event queue in turn */
+ memset(sc->ev_stats, 0, sizeof(sc->ev_stats));
+
+ /* Update and add event counts from each event queue in turn */
for (index = 0; index < sc->evq_count; index++) {
evq = sc->evq[index];
- SFXGE_EVQ_LOCK(evq);
- efx_ev_qstats_update(evq->common, sc->ev_stats);
- SFXGE_EVQ_UNLOCK(evq);
+ sfxge_evq_stat_update(evq);
+ for (id = 0; id < EV_NQSTATS; id++)
+ sc->ev_stats[id] += evq->stats[id];
}
out:
SFXGE_ADAPTER_UNLOCK(sc);
@@ -672,7 +741,7 @@ sfxge_ev_qstop(struct sfxge_softc *sc, unsigned int in
#if EFSYS_OPT_QSTATS
/* Add event counts before discarding the common evq state */
- efx_ev_qstats_update(evq->common, sc->ev_stats);
+ efx_ev_qstats_update(evq->common, evq->stats);
#endif
efx_ev_qdestroy(evq->common);
@@ -873,7 +942,24 @@ sfxge_ev_qinit(struct sfxge_softc *sc, unsigned int in
evq->init_state = SFXGE_EVQ_INITIALIZED;
+#if EFSYS_OPT_QSTATS
+ rc = sfxge_evq_stat_init(evq);
+ if (rc != 0)
+ goto fail_evq_stat_init;
+#endif
+
return (0);
+
+#if EFSYS_OPT_QSTATS
+fail_evq_stat_init:
+ evq->init_state = SFXGE_EVQ_UNINITIALIZED;
+ SFXGE_EVQ_LOCK_DESTROY(evq);
+ sfxge_dma_free(esmp);
+ sc->evq[index] = NULL;
+ free(evq, M_SFXGE);
+
+ return (rc);
+#endif
}
void
@@ -922,6 +1008,16 @@ sfxge_ev_init(struct sfxge_softc *sc)
sc, 0, sfxge_int_mod_handler, "IU",
"sfxge interrupt moderation (us)");
+#if EFSYS_OPT_QSTATS
+ sc->evqs_stats_node = SYSCTL_ADD_NODE(
+ device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(sc->stats_node),
+ OID_AUTO, "evq", CTLFLAG_RD, NULL, "Event queues stats");
+ if (sc->evqs_stats_node == NULL) {
+ rc = ENOMEM;
+ goto fail_evqs_stats_node;
+ }
+#endif
+
/*
* Initialize the event queue(s) - one per interrupt.
*/
@@ -940,6 +1036,9 @@ fail:
while (--index >= 0)
sfxge_ev_qfini(sc, index);
+#if EFSYS_OPT_QSTATS
+fail_evqs_stats_node:
+#endif
sc->evq_count = 0;
return (rc);
}
Modified: projects/clang700-import/sys/dev/sfxge/sfxge_tx.c
==============================================================================
--- projects/clang700-import/sys/dev/sfxge/sfxge_tx.c Tue Dec 11 06:45:53 2018 (r341812)
+++ projects/clang700-import/sys/dev/sfxge/sfxge_tx.c Tue Dec 11 06:47:04 2018 (r341813)
@@ -35,7 +35,7 @@
/* Theory of operation:
*
- * Tx queues allocation and mapping
+ * Tx queues allocation and mapping on Siena
*
* One Tx queue with enabled checksum offload is allocated per Rx channel
* (event queue). Also 2 Tx queues (one without checksum offload and one
@@ -46,6 +46,17 @@
* if event queue index is 0, TxQ-index = TxQ-label * [0..SFXGE_TXQ_NTYPES)
* else TxQ-index = SFXGE_TXQ_NTYPES + EvQ-index - 1
* See sfxge_get_txq_by_label() sfxge_ev.c
+ *
+ * Tx queue allocation and mapping on EF10
+ *
+ * One Tx queue with enabled checksum offload is allocated per Rx
+ * channel (event queue). Checksum offload on all Tx queues is enabled or
+ * disabled dynamically by inserting option descriptors, so the additional
+ * queues used on Siena are not required.
+ *
+ * TxQ label is always set to zero on EF10 hardware.
+ * So, event queue to Tx queue mapping is simple:
+ * TxQ-index = EvQ-index
*/
#include <sys/cdefs.h>
@@ -139,38 +150,75 @@ static void sfxge_tx_qlist_post(struct sfxge_txq *txq)
static void sfxge_tx_qunblock(struct sfxge_txq *txq);
static int sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
const bus_dma_segment_t *dma_seg, int n_dma_seg,
- int vlan_tagged);
+ int n_extra_descs);
+static inline void
+sfxge_next_stmp(struct sfxge_txq *txq, struct sfxge_tx_mapping **pstmp)
+{
+ KASSERT((*pstmp)->flags == 0, ("stmp flags are not 0"));
+ if (__predict_false(*pstmp ==
+ &txq->stmp[txq->ptr_mask]))
+ *pstmp = &txq->stmp[0];
+ else
+ (*pstmp)++;
+}
+
static int
-sfxge_tx_maybe_insert_tag(struct sfxge_txq *txq, struct mbuf *mbuf)
+sfxge_tx_maybe_toggle_cksum_offload(struct sfxge_txq *txq, struct mbuf *mbuf,
+ struct sfxge_tx_mapping **pstmp)
{
+ uint16_t new_hw_cksum_flags;
+ efx_desc_t *desc;
+
+ if (mbuf->m_pkthdr.csum_flags &
+ (CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6 | CSUM_TSO)) {
+ /*
+ * We always set EFX_TXQ_CKSUM_IPV4 here because this
+ * configuration is the most useful, and this won't
+ * cause any trouble in case of IPv6 traffic anyway.
+ */
+ new_hw_cksum_flags = EFX_TXQ_CKSUM_IPV4 | EFX_TXQ_CKSUM_TCPUDP;
+ } else if (mbuf->m_pkthdr.csum_flags & CSUM_DELAY_IP) {
+ new_hw_cksum_flags = EFX_TXQ_CKSUM_IPV4;
+ } else {
+ new_hw_cksum_flags = 0;
+ }
+
+ if (new_hw_cksum_flags == txq->hw_cksum_flags)
+ return (0);
+
+ desc = &txq->pend_desc[txq->n_pend_desc];
+ efx_tx_qdesc_checksum_create(txq->common, new_hw_cksum_flags, desc);
+ txq->hw_cksum_flags = new_hw_cksum_flags;
+ txq->n_pend_desc++;
+
+ sfxge_next_stmp(txq, pstmp);
+
+ return (1);
+}
+
+static int
+sfxge_tx_maybe_insert_tag(struct sfxge_txq *txq, struct mbuf *mbuf,
+ struct sfxge_tx_mapping **pstmp)
+{
uint16_t this_tag = ((mbuf->m_flags & M_VLANTAG) ?
mbuf->m_pkthdr.ether_vtag :
0);
+ efx_desc_t *desc;
if (this_tag == txq->hw_vlan_tci)
return (0);
- efx_tx_qdesc_vlantci_create(txq->common,
- bswap16(this_tag),
- &txq->pend_desc[0]);
- txq->n_pend_desc = 1;
+ desc = &txq->pend_desc[txq->n_pend_desc];
+ efx_tx_qdesc_vlantci_create(txq->common, bswap16(this_tag), desc);
txq->hw_vlan_tci = this_tag;
+ txq->n_pend_desc++;
+
+ sfxge_next_stmp(txq, pstmp);
+
return (1);
}
-static inline void
-sfxge_next_stmp(struct sfxge_txq *txq, struct sfxge_tx_mapping **pstmp)
-{
- KASSERT((*pstmp)->flags == 0, ("stmp flags are not 0"));
- if (__predict_false(*pstmp ==
- &txq->stmp[txq->ptr_mask]))
- *pstmp = &txq->stmp[0];
- else
- (*pstmp)++;
-}
-
-
void
sfxge_tx_qcomplete(struct sfxge_txq *txq, struct sfxge_evq *evq)
{
@@ -361,8 +409,9 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq,
int rc;
int i;
int eop;
+ uint16_t hw_cksum_flags_prev;
uint16_t hw_vlan_tci_prev;
- int vlan_tagged;
+ int n_extra_descs;
KASSERT(!txq->blocked, ("txq->blocked"));
@@ -413,14 +462,20 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq,
used_map = &stmp->map;
+ hw_cksum_flags_prev = txq->hw_cksum_flags;
hw_vlan_tci_prev = txq->hw_vlan_tci;
- vlan_tagged = sfxge_tx_maybe_insert_tag(txq, mbuf);
- if (vlan_tagged) {
- sfxge_next_stmp(txq, &stmp);
- }
+ /*
+ * The order of option descriptors, which are used to leverage VLAN tag
+ * and checksum offloads, might be important. Changing checksum offload
+ * between VLAN option and packet descriptors probably does not work.
+ */
+ n_extra_descs = sfxge_tx_maybe_toggle_cksum_offload(txq, mbuf, &stmp);
+ n_extra_descs += sfxge_tx_maybe_insert_tag(txq, mbuf, &stmp);
+
if (mbuf->m_pkthdr.csum_flags & CSUM_TSO) {
- rc = sfxge_tx_queue_tso(txq, mbuf, dma_seg, n_dma_seg, vlan_tagged);
+ rc = sfxge_tx_queue_tso(txq, mbuf, dma_seg, n_dma_seg,
+ n_extra_descs);
if (rc < 0)
goto reject_mapped;
stmp = &txq->stmp[(rc - 1) & txq->ptr_mask];
@@ -431,7 +486,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq,
i = 0;
for (;;) {
- desc = &txq->pend_desc[i + vlan_tagged];
+ desc = &txq->pend_desc[i + n_extra_descs];
eop = (i == n_dma_seg - 1);
efx_tx_qdesc_dma_create(txq->common,
dma_seg[i].ds_addr,
@@ -443,7 +498,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq,
i++;
sfxge_next_stmp(txq, &stmp);
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list