svn commit: r361886 - head/sys/dev/ath

2020-06-06 Thread Adrian Chadd
Author: adrian
Date: Sun Jun  7 05:08:44 2020
New Revision: 361886
URL: https://svnweb.freebsd.org/changeset/base/361886

Log:
  [if_ath] Don't update the beacon bits from beacon frames in hostapd mode.
  
  This logic is running the beacon receive bits in STA+AP mode on both the
  STA and AP side.  The STA side sees its beacons from the BSS fine; the
  AP side is seeing other beacons on the same channel but with the BSS
  node for some odd reason.  (I think it's a valid reason, but I currently
  forget what that valid reason is.)
  
  So, just to be cleaner about things, don't run the nexttbtt/etc bits
  at all if we're in hostap mode.  If I ever get mesh working then maybe
  I'll make sure it works right on mesh+ap and mesh+sta modes.
  
  Whilst here, log the VAP i'm being called on to make it clearer what
  is going on.  I may end up adding a VAP dprintf version of this at
  some point.
  
  Tested:
  
  * AR9380, STA (DWDS client) + hostap on the same NIC

Modified:
  head/sys/dev/ath/if_ath_rx.c

Modified: head/sys/dev/ath/if_ath_rx.c
==
--- head/sys/dev/ath/if_ath_rx.cSun Jun  7 04:57:48 2020
(r361885)
+++ head/sys/dev/ath/if_ath_rx.cSun Jun  7 05:08:44 2020
(r361886)
@@ -379,12 +379,12 @@ ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *
 * trying to sync / merge to BSSes that aren't
 * actually us.
 */
-   if (IEEE80211_ADDR_EQ(ni->ni_bssid, vap->iv_bss->ni_bssid)) {
+   if ((vap->iv_opmode != IEEE80211_M_HOSTAP) &&
+   IEEE80211_ADDR_EQ(ni->ni_bssid, vap->iv_bss->ni_bssid)) {
/* update rssi statistics for use by the hal */
/* XXX unlocked check against vap->iv_bss? */
ATH_RSSI_LPF(sc->sc_halstats.ns_avgbrssi, rssi);
 
-
tsf_beacon = ((uint64_t) le32dec(ni->ni_tstamp.data + 
4)) << 32;
tsf_beacon |= le32dec(ni->ni_tstamp.data);
 
@@ -427,8 +427,9 @@ ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *
tsf_remainder = (tsf_beacon - tsf_beacon_old) % 
tsf_intval;
}
 
-   DPRINTF(sc, ATH_DEBUG_BEACON, "%s: old_tsf=%llu (%u), 
new_tsf=%llu (%u), target_tsf=%llu (%u), delta=%lld, bmiss=%d, remainder=%d\n",
+   DPRINTF(sc, ATH_DEBUG_BEACON, "%s: %s: old_tsf=%llu 
(%u), new_tsf=%llu (%u), target_tsf=%llu (%u), delta=%lld, bmiss=%d, 
remainder=%d\n",
__func__,
+   ieee80211_get_vap_ifname(vap),
(unsigned long long) tsf_beacon_old,
(unsigned int) (tsf_beacon_old >> 10),
(unsigned long long) tsf_beacon,
@@ -439,8 +440,11 @@ ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *
tsf_delta_bmiss,
tsf_remainder);
 
-   DPRINTF(sc, ATH_DEBUG_BEACON, "%s: tsf=%llu (%u), 
nexttbtt=%llu (%u), delta=%d\n",
+   DPRINTF(sc, ATH_DEBUG_BEACON, "%s: %s: ni=%6D bssid=%6D 
tsf=%llu (%u), nexttbtt=%llu (%u), delta=%d\n",
__func__,
+   ieee80211_get_vap_ifname(vap),
+   ni->ni_bssid, ":",
+   vap->iv_bss->ni_bssid, ":",
(unsigned long long) tsf_beacon,
(unsigned int) (tsf_beacon >> 10),
(unsigned long long) nexttbtt,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361885 - head/sys/net80211

2020-06-06 Thread Adrian Chadd
Author: adrian
Date: Sun Jun  7 04:57:48 2020
New Revision: 361885
URL: https://svnweb.freebsd.org/changeset/base/361885

Log:
  [net80211] Add a method to return the vap's ifname.
  
  This removes the requirement to know what's in the ifp.
  
  (If someone wants a quick clean-up task, it'd be nice to convert instances
  of ifp dereferencing for if_xname over to this method.)

Modified:
  head/sys/net80211/ieee80211_freebsd.c
  head/sys/net80211/ieee80211_freebsd.h

Modified: head/sys/net80211/ieee80211_freebsd.c
==
--- head/sys/net80211/ieee80211_freebsd.c   Sun Jun  7 04:32:38 2020
(r361884)
+++ head/sys/net80211/ieee80211_freebsd.c   Sun Jun  7 04:57:48 2020
(r361885)
@@ -1034,6 +1034,20 @@ wlan_iflladdr(void *arg __unused, struct ifnet *ifp)
 }
 
 /*
+ * Fetch the VAP name.
+ *
+ * This returns a const char pointer suitable for debugging,
+ * but don't expect it to stick around for much longer.
+ */
+const char *
+ieee80211_get_vap_ifname(struct ieee80211vap *vap)
+{
+   if ((vap->iv_ifp == NULL) || (vap->iv_ifp->if_xname == NULL))
+   return "(none)";
+   return vap->iv_ifp->if_xname;
+}
+
+/*
  * Module glue.
  *
  * NB: the module name is "wlan" for compatibility with NetBSD.

Modified: head/sys/net80211/ieee80211_freebsd.h
==
--- head/sys/net80211/ieee80211_freebsd.h   Sun Jun  7 04:32:38 2020
(r361884)
+++ head/sys/net80211/ieee80211_freebsd.h   Sun Jun  7 04:57:48 2020
(r361885)
@@ -245,6 +245,7 @@ voidieee80211_drain_ifq(struct ifqueue *);
 void   ieee80211_flush_ifq(struct ifqueue *, struct ieee80211vap *);
 
 void   ieee80211_vap_destroy(struct ieee80211vap *);
+const char *   ieee80211_get_vap_ifname(struct ieee80211vap *);
 
 #defineIFNET_IS_UP_RUNNING(_ifp) \
(((_ifp)->if_flags & IFF_UP) && \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361884 - in head/usr.bin/sed: . tests

2020-06-06 Thread Kyle Evans
Author: kevans
Date: Sun Jun  7 04:32:38 2020
New Revision: 361884
URL: https://svnweb.freebsd.org/changeset/base/361884

Log:
  sed: attempt to learn about hex escapes (e.g. \x27)
  
  Somewhat predictably, software often wants to use \x27/\x24 among others so
  that they can decline worrying about ugly escaping, if said escaping is even
  possible. Right now, this software is using these and getting the wrong
  results, as we'll interpret those as x27 and x24 respectively. Some examples
  of this, when an exp-run was ran, were science/octopus and misc/vifm.
  
  Go ahead and process these at all times.  We allow either one or two digits,
  and the tests account for both.  If extra digits are specified, e.g. \x2727,
  then the third and fourth digits are interpreted literally as one might
  expect.
  
  PR:   229925
  MFC after:2 weeks

Modified:
  head/usr.bin/sed/compile.c
  head/usr.bin/sed/tests/sed2_test.sh

Modified: head/usr.bin/sed/compile.c
==
--- head/usr.bin/sed/compile.c  Sun Jun  7 03:11:34 2020(r361883)
+++ head/usr.bin/sed/compile.c  Sun Jun  7 04:32:38 2020(r361884)
@@ -49,6 +49,7 @@ static const char sccsid[] = "@(#)compile.c   8.1 (Berke
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -365,6 +366,51 @@ nonsel:/* Now parse the command */
}
 }
 
+static int
+hex2char(const char *in, char *out, int len)
+{
+   long ord;
+   char *endptr, hexbuf[3];
+
+   hexbuf[0] = in[0];
+   hexbuf[1] = len > 1 ? in[1] : '\0';
+   hexbuf[2] = '\0';
+
+   errno = 0;
+   ord = strtol(hexbuf, , 16);
+   if (*endptr != '\0' || errno != 0)
+   return (ERANGE);
+   *out = (char)ord;
+   return (0);
+}
+
+static bool
+hexdigit(char c)
+{
+   int lc;
+
+   lc = tolower(c);
+   return isdigit(lc) || (lc >= 'a' && lc <= 'f');
+}
+
+static bool
+dohex(const char *in, char *out, int *len)
+{
+   int tmplen;
+
+   if (!hexdigit(in[0]))
+   return (false);
+   tmplen = 1;
+   if (hexdigit(in[1]))
+   ++tmplen;
+   if (hex2char(in, out, tmplen) == 0) {
+   *len = tmplen;
+   return (true);
+   }
+
+   return (false);
+}
+
 /*
  * Get a delimited string.  P points to the delimiter of the string; d points
  * to a buffer area.  Newline and delimiter escapes are processed; other
@@ -377,6 +423,7 @@ nonsel: /* Now parse the command */
 static char *
 compile_delimited(char *p, char *d, int is_tr)
 {
+   int hexlen;
char c;
 
c = *p++;
@@ -412,6 +459,12 @@ compile_delimited(char *p, char *d, int is_tr)
}
p += 2;
continue;
+   } else if (*p == '\\' && p[1] == 'x') {
+   if (dohex([2], d, )) {
+   ++d;
+   p += hexlen + 2;
+   continue;
+   }
} else if (*p == '\\' && p[1] == '\\') {
if (is_tr)
p++;
@@ -431,7 +484,7 @@ compile_delimited(char *p, char *d, int is_tr)
 static char *
 compile_ccl(char **sp, char *t)
 {
-   int c, d;
+   int c, d, hexlen;
char *s = *sp;
 
*t++ = *s++;
@@ -459,6 +512,10 @@ compile_ccl(char **sp, char *t)
*t = '\t';
s++;
break;
+   case 'x':
+   if (dohex([2], t, ))
+   s += hexlen + 1;
+   break;
}
}
}
@@ -499,7 +556,7 @@ static char *
 compile_subst(char *p, struct s_subst *s)
 {
static char lbuf[_POSIX2_LINE_MAX + 1];
-   int asize, size;
+   int asize, hexlen, size;
u_char ref;
char c, *text, *op, *sp;
int more = 1, sawesc = 0;
@@ -562,6 +619,21 @@ compile_subst(char *p, struct s_subst *s)
break;
case 't':
*p = '\t';
+   break;
+   case 'x':
+#defineADVANCE_N(s, n) \
+   do {\
+   char *adv = (s);\
+   while (*(adv + (n) - 1) != '\0') {  \
+   *adv = *(adv + (n));\
+   ++adv;  \
+   }   \
+   *adv = '\0';\
+   } while (0);
+   if 

svn commit: r361882 - head/share/man/man4

2020-06-06 Thread Warner Losh
Author: imp
Date: Sun Jun  7 02:40:21 2020
New Revision: 361882
URL: https://svnweb.freebsd.org/changeset/base/361882

Log:
  Mention nda where we mention nvd.

Modified:
  head/share/man/man4/nvme.4

Modified: head/share/man/man4/nvme.4
==
--- head/share/man/man4/nvme.4  Sun Jun  7 00:41:43 2020(r361881)
+++ head/share/man/man4/nvme.4  Sun Jun  7 02:40:21 2020(r361882)
@@ -33,7 +33,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 6, 2020
+.Dd June 6, 2020
 .Dt NVME 4
 .Os
 .Sh NAME
@@ -54,6 +54,8 @@ nvme_load="YES"
 .Pp
 Most users will also want to enable
 .Xr nvd 4
+or
+.Xr nda 4
 to expose NVM Express namespaces as disk devices which can be
 partitioned.
 Note that in NVM Express terms, a namespace is roughly equivalent to a
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361881 - stable/12/libexec/rtld-elf

2020-06-06 Thread Konstantin Belousov
Author: kib
Date: Sun Jun  7 00:41:43 2020
New Revision: 361881
URL: https://svnweb.freebsd.org/changeset/base/361881

Log:
  MFC r361672, r361675, r361676, r361680:
  rtld direct exec: add -b and -v options.

Modified:
  stable/12/libexec/rtld-elf/rtld.1
  stable/12/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/libexec/rtld-elf/rtld.1
==
--- stable/12/libexec/rtld-elf/rtld.1   Sun Jun  7 00:07:21 2020
(r361880)
+++ stable/12/libexec/rtld-elf/rtld.1   Sun Jun  7 00:41:43 2020
(r361881)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 20, 2017
+.Dd June 1, 2020
 .Dt RTLD 1
 .Os
 .Sh NAME
@@ -302,6 +302,7 @@ Execution options may be specified.
 The syntax of the direct invocation is
 .Bd -ragged -offset indent
 .Pa /libexec/ld-elf.so.1
+.Op Fl b Ar exe
 .Op Fl f Ar fd
 .Op Fl p
 .Op Fl -
@@ -311,6 +312,17 @@ The syntax of the direct invocation is
 .Pp
 The options are:
 .Bl -tag -width indent
+.It Fl b Ar exe
+Use the executable
+.Fa exe
+instead of
+.Fa image_path
+for activation.
+If this option is specified,
+.Ar image_path
+is only used to provide the
+.Va argv[0]
+value to the program.
 .It Fl f Ar fd
 File descriptor
 .Ar fd
@@ -333,6 +345,8 @@ character,
 uses the search path provided by the environment variable
 .Dv PATH
 to find the binary to execute.
+.It Fl v
+Display information about this run-time linker binary, then exit.
 .It Fl -
 Ends the
 .Nm

Modified: stable/12/libexec/rtld-elf/rtld.c
==
--- stable/12/libexec/rtld-elf/rtld.c   Sun Jun  7 00:07:21 2020
(r361880)
+++ stable/12/libexec/rtld-elf/rtld.c   Sun Jun  7 00:41:43 2020
(r361881)
@@ -136,7 +136,8 @@ static void objlist_put_after(Objlist *, Obj_Entry *, 
 static void objlist_remove(Objlist *, Obj_Entry *);
 static int open_binary_fd(const char *argv0, bool search_in_path,
 const char **binpath_res);
-static int parse_args(char* argv[], int argc, bool *use_pathp, int *fdp);
+static int parse_args(char* argv[], int argc, bool *use_pathp, int *fdp,
+const char **argv0);
 static int parse_integer(const char *);
 static void *path_enumerate(const char *, path_enum_proc, const char *, void 
*);
 static void print_usage(const char *argv0);
@@ -439,8 +440,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
}
dbg("opening main program in direct exec mode");
if (argc >= 2) {
-   rtld_argc = parse_args(argv, argc, _in_path, );
-   argv0 = argv[rtld_argc];
+   rtld_argc = parse_args(argv, argc, _in_path, , 
);
explicit_fd = (fd != -1);
binpath = NULL;
if (!explicit_fd)
@@ -5563,15 +5563,20 @@ open_binary_fd(const char *argv0, bool search_in_path,
  * Parse a set of command-line arguments.
  */
 static int
-parse_args(char* argv[], int argc, bool *use_pathp, int *fdp)
+parse_args(char* argv[], int argc, bool *use_pathp, int *fdp,
+const char **argv0)
 {
const char *arg;
-   int fd, i, j, arglen;
+   char machine[64];
+   size_t sz;
+   int arglen, fd, i, j, mib[2];
char opt;
+   bool seen_b, seen_f;
 
dbg("Parsing command-line arguments");
*use_pathp = false;
*fdp = -1;
+   seen_b = seen_f = false;
 
for (i = 1; i < argc; i++ ) {
arg = argv[i];
@@ -5598,7 +5603,21 @@ parse_args(char* argv[], int argc, bool *use_pathp, in
if (opt == 'h') {
print_usage(argv[0]);
_exit(0);
+   } else if (opt == 'b') {
+   if (seen_f) {
+   _rtld_error("Both -b and -f specified");
+   rtld_die();
+   }
+   i++;
+   *argv0 = argv[i];
+   seen_b = true;
+   break;
} else if (opt == 'f') {
+   if (seen_b) {
+   _rtld_error("Both -b and -f specified");
+   rtld_die();
+   }
+
/*
 * -f XX can be used to specify a
 * descriptor for the binary named at
@@ -5622,9 +5641,28 @@ parse_args(char* argv[], int argc, bool *use_pathp, in
rtld_die();
}
*fdp = fd;
+   seen_f = true;
break;
} else if (opt == 'p') {
*use_pathp = 

svn commit: r361880 - in head: . gnu/usr.bin gnu/usr.bin/binutils share/mk tools/build/mk tools/build/options

2020-06-06 Thread Ed Maste
Author: emaste
Date: Sun Jun  7 00:07:21 2020
New Revision: 361880
URL: https://svnweb.freebsd.org/changeset/base/361880

Log:
  Retire BINUTILS and BINUTILS_BOOTSTRAP options
  
  As of r361857 all BINUTILS options are disabled by default - ports
  have been changed to depend on binutils if they require GNU as, and
  all base system assembly files have been switched to use Clang's
  integrated assembler.
  
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation

Deleted:
  head/tools/build/options/WITHOUT_BINUTILS
  head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP
  head/tools/build/options/WITH_BINUTILS
  head/tools/build/options/WITH_BINUTILS_BOOTSTRAP
Modified:
  head/Makefile.inc1
  head/ObsoleteFiles.inc
  head/gnu/usr.bin/Makefile
  head/gnu/usr.bin/binutils/Makefile
  head/share/mk/src.opts.mk
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Jun  6 22:26:44 2020(r361879)
+++ head/Makefile.inc1  Sun Jun  7 00:07:21 2020(r361880)
@@ -300,7 +300,7 @@ TEST_SYSTEM_COMPILER_VARS= \
X_COMPILER_FREEBSD_VERSION
 TEST_SYSTEM_LINKER_VARS= \
USING_SYSTEM_LINKER MK_SYSTEM_LINKER \
-   MK_LLD_BOOTSTRAP MK_BINUTILS_BOOTSTRAP \
+   MK_LLD_BOOTSTRAP \
WANT_LINKER_TYPE WANT_LINKER_VERSION WANT_LINKER_VERSION_FILE \
WANT_LINKER_FREEBSD_VERSION WANT_LINKER_FREEBSD_VERSION_FILE \
LD LINKER_TYPE LINKER_FEATURES LINKER_VERSION \
@@ -2421,9 +2421,6 @@ _dtrace_tools= cddl/lib/libctf cddl/usr.bin/ctfconvert
 
 # If we're given an XAS, don't build binutils.
 .if ${XAS:M/*} == ""
-.if ${MK_BINUTILS_BOOTSTRAP} != "no"
-_binutils= gnu/usr.bin/binutils
-.endif
 .if ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no"
 _elftctools=   lib/libelftc \
lib/libpe \
@@ -2467,7 +2464,6 @@ cross-tools: .MAKE .PHONY
 ${_clang_libs} \
 ${_clang} \
 ${_lld} \
-${_binutils} \
 ${_elftctools} \
 ${_dtrace_tools} \
 ${_btxld} \
@@ -2565,9 +2561,6 @@ SUBDIR_DEPEND_usr.bin/clang=  lib/clang
 NXBDIRS+=  lib/clang
 NXBDIRS+=  usr.bin/clang
 .endif
-.if ${MK_BINUTILS} != "no"
-NXBDIRS+=  gnu/usr.bin/binutils
-.endif
 # XXX: native-xtools passes along ${NXBDIRS} in SUBDIR_OVERRIDE that needs
 # to be evaluated after NXBDIRS is set.
 .if make(install) && !empty(SUBDIR_OVERRIDE)
@@ -3273,7 +3266,6 @@ _xb-build-tools: .PHONY
 XDEVDIRS= \
 ${_clang_libs} \
 ${_lld} \
-${_binutils} \
 ${_elftctools} \
 usr.bin/ar \
 ${_clang}

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sat Jun  6 22:26:44 2020(r361879)
+++ head/ObsoleteFiles.inc  Sun Jun  7 00:07:21 2020(r361880)
@@ -36,6 +36,212 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20200606: retire binutils build infrastructure
+.if !defined(WITH_PORT_BASE_BINUTILS)
+OLD_FILES+=usr/bin/as
+OLD_FILES+=usr/bin/ld.bfd
+OLD_FILES+=usr/share/man/man1/as.1.gz
+OLD_FILES+=usr/share/man/man7/as.7.gz
+OLD_FILES+=usr/share/man/man7/ld.7.gz
+OLD_FILES+=usr/share/man/man7/ldint.7.gz
+OLD_FILES+=usr/share/man/man7/binutils.7.gz
+.endif
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.x
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xbn
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xc
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xd
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xdc
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xdw
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xn
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xr
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xs
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xsc
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xsw
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xu
+OLD_FILES+=usr/libdata/ldscripts/armelf_fbsd.xw
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.x
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.xbn
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.xc
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.xd
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.xdc
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.xdw
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.xn
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.xr
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.xs
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.xsc
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.xsw
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.xu
+OLD_FILES+=usr/libdata/ldscripts/armelfb_fbsd.xw
+OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.x
+OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xbn
+OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xc
+OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xd
+OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xdc
+OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xdw
+OLD_FILES+=usr/libdata/ldscripts/elf32_sparc.xn
+OLD_FILES+=usr/libdata/ldscripts/

svn commit: r361879 - head/share/man/man5

2020-06-06 Thread Ed Maste
Author: emaste
Date: Sat Jun  6 22:26:44 2020
New Revision: 361879
URL: https://svnweb.freebsd.org/changeset/base/361879

Log:
  src.conf.5: regen after r361876, SYSTEM_LINKER description update

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Sat Jun  6 22:25:00 2020
(r361878)
+++ head/share/man/man5/src.conf.5  Sat Jun  6 22:26:44 2020
(r361879)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd June 5, 2020
+.Dd June 6, 2020
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -1556,9 +1556,7 @@ This does not prevent a linker from being built for in
 only for building one for the build itself.
 The
 .Va WITHOUT_LLD
-and
-.Va WITHOUT_BINUTILS
-options control those.
+option controls that.
 .Pp
 This option is only relevant when
 .Va WITH_LLD_BOOTSTRAP
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361878 - head/sys/net80211

2020-06-06 Thread Adrian Chadd
Author: adrian
Date: Sat Jun  6 22:25:00 2020
New Revision: 361878
URL: https://svnweb.freebsd.org/changeset/base/361878

Log:
  [net80211] Flip on A-MPDU, A-MSDU, A-MPDU+A-MSDU and Fast frames options.
  
  This updates the logic to allow:
  
  * A-MPDU if available;
  * A-MSDU if available and A-MPDU is off/NACKed;
  * A-MPDU+A-MSDU if it's available and negotiated;
  * Fast frames if the node is 11abg (and not HT/VHT.)
  
  This allows for things to fail back to A-MSDU or fast frames
  if A-MPDU isn't available rather than needing to be non-HT/non-VHT.
  It also allows A-MPDU+A-MSDU to work if it's negotiated.
  
  Tested:
  
  * AR9380, STA + AP mode (A-MPDU, A-MSDU, FF, A-MPDU+A-MSDU)
  * RT5350, STA mode (A-MSDU, FF)
  * AR9170, STA mode (A-MSDU, FF)

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==
--- head/sys/net80211/ieee80211_output.cSat Jun  6 21:26:34 2020
(r361877)
+++ head/sys/net80211/ieee80211_output.cSat Jun  6 22:25:00 2020
(r361878)
@@ -125,6 +125,11 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, 
struct ieee80211com *ic = vap->iv_ic;
struct ifnet *ifp = vap->iv_ifp;
int mcast;
+   int do_ampdu = 0;
+   int do_amsdu = 0;
+   int do_ampdu_amsdu = 0;
+   int no_ampdu = 1; /* Will be set to 0 if ampdu is active */
+   int do_ff = 0;
 
if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) &&
(m->m_flags & M_PWR_SAV) == 0) {
@@ -169,7 +174,28 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, 
 
BPF_MTAP(ifp, m);   /* 802.3 tx */
 
+
/*
+* Figure out if we can do A-MPDU, A-MSDU or FF.
+*
+* A-MPDU depends upon vap/node config.
+* A-MSDU depends upon vap/node config.
+* FF depends upon vap config, IE and whether
+*  it's 11abg (and not 11n/11ac/etc.)
+*
+* Note that these flags indiciate whether we can do
+* it at all, rather than the situation (eg traffic type.)
+*/
+   do_ampdu = ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) &&
+   (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX));
+   do_amsdu = ((ni->ni_flags & IEEE80211_NODE_AMSDU_TX) &&
+   (vap->iv_flags_ht & IEEE80211_FHT_AMSDU_TX));
+   do_ff =
+   ((ni->ni_flags & IEEE80211_NODE_HT) == 0) &&
+   ((ni->ni_flags & IEEE80211_NODE_VHT) == 0) &&
+   (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF));
+
+   /*
 * Check if A-MPDU tx aggregation is setup or if we
 * should try to enable it.  The sta must be associated
 * with HT and A-MPDU enabled for use.  When the policy
@@ -186,8 +212,7 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, 
 * frames will always have sequence numbers allocated from the NON_QOS
 * TID.
 */
-   if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) &&
-   (vap->iv_flags_ht & IEEE80211_FHT_AMPDU_TX)) {
+   if (do_ampdu) {
if ((m->m_flags & M_EAPOL) == 0 && (! mcast)) {
int tid = WME_AC_TO_TID(M_WME_GETAC(m));
struct ieee80211_tx_ampdu *tap = >ni_tx_ampdu[tid];
@@ -208,6 +233,23 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, 
ieee80211_ampdu_request(ni, tap);
/* XXX hold frame for reply? */
}
+   /*
+* Now update the no-ampdu flag.  A-MPDU may have been
+* started or administratively disabled above; so now we
+* know whether we're running yet or not.
+*
+* This will let us know whether we should be doing 
A-MSDU
+* at this point.  We only do A-MSDU if we're either not
+* doing A-MPDU, or A-MPDU is NACKed, or A-MPDU + A-MSDU
+* is available.
+*
+* Whilst here, update the amsdu-ampdu flag.  The above 
may
+* have also set or cleared the amsdu-in-ampdu txa_flags
+* combination so we can correctly do A-MPDU + A-MSDU.
+*/
+   no_ampdu = (! IEEE80211_AMPDU_RUNNING(tap)
+   || (IEEE80211_AMPDU_NACKED(tap)));
+   do_ampdu_amsdu = IEEE80211_AMPDU_RUNNING_AMSDU(tap);
}
}
 
@@ -222,15 +264,11 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, 
 * to really need to.  For A-MSDU we'd have to set the
 * A-MSDU QoS bit in the wifi header, so we just plain
 * can't do it.
-*
-* Strictly speaking, we could actually /do/ A-MSDU / FF
-* with A-MPDU together which for 

svn commit: r361877 - head/sys/netinet

2020-06-06 Thread Michael Tuexen
Author: tuexen
Date: Sat Jun  6 21:26:34 2020
New Revision: 361877
URL: https://svnweb.freebsd.org/changeset/base/361877

Log:
  Fix typo in comment.
  
  Submitted by Orgad Shaneh for the userland stack.
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_pcb.c

Modified: head/sys/netinet/sctp_pcb.c
==
--- head/sys/netinet/sctp_pcb.c Sat Jun  6 21:07:50 2020(r361876)
+++ head/sys/netinet/sctp_pcb.c Sat Jun  6 21:26:34 2020(r361877)
@@ -5881,7 +5881,7 @@ retry:
 * holding the lock.  We won't find it on the list either and
 * continue and free/destroy it.  While holding the lock, spin, to
 * avoid the race condition as sctp_iterator_worker() will have to
-* wait to re-aquire the lock.
+* wait to re-acquire the lock.
 */
if (sctp_it_ctl.iterator_running != 0 || sctp_it_ctl.cur_it != NULL) {
SCTP_IPI_ITERATOR_WQ_UNLOCK();
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361876 - head/tools/build/options

2020-06-06 Thread Ed Maste
Author: emaste
Date: Sat Jun  6 21:07:50 2020
New Revision: 361876
URL: https://svnweb.freebsd.org/changeset/base/361876

Log:
  Update SYSTEM_LINKER descriptions wrt BINUTILS
  
  GNU ld hasn't been built with the BINUTILS option for some time.

Modified:
  head/tools/build/options/WITHOUT_SYSTEM_LINKER
  head/tools/build/options/WITH_SYSTEM_LINKER

Modified: head/tools/build/options/WITHOUT_SYSTEM_LINKER
==
--- head/tools/build/options/WITHOUT_SYSTEM_LINKER  Sat Jun  6 20:17:56 
2020(r361875)
+++ head/tools/build/options/WITHOUT_SYSTEM_LINKER  Sat Jun  6 21:07:50 
2020(r361876)
@@ -7,9 +7,7 @@ This does not prevent a linker from being built for in
 only for building one for the build itself.
 The
 .Va WITHOUT_LLD
-and
-.Va WITHOUT_BINUTILS
-options control those.
+option controls that.
 .Pp
 This option is only relevant when
 .Va WITH_LLD_BOOTSTRAP

Modified: head/tools/build/options/WITH_SYSTEM_LINKER
==
--- head/tools/build/options/WITH_SYSTEM_LINKER Sat Jun  6 20:17:56 2020
(r361875)
+++ head/tools/build/options/WITH_SYSTEM_LINKER Sat Jun  6 21:07:50 2020
(r361876)
@@ -7,9 +7,7 @@ This does not prevent a linker from being built for in
 only for building one for the build itself.
 The
 .Va WITHOUT_LLD
-and
-.Va WITHOUT_BINUTILS
-options control those.
+option controls that.
 .Pp
 This option is only relevant when
 .Va WITH_LLD_BOOTSTRAP
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r361872 - head/sys/netinet

2020-06-06 Thread Michael Tuexen
> On 6. Jun 2020, at 20:56, Kevin Bowling  wrote:
> 
> Out of curiosity what is panda?
Hi Kevin,

it was the name used (#ifdef __Panda__) in the upstream SCTP code for
using it in an Cisco proprietary product.
Since I don't know if that code is still used, but they haven't
contributed anything back, I think it is OK to reduce the #ifdef complexity
upstream and remove it. 

Best regards
Michael
> 
> On Sat, Jun 6, 2020 at 11:20 AM Michael Tuexen  wrote:
>> 
>> Author: tuexen
>> Date: Sat Jun  6 18:20:09 2020
>> New Revision: 361872
>> URL: https://svnweb.freebsd.org/changeset/base/361872
>> 
>> Log:
>>  Non-functional changes due to cleanup (upstream removing of Panda support)
>>  of the code
>> 
>>  MFC after:1 week
>> 
>> Modified:
>>  head/sys/netinet/sctp_constants.h
>>  head/sys/netinet/sctp_indata.c
>>  head/sys/netinet/sctp_os.h
>>  head/sys/netinet/sctp_output.c
>>  head/sys/netinet/sctp_pcb.c
>>  head/sys/netinet/sctp_usrreq.c
>> 
>> Modified: head/sys/netinet/sctp_constants.h
>> ==
>> --- head/sys/netinet/sctp_constants.h   Sat Jun  6 17:48:55 2020
>> (r361871)
>> +++ head/sys/netinet/sctp_constants.h   Sat Jun  6 18:20:09 2020
>> (r361872)
>> @@ -576,7 +576,6 @@ __FBSDID("$FreeBSD$");
>>  */
>> #define SCTP_ASOC_MAX_CHUNKS_ON_QUEUE 512
>> 
>> -
>> /*
>>  * Basically the minimum amount of time before I do a early FR. Making this
>>  * value to low will cause duplicate retransmissions.
>> @@ -756,9 +755,8 @@ __FBSDID("$FreeBSD$");
>> #define SCTP_FROM_SCTP_ASCONF   0x8000
>> #define SCTP_FROM_SCTP_OUTPUT   0x9000
>> #define SCTP_FROM_SCTP_PEELOFF  0xa000
>> -#define SCTP_FROM_SCTP_PANDA0xb000
>> -#define SCTP_FROM_SCTP_SYSCTL   0xc000
>> -#define SCTP_FROM_SCTP_CC_FUNCTIONS 0xd000
>> +#define SCTP_FROM_SCTP_SYSCTL   0xb000
>> +#define SCTP_FROM_SCTP_CC_FUNCTIONS 0xc000
>> 
>> /* Location ID's */
>> #define SCTP_LOC_1  0x0001
>> 
>> Modified: head/sys/netinet/sctp_indata.c
>> ==
>> --- head/sys/netinet/sctp_indata.c  Sat Jun  6 17:48:55 2020
>> (r361871)
>> +++ head/sys/netinet/sctp_indata.c  Sat Jun  6 18:20:09 2020
>> (r361872)
>> @@ -2721,8 +2721,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o
>> * cluster... i.e. it is a small packet sent in and yet the driver
>> * underneath allocated a full cluster for it. If so we must copy it
>> * to a smaller mbuf and free up the cluster mbuf. This will help
>> -* with cluster starvation. Note for __Panda__ we don't do this
>> -* since it has clusters all the way down to 64 bytes.
>> +* with cluster starvation.
>> */
>>if (SCTP_BUF_LEN(m) < (long)MLEN && SCTP_BUF_NEXT(m) == NULL) {
>>/* we only handle mbufs that are singletons.. not chains */
>> 
>> Modified: head/sys/netinet/sctp_os.h
>> ==
>> --- head/sys/netinet/sctp_os.h  Sat Jun  6 17:48:55 2020(r361871)
>> +++ head/sys/netinet/sctp_os.h  Sat Jun  6 18:20:09 2020(r361872)
>> @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$");
>> 
>> 
>> 
>> -
>> /* All os's must implement this address gatherer. If
>>  * no VRF's exist, then vrf 0 is the only one and all
>>  * addresses and ifn's live here.
>> 
>> Modified: head/sys/netinet/sctp_output.c
>> ==
>> --- head/sys/netinet/sctp_output.c  Sat Jun  6 17:48:55 2020
>> (r361871)
>> +++ head/sys/netinet/sctp_output.c  Sat Jun  6 18:20:09 2020
>> (r361872)
>> @@ -6475,8 +6475,7 @@ error_out:
>>appendchain = clonechain;
>>} else {
>>if (!copy_by_ref &&
>> -   (sizeofcpy <= 
>> (int)SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count) - 1) * MLEN) + MHLEN)))
>> -   ) {
>> +   (sizeofcpy <= 
>> (int)SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count) - 1) * MLEN) + 
>> MHLEN {
>>/* Its not in a cluster */
>>if (*endofchain == NULL) {
>>/* lets get a mbuf cluster */
>> @@ -13526,12 +13525,6 @@ skip_preblock:
>>error = sctp_msg_append(stcb, net, top, srcv, 0);
>>top = NULL;
>>if (sinfo_flags & SCTP_EOF) {
>> -   /*
>> -* This should only happen for Panda for the mbuf
>> -* send case, which does NOT yet support EEOR mode.
>> -* Thus, we can just set this flag to do the proper
>> -* EOF handling.
>> -*/
>>got_all_of_the_send = 1;
>>}
>>}
>> 
>> 

svn commit: r361875 - head/sys/ufs/ffs

2020-06-06 Thread Kirk McKusick
Author: mckusick
Date: Sat Jun  6 20:17:56 2020
New Revision: 361875
URL: https://svnweb.freebsd.org/changeset/base/361875

Log:
  Clear the IN_SIZEMOD and IN_IBLKDATA flags only when doing a
  synchronous inode update.
  
  The IN_SIZEMOD and IN_IBLKDATA flags indicate changes to the
  file size and block pointer fields in the inode. When these
  fields have been changed, the fsync() and fsyncdata() system
  calls must write the inode to ensure their semantics that the
  file is on stable store.
  
  The IN_SIZEMOD and IN_IBLKDATA flags cannot be cleared until
  a synchronous write of the inode is done. If they are cleared
  on an asynchronous write, then the inode may not yet have been
  written to the disk when an fsync() or fsyncdata() call is done.
  Absent these flags, these calls would not know that they needed
  to write the inode. Thus, these flags only can be cleared on
  synchronous writes of the inode. Since the inode will be locked
  for the duration of the I/O that writes it to disk, no fsync()
  or fsyncdata() will be able to run before the on-disk inode
  is complete.
  
  Reviewed by: kib
  MFC with: -r361785
  Differential revision:  https://reviews.freebsd.org/D25072

Modified:
  head/sys/ufs/ffs/ffs_inode.c

Modified: head/sys/ufs/ffs/ffs_inode.c
==
--- head/sys/ufs/ffs/ffs_inode.cSat Jun  6 18:56:40 2020
(r361874)
+++ head/sys/ufs/ffs/ffs_inode.cSat Jun  6 20:17:56 2020
(r361875)
@@ -94,7 +94,27 @@ ffs_update(vp, waitfor)
ip = VTOI(vp);
if ((ip->i_flag & IN_MODIFIED) == 0 && waitfor == 0)
return (0);
-   ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED | IN_IBLKDATA);
+   ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED);
+   /*
+* The IN_SIZEMOD and IN_IBLKDATA flags indicate changes to the
+* file size and block pointer fields in the inode. When these
+* fields have been changed, the fsync() and fsyncdata() system 
+* calls must write the inode to ensure their semantics that the 
+* file is on stable store.
+*
+* The IN_SIZEMOD and IN_IBLKDATA flags cannot be cleared until
+* a synchronous write of the inode is done. If they are cleared
+* on an asynchronous write, then the inode may not yet have been
+* written to the disk when an fsync() or fsyncdata() call is done.
+* Absent these flags, these calls would not know that they needed
+* to write the inode. Thus, these flags only can be cleared on
+* synchronous writes of the inode. Since the inode will be locked
+* for the duration of the I/O that writes it to disk, no fsync()
+* or fsyncdata() will be able to run before the on-disk inode
+* is complete.
+*/
+   if (waitfor)
+   ip->i_flag &= ~(IN_SIZEMOD | IN_IBLKDATA);
fs = ITOFS(ip);
if (fs->fs_ronly && ITOUMP(ip)->um_fsckpid == 0)
return (0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r361872 - head/sys/netinet

2020-06-06 Thread Kevin Bowling
Out of curiosity what is panda?

On Sat, Jun 6, 2020 at 11:20 AM Michael Tuexen  wrote:
>
> Author: tuexen
> Date: Sat Jun  6 18:20:09 2020
> New Revision: 361872
> URL: https://svnweb.freebsd.org/changeset/base/361872
>
> Log:
>   Non-functional changes due to cleanup (upstream removing of Panda support)
>   of the code
>
>   MFC after:1 week
>
> Modified:
>   head/sys/netinet/sctp_constants.h
>   head/sys/netinet/sctp_indata.c
>   head/sys/netinet/sctp_os.h
>   head/sys/netinet/sctp_output.c
>   head/sys/netinet/sctp_pcb.c
>   head/sys/netinet/sctp_usrreq.c
>
> Modified: head/sys/netinet/sctp_constants.h
> ==
> --- head/sys/netinet/sctp_constants.h   Sat Jun  6 17:48:55 2020
> (r361871)
> +++ head/sys/netinet/sctp_constants.h   Sat Jun  6 18:20:09 2020
> (r361872)
> @@ -576,7 +576,6 @@ __FBSDID("$FreeBSD$");
>   */
>  #define SCTP_ASOC_MAX_CHUNKS_ON_QUEUE 512
>
> -
>  /*
>   * Basically the minimum amount of time before I do a early FR. Making this
>   * value to low will cause duplicate retransmissions.
> @@ -756,9 +755,8 @@ __FBSDID("$FreeBSD$");
>  #define SCTP_FROM_SCTP_ASCONF   0x8000
>  #define SCTP_FROM_SCTP_OUTPUT   0x9000
>  #define SCTP_FROM_SCTP_PEELOFF  0xa000
> -#define SCTP_FROM_SCTP_PANDA0xb000
> -#define SCTP_FROM_SCTP_SYSCTL   0xc000
> -#define SCTP_FROM_SCTP_CC_FUNCTIONS 0xd000
> +#define SCTP_FROM_SCTP_SYSCTL   0xb000
> +#define SCTP_FROM_SCTP_CC_FUNCTIONS 0xc000
>
>  /* Location ID's */
>  #define SCTP_LOC_1  0x0001
>
> Modified: head/sys/netinet/sctp_indata.c
> ==
> --- head/sys/netinet/sctp_indata.c  Sat Jun  6 17:48:55 2020
> (r361871)
> +++ head/sys/netinet/sctp_indata.c  Sat Jun  6 18:20:09 2020
> (r361872)
> @@ -2721,8 +2721,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o
>  * cluster... i.e. it is a small packet sent in and yet the driver
>  * underneath allocated a full cluster for it. If so we must copy it
>  * to a smaller mbuf and free up the cluster mbuf. This will help
> -* with cluster starvation. Note for __Panda__ we don't do this
> -* since it has clusters all the way down to 64 bytes.
> +* with cluster starvation.
>  */
> if (SCTP_BUF_LEN(m) < (long)MLEN && SCTP_BUF_NEXT(m) == NULL) {
> /* we only handle mbufs that are singletons.. not chains */
>
> Modified: head/sys/netinet/sctp_os.h
> ==
> --- head/sys/netinet/sctp_os.h  Sat Jun  6 17:48:55 2020(r361871)
> +++ head/sys/netinet/sctp_os.h  Sat Jun  6 18:20:09 2020(r361872)
> @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$");
>
>
>
> -
>  /* All os's must implement this address gatherer. If
>   * no VRF's exist, then vrf 0 is the only one and all
>   * addresses and ifn's live here.
>
> Modified: head/sys/netinet/sctp_output.c
> ==
> --- head/sys/netinet/sctp_output.c  Sat Jun  6 17:48:55 2020
> (r361871)
> +++ head/sys/netinet/sctp_output.c  Sat Jun  6 18:20:09 2020
> (r361872)
> @@ -6475,8 +6475,7 @@ error_out:
> appendchain = clonechain;
> } else {
> if (!copy_by_ref &&
> -   (sizeofcpy <= 
> (int)SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count) - 1) * MLEN) + MHLEN)))
> -   ) {
> +   (sizeofcpy <= 
> (int)SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count) - 1) * MLEN) + MHLEN 
> {
> /* Its not in a cluster */
> if (*endofchain == NULL) {
> /* lets get a mbuf cluster */
> @@ -13526,12 +13525,6 @@ skip_preblock:
> error = sctp_msg_append(stcb, net, top, srcv, 0);
> top = NULL;
> if (sinfo_flags & SCTP_EOF) {
> -   /*
> -* This should only happen for Panda for the mbuf
> -* send case, which does NOT yet support EEOR mode.
> -* Thus, we can just set this flag to do the proper
> -* EOF handling.
> -*/
> got_all_of_the_send = 1;
> }
> }
>
> Modified: head/sys/netinet/sctp_pcb.c
> ==
> --- head/sys/netinet/sctp_pcb.c Sat Jun  6 17:48:55 2020(r361871)
> +++ head/sys/netinet/sctp_pcb.c Sat Jun  6 18:20:09 2020(r361872)
> @@ -749,8 +749,7 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockadd
>
> /*-
>  * The name has priority over the ifn_index
> -  

svn commit: r361874 - head/sys/powerpc/powerpc

2020-06-06 Thread Justin Hibbits
Author: jhibbits
Date: Sat Jun  6 18:56:40 2020
New Revision: 361874
URL: https://svnweb.freebsd.org/changeset/base/361874

Log:
  powerpc: Fix nits in copyinout comments from r361861
  
  Also, remove useless nested #ifdefs in the IFUNC block.
  
  Reported by:  bdragon@

Modified:
  head/sys/powerpc/powerpc/copyinout.c

Modified: head/sys/powerpc/powerpc/copyinout.c
==
--- head/sys/powerpc/powerpc/copyinout.cSat Jun  6 18:43:08 2020
(r361873)
+++ head/sys/powerpc/powerpc/copyinout.cSat Jun  6 18:56:40 2020
(r361874)
@@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 /*
- * On powerpc64 (AIM only) the copy functions are IFUNcs, selecting the best
+ * On powerpc64 (AIM only) the copy functions are IFUNCs, selecting the best
  * option based on the PMAP in use.
  *
  * There are two options for copy functions on powerpc64:
@@ -85,10 +85,10 @@ __FBSDID("$FreeBSD$");
  *   remapping user segments into kernel.  This is used by the 'radix' pmap for
  *   performance.
  *
- * Book-E does not use the C functions, opting instead to use the 'direct'
- * copies, directly, avoiding the IFUNC overhead.
+ * Book-E does not use the C 'remap' functions, opting instead to use the
+ * 'direct' copies, directly, avoiding the IFUNC overhead.
  *
- * On 32-bit AIM these functions are direct, not IFUNCs, for performance.
+ * On 32-bit AIM these functions bypass the IFUNC machinery for performance.
  */
 #ifdef __powerpc64__
 int subyte_remap(volatile void *addr, int byte);
@@ -125,8 +125,8 @@ int casueword_direct(volatile u_long *addr, u_long old
u_long new);
 
 /*
- * The IFUNC resolver determines the copy based on if the PMAP implementation
- * includes a pmap_map_user_ptr function.
+ * The IFUNC resolver determines the copy based on whether the PMAP
+ * implementation includes a pmap_map_user_ptr function.
  */
 #define DEFINE_COPY_FUNC(ret, func, args)  \
DEFINE_IFUNC(, ret, func, args) \
@@ -140,15 +140,11 @@ DEFINE_COPY_FUNC(int, copyin, (const void *, void *, s
 DEFINE_COPY_FUNC(int, copyout, (const void *, void *, size_t))
 DEFINE_COPY_FUNC(int, suword, (volatile void *, long))
 DEFINE_COPY_FUNC(int, suword32, (volatile void *, int))
-#ifdef __powerpc64__
 DEFINE_COPY_FUNC(int, suword64, (volatile void *, int64_t))
-#endif
 DEFINE_COPY_FUNC(int, fubyte, (volatile const void *))
 DEFINE_COPY_FUNC(int, fuword16, (volatile const void *))
 DEFINE_COPY_FUNC(int, fueword32, (volatile const void *, int32_t *))
-#ifdef __powerpc64__
 DEFINE_COPY_FUNC(int, fueword64, (volatile const void *, int64_t *))
-#endif
 DEFINE_COPY_FUNC(int, fueword, (volatile const void *, long *))
 DEFINE_COPY_FUNC(int, casueword32,
 (volatile uint32_t *, uint32_t, uint32_t *, uint32_t))
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361873 - head/share/man/man4

2020-06-06 Thread Warner Losh
Author: imp
Date: Sat Jun  6 18:43:08 2020
New Revision: 361873
URL: https://svnweb.freebsd.org/changeset/base/361873

Log:
  Add a section on CAM architecture.
  Add xref to all SIM devices we currently have (including a rough indication
  which ones are likely to fail).
  Update to include all the CAM options.
  Fix a few igor nits while I'm here.

Modified:
  head/share/man/man4/scsi.4

Modified: head/share/man/man4/scsi.4
==
--- head/share/man/man4/scsi.4  Sat Jun  6 18:20:09 2020(r361872)
+++ head/share/man/man4/scsi.4  Sat Jun  6 18:43:08 2020(r361873)
@@ -24,7 +24,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd December 20, 2017
+.Dd June 6, 2020
 .Dt CAM 4
 .Os
 .Sh NAME
@@ -76,6 +76,17 @@ There are a number of generic kernel configuration opt
 .Nm
 subsystem:
 .Bl -tag -width SCSI_NO_SENSE_STRINGS
+.It Dv CAM_BOOT_DELAY
+Additional time to wait after the static parts of the kernel have run to allow
+for discovery of additional devices which may take time to connect,
+such as USB attached storage.
+.It Dv CAM_IOSCHED_DYNAMIC
+Enable dynamic decisions in the I/O scheduler based on hints and the current
+performance of the storage devices.
+.It Dv CAM_IO_STATS
+Enable collection of statistics for periph devices.
+.It Dv CAM_TEST_FAILURE
+Enable ability to simulate I/O failures.
 .It Dv CAMDEBUG
 This option compiles in all the
 .Nm
@@ -274,6 +285,83 @@ some adapters, but is not yet complete for this versio
 .Nm
 .Tn SCSI
 subsystem.
+.Sh ARCHITECTURE
+The
+.Nm
+subsystem glues together the upper layers of the system to the storage devices.
+PERIPH devices accept storage requests from GEOM and other upper layers of the
+system and translates them into protocol requests.
+XPT (transport) dispatches these protocol requests to a SIM driver.
+A SIM driver takes protocol requests and translates them into hardware commands
+the host adapter understands to transfer the protocol requests, and data (if
+any) to the storage device.
+The CCB transports these requests around as messages.
+.Ss CAM
+The Common Access Method was a standard defined in the 1990s to talk to disk
+drives.
+.Fx
+is one of the few operating systems to fully implement this model.
+The interface between different parts of CAM is the CCB (or CAM Control Block).
+Each CCB has a standard header, which contains the type of request and dispatch
+information, and a command specific portion.
+A CAM Periph generates requests.
+The XPT layer dispatches these requests to the appropriate SIM.
+Some CCBs are sent directly to the SIM for immediate processing, while others
+are queued and complete when the I/O has finished.
+A SIM takes CCBs and translates them into hardware specific commands to push 
the
+SCSI CDB or other protocol control block to the peripheral, along with setting
+up the DMA for the associated data.
+.Ss Periph Devices
+A periph driver knows how to translate standard requests into protocol messages
+that a SIM can deliver to hardware.
+These requests can come from any upper layer source, but primarily come in via
+GEOM as a bio request.
+They can also come in directly from character device requests for tapes and 
pass
+through commands.
+.Pp
+Disk devices, or direct access (da) in CAM, are one type of peripheral.
+These devices present themselves to the kernel a device ending in
+.Dq da .
+Each protocol has a unique device name:
+.Bl -tag -width 4
+.It Xr da 4
+SCSI or SAS device, or devices that accept SCSI CDBs for I/O.
+.It Xr ada 4
+ATA or SATA device
+.It Xr nda 4
+NVME device
+.It Xr mda 4
+An SD or MMC block storage device.
+.El
+.Pp
+Tape devices are called serial access
+.Po
+.Xr sa 4
+.Pc
+in CAM.
+They interface to the system via a character device and provide
+.Xr ioctl 2
+control for tape drives.
+.Pp
+The
+.Xr pass 4
+device will pass through CCB requests from userland to the SIM directly.
+The device is used to send commands other than read, write, trim or flush to a
+device.
+The
+.Xr camcontrol 8
+command uses this device.
+.Ss XPT drivers
+The transport driver connects the periph to the SIM.
+It is not configured separately.
+It is also responsible for device discovery for those SIM drivers that do not
+enumerate themselves.
+.Ss SIM driver
+SIM used to stand for SCSI Interface Module.
+Now it is just SIM because it understands protocols other than SCSI.
+There are two types of SIM drivers: virtual and physical.
+Physical SIMs are typically called host bus adapters (HBA), but not 
universally.
+Virtual SIM drivers are for communicating with virtual machine hosts.
 .Sh FILES
 see other
 .Nm
@@ -319,12 +407,12 @@ This builds into the kernel all possible
 .Nm
 debugging.
 .It Dv CAM_DEBUG_COMPILE
-This allows to specify support for which debugging flags described above
+This specifies support for which debugging flags described above
 should be built into the kernel.
 Flags may be ORed together if the user wishes to
 see 

svn commit: r361872 - head/sys/netinet

2020-06-06 Thread Michael Tuexen
Author: tuexen
Date: Sat Jun  6 18:20:09 2020
New Revision: 361872
URL: https://svnweb.freebsd.org/changeset/base/361872

Log:
  Non-functional changes due to cleanup (upstream removing of Panda support)
  of the code
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_constants.h
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_os.h
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_constants.h
==
--- head/sys/netinet/sctp_constants.h   Sat Jun  6 17:48:55 2020
(r361871)
+++ head/sys/netinet/sctp_constants.h   Sat Jun  6 18:20:09 2020
(r361872)
@@ -576,7 +576,6 @@ __FBSDID("$FreeBSD$");
  */
 #define SCTP_ASOC_MAX_CHUNKS_ON_QUEUE 512
 
-
 /*
  * Basically the minimum amount of time before I do a early FR. Making this
  * value to low will cause duplicate retransmissions.
@@ -756,9 +755,8 @@ __FBSDID("$FreeBSD$");
 #define SCTP_FROM_SCTP_ASCONF   0x8000
 #define SCTP_FROM_SCTP_OUTPUT   0x9000
 #define SCTP_FROM_SCTP_PEELOFF  0xa000
-#define SCTP_FROM_SCTP_PANDA0xb000
-#define SCTP_FROM_SCTP_SYSCTL   0xc000
-#define SCTP_FROM_SCTP_CC_FUNCTIONS 0xd000
+#define SCTP_FROM_SCTP_SYSCTL   0xb000
+#define SCTP_FROM_SCTP_CC_FUNCTIONS 0xc000
 
 /* Location ID's */
 #define SCTP_LOC_1  0x0001

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Sat Jun  6 17:48:55 2020
(r361871)
+++ head/sys/netinet/sctp_indata.c  Sat Jun  6 18:20:09 2020
(r361872)
@@ -2721,8 +2721,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o
 * cluster... i.e. it is a small packet sent in and yet the driver
 * underneath allocated a full cluster for it. If so we must copy it
 * to a smaller mbuf and free up the cluster mbuf. This will help
-* with cluster starvation. Note for __Panda__ we don't do this
-* since it has clusters all the way down to 64 bytes.
+* with cluster starvation.
 */
if (SCTP_BUF_LEN(m) < (long)MLEN && SCTP_BUF_NEXT(m) == NULL) {
/* we only handle mbufs that are singletons.. not chains */

Modified: head/sys/netinet/sctp_os.h
==
--- head/sys/netinet/sctp_os.h  Sat Jun  6 17:48:55 2020(r361871)
+++ head/sys/netinet/sctp_os.h  Sat Jun  6 18:20:09 2020(r361872)
@@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$");
 
 
 
-
 /* All os's must implement this address gatherer. If
  * no VRF's exist, then vrf 0 is the only one and all
  * addresses and ifn's live here.

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Sat Jun  6 17:48:55 2020
(r361871)
+++ head/sys/netinet/sctp_output.c  Sat Jun  6 18:20:09 2020
(r361872)
@@ -6475,8 +6475,7 @@ error_out:
appendchain = clonechain;
} else {
if (!copy_by_ref &&
-   (sizeofcpy <= 
(int)SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count) - 1) * MLEN) + MHLEN)))
-   ) {
+   (sizeofcpy <= 
(int)SCTP_BASE_SYSCTL(sctp_mbuf_threshold_count) - 1) * MLEN) + MHLEN {
/* Its not in a cluster */
if (*endofchain == NULL) {
/* lets get a mbuf cluster */
@@ -13526,12 +13525,6 @@ skip_preblock:
error = sctp_msg_append(stcb, net, top, srcv, 0);
top = NULL;
if (sinfo_flags & SCTP_EOF) {
-   /*
-* This should only happen for Panda for the mbuf
-* send case, which does NOT yet support EEOR mode.
-* Thus, we can just set this flag to do the proper
-* EOF handling.
-*/
got_all_of_the_send = 1;
}
}

Modified: head/sys/netinet/sctp_pcb.c
==
--- head/sys/netinet/sctp_pcb.c Sat Jun  6 17:48:55 2020(r361871)
+++ head/sys/netinet/sctp_pcb.c Sat Jun  6 18:20:09 2020(r361872)
@@ -749,8 +749,7 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockadd
 
/*-
 * The name has priority over the ifn_index
-* if its given. We do this especially for
-* panda who might recycle indexes fast.
+* if its given.
 */
if (if_name) {
if (strncmp(if_name, 

svn commit: r361871 - head/share/man/man7

2020-06-06 Thread Yuri Pankov
Author: yuripv
Date: Sat Jun  6 17:48:55 2020
New Revision: 361871
URL: https://svnweb.freebsd.org/changeset/base/361871

Log:
  stats(7): fix bad Xr references and lint noise
  
  Reviewed by:  bjk, debdrup
  Differential Revision:https://reviews.freebsd.org/D25166

Modified:
  head/share/man/man7/stats.7

Modified: head/share/man/man7/stats.7
==
--- head/share/man/man7/stats.7 Sat Jun  6 14:19:16 2020(r361870)
+++ head/share/man/man7/stats.7 Sat Jun  6 17:48:55 2020(r361871)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 14, 2020
+.Dd June 6, 2020
 .Dt STATS 7
 .Os
 .Sh NAME
@@ -86,31 +86,32 @@ Display system statistics
 Report virtual memory statistics
 .It Nm zpool iostat
 Report ZFS I/O statistics
+.El
 .Sh SEE ALSO
+.Xr btsockstat 1 ,
+.Xr fstat 1 ,
 .Xr intro 1 ,
+.Xr lockstat 1 ,
+.Xr netstat 1 ,
+.Xr plockstat 1 ,
+.Xr procstat 1 ,
+.Xr sockstat 1 ,
+.Xr stat 1 ,
+.Xr systat 1 ,
 .Xr intro 7 ,
-.Xr intro 8 ,
-.Xr btsockstat 1 ,
 .Xr ctlstat 8 ,
-.Xr fstat 1 ,
 .Xr gstat 8 ,
 .Xr ibstat 8 ,
 .Xr ifmcstat 8 ,
+.Xr intro 8 ,
 .Xr iostat 8 ,
 .Xr ipfstat 8 ,
 .Xr kldstat 8 ,
-.Xr lockstat 1 ,
 .Xr mailstats 8 ,
-.Xr netstat 1 ,
-.Xr plockstat 1 ,
 .Xr pmcstat 8 ,
-.Xr procstat 1 ,
 .Xr pstat 8 ,
-.Xr sockstat 1,
-.Xr stat 1 ,
-.Xr systat 1 ,
 .Xr vmstat 8 ,
-.Xr zpool-iostat 8 ,
+.Xr zpool 8
 .Sh HISTORY
 The
 .Nm
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r361870 - in head/sys/geom: . label

2020-06-06 Thread Allan Jude
On 2020-06-06 10:55, Shawn Webb wrote:
> On Sat, Jun 06, 2020 at 02:19:16PM +, Conrad Meyer wrote:
>> Author: cem
>> Date: Sat Jun  6 14:19:16 2020
>> New Revision: 361870
>> URL: https://svnweb.freebsd.org/changeset/base/361870
>>
>> Log:
>>   Revert r361838
> 
> Why?
> 

https://lists.freebsd.org/pipermail/freebsd-current/2020-June/076210.html


-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r361870 - in head/sys/geom: . label

2020-06-06 Thread Shawn Webb
On Sat, Jun 06, 2020 at 02:19:16PM +, Conrad Meyer wrote:
> Author: cem
> Date: Sat Jun  6 14:19:16 2020
> New Revision: 361870
> URL: https://svnweb.freebsd.org/changeset/base/361870
> 
> Log:
>   Revert r361838

Why?

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

GPG Key ID:  0xFF2E67A277F8E1FA
GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9  3633 C85B 0AF8 AB23 0FB2
https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc


signature.asc
Description: PGP signature


svn commit: r361870 - in head/sys/geom: . label

2020-06-06 Thread Conrad Meyer
Author: cem
Date: Sat Jun  6 14:19:16 2020
New Revision: 361870
URL: https://svnweb.freebsd.org/changeset/base/361870

Log:
  Revert r361838
  
  Reported by:  delphij

Modified:
  head/sys/geom/geom_dev.c
  head/sys/geom/label/g_label.c

Modified: head/sys/geom/geom_dev.c
==
--- head/sys/geom/geom_dev.cSat Jun  6 07:13:06 2020(r361869)
+++ head/sys/geom/geom_dev.cSat Jun  6 14:19:16 2020(r361870)
@@ -336,20 +336,9 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp,
struct cdev *dev, *adev;
char buf[SPECNAMELEN + 6];
struct make_dev_args args;
-   bool retaste;
 
g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name);
g_topology_assert();
-   /* Only one geom_dev per provider. */
-   LIST_FOREACH(cp, >consumers, consumers) {
-   if (cp->geom->class != mp || (cp->flags & G_CF_SPOILED))
-   continue;
-   gp = cp->geom;
-   sc = cp->private;
-   dev = sc->sc_dev;
-   retaste = true;
-   goto aliases;
-   }
gp = g_new_geomf(mp, "%s", pp->name);
sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
mtx_init(>sc_mtx, "g_dev", NULL, MTX_DEF);
@@ -391,8 +380,6 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp,
g_dev_attrchanged(cp, "GEOM::physpath");
snprintf(buf, sizeof(buf), "cdev=%s", gp->name);
devctl_notify_f("GEOM", "DEV", "CREATE", buf, M_WAITOK);
-   retaste = false;
-aliases:
/*
 * Now add all the aliases for this drive
 */
@@ -400,16 +387,8 @@ aliases:
error = make_dev_alias_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, 
, dev,
"%s", gap->ga_alias);
if (error) {
-   /*
-* With aliases added after initial taste, we don't
-* know which aliases are new in this retaste, so we
-* try to create all of them.  EEXIST is expected and
-* silently ignored or else this becomes really spammy.
-*/
-   if (error != EEXIST || !retaste)
-   printf("%s: make_dev_alias_p() failed (name=%s,"
-   " error=%d)\n", __func__, gap->ga_alias,
-   error);
+   printf("%s: make_dev_alias_p() failed (name=%s, 
error=%d)\n",
+   __func__, gap->ga_alias, error);
continue;
}
snprintf(buf, sizeof(buf), "cdev=%s", gap->ga_alias);

Modified: head/sys/geom/label/g_label.c
==
--- head/sys/geom/label/g_label.c   Sat Jun  6 07:13:06 2020
(r361869)
+++ head/sys/geom/label/g_label.c   Sat Jun  6 14:19:16 2020
(r361870)
@@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -345,16 +344,18 @@ g_label_taste(struct g_class *mp, struct g_provider *p
 {
struct g_label_metadata md;
struct g_consumer *cp;
-   struct g_class *clsp;
struct g_geom *gp;
int i;
-   bool changed;
 
g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name);
g_topology_assert();
 
G_LABEL_DEBUG(2, "Tasting %s.", pp->name);
 
+   /* Skip providers that are already open for writing. */
+   if (pp->acw > 0)
+   return (NULL);
+
if (strcmp(pp->geom->class->name, mp->name) == 0)
return (NULL);
 
@@ -390,16 +391,9 @@ g_label_taste(struct g_class *mp, struct g_provider *p
if (md.md_provsize != pp->mediasize)
break;
 
-   /* Skip providers that are already open for writing. */
-   if (pp->acw > 0) {
-   g_access(cp, -1, 0, 0);
-   goto end;
-   }
-
g_label_create(NULL, mp, pp, md.md_label, G_LABEL_DIR,
pp->mediasize - pp->sectorsize);
} while (0);
-   changed = false;
for (i = 0; g_labels[i] != NULL; i++) {
char label[128];
 
@@ -411,28 +405,8 @@ g_label_taste(struct g_class *mp, struct g_provider *p
g_topology_lock();
if (label[0] == '\0')
continue;
-   if (!g_label_is_name_ok(label)) {
-   G_LABEL_DEBUG(0,
-   "%s contains suspicious label, skipping.",
-   pp->name);
-   G_LABEL_DEBUG(1, "%s suspicious label is: %s",
-   pp->name, label);
-   continue;
-   }
-   g_provider_add_alias(pp, 

svn commit: r361869 - head/share/man/man4

2020-06-06 Thread Warner Losh
Author: imp
Date: Sat Jun  6 07:13:06 2020
New Revision: 361869
URL: https://svnweb.freebsd.org/changeset/base/361869

Log:
  Sort alphabetically.

Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileSat Jun  6 06:49:06 2020
(r361868)
+++ head/share/man/man4/MakefileSat Jun  6 07:13:06 2020
(r361869)
@@ -87,7 +87,6 @@ MAN=  aac.4 \
bwi.4 \
bwn.4 \
${_bytgpio.4} \
-   ${_chvgpio.4} \
capsicum.4 \
cardbus.4 \
carp.4 \
@@ -109,6 +108,7 @@ MAN=aac.4 \
cfumass.4 \
ch.4 \
chromebook_platform.4 \
+   ${_chvgpio.4} \
ciss.4 \
cloudabi.4 \
cmx.4 \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361868 - head/share/man/man4

2020-06-06 Thread Warner Losh
Author: imp
Date: Sat Jun  6 06:49:06 2020
New Revision: 361868
URL: https://svnweb.freebsd.org/changeset/base/361868

Log:
  Fix typo
  
  Submitted by: Yuri Pankov

Modified:
  head/share/man/man4/nda.4

Modified: head/share/man/man4/nda.4
==
--- head/share/man/man4/nda.4   Sat Jun  6 06:21:20 2020(r361867)
+++ head/share/man/man4/nda.4   Sat Jun  6 06:49:06 2020(r361868)
@@ -66,7 +66,7 @@ When set to 1,
 aliases will be created for all
 .Nm
 devices, including partitions and other
-.Xr goem 4
+.Xr geom 4
 providers that take their names from the disk's name.
 .Xr nvd
 devices will not, however, be reported in the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r361867 - head/share/man/man4

2020-06-06 Thread Yuri Pankov

Warner Losh wrote:

Author: imp
Date: Sat Jun  6 06:21:20 2020
New Revision: 361867
URL: https://svnweb.freebsd.org/changeset/base/361867

Log:
   Document all the sysctl values for the nda devices. Include some minimal
   documentation on namespace support for nda devices. Fix a few typos
   and formatting nits to apease igor.

Modified:
   head/share/man/man4/nda.4

Modified: head/share/man/man4/nda.4
==
--- head/share/man/man4/nda.4   Sat Jun  6 06:21:15 2020(r361866)
+++ head/share/man/man4/nda.4   Sat Jun  6 06:21:20 2020(r361867)
@@ -25,7 +25,7 @@
  .\"
  .\" $FreeBSD$
  .\"
-.Dd December 20, 2017
+.Dd June 6, 2020
  .Dt NDA 4
  .Os
  .Sh NAME
@@ -48,37 +48,156 @@ variables and
  .Xr loader 8
  tunables:
  .Bl -tag -width 12
+.It Va hw.nvme.use_nvd
+The
+.Xr nvme 4
+driver will create
+.Nm
+device nodes for block storage when set to 0.
+Create
+.Xr nvd 4
+device nodes for block storage when set to 1.
+See
+.Xr nvd 4
+when set to 1.
+.It Va kern.cam.nda.nvd_compat
+When set to 1,
+.Xr nvd 4
+aliases will be created for all
+.Nm
+devices, including partitions and other
+.Xr goem 4


A typo in the link.


+providers that take their names from the disk's name.
+.Xr nvd
+devices will not, however, be reported in the
+.Va kern.disks
+.Xr sysctl 8 .
  .It Va kern.cam.nda.sort_io_queue
-.Pp
  This variable determines whether the software queued entries are
  sorted in LBA order or not.
  Sorting is almost always a waste of time.
  The default is to not sort.
+.It Va kern.cam.nda.enable_biospeedup
+This variable determines if the
+.Nm
+devices participate in the speedup protocol.
+When the device participates in the speedup, then when the upper layers
+send a
+.Va BIO_SPEEDUP ,
+all current
+.Va BIO_DELETE
+requests not yet sent to the hardware are completed successfully immediate
+without sending them to the hardware.
+Used in low disk space scenarios when the filesystem encounters
+a critical shortage and needs blocks immediately.
+Since trims have maximum benefit when the LBA is unused for a long time,
+skipping the trim when space is needed for immediate writes results in little 
to
+no excess wear.
+When participation is disabled,
+.Va BIO_SPEEDUP
+requests are ignored.
+.It Va kern.cam.nda.max_trim
+The maximum number of LBA ranges to be collected together for each DSM trims
+send to the hardware.
+Defaults to 256, which is the maximum number of ranges the protocol supports.
+Sometimes poor trim performance can be mitigated by limiting the number of
+ranges sent to the device.
+This value must be between 1 and 256 inclusive.
  .El
  .Pp
  The following report per-device settings, and are read-only unless
-otherwise indicated. Replace
+otherwise indicated.
+Replace
  .Va N
  with the device unit number.
  .Bl -tag -width 12
  .It Va kern.cam.nda.N.rotating
-.Pp
  This variable reports whether the storage volume is spinning or
  flash.
-It's value is hard coded to 0 indicating flash.
+Its value is hard coded to 0 indicating flash.
  .It Va kern.cam.nda.N.unmapped_io
  This variable reports whether the
  .Nm
  driver accepts unmapped I/O for this unit.
+.It Va kern.cam.nda.N.flags
+This variable reports the current flags.
+.Bl -tag -width 12
+.It Va OPEN
+The device is open.
+.It Va DIRTY
+Set when a write to the drive is scheduled.
+Cleared after flush commands.
+.It Va SCTX_INIT
+Internal flag set after
+.Xr sysctl 8
+nodes have been created.
  .El
+.It Va kern.cam.nda.N.sort_io_queue
+Same as the
+.Va kern.cam.nda.sort_io_queue
+tunable.
+.It Va kern.cam.nda.N.trim_ticks
+Writable.
+When greater than zero, hold trims for up to this many ticks before sending
+to the drive.
+Sometimes waiting a little bit to collect more trims to send at one time
+improves trim performance.
+When 0, no delaying of trims are done.
+.It Va kern.cam.nda.N.trim_goal
+Writable.
+When delaying a bit to collect multiple trims, send the accumulated DSM TRIM to
+the drive.
+.It Va kern.cam.nda.N.trim_lbas
+Total number of LBAs that have been trimmed.
+.It Va kern.cam.nda.N.trim_ranges
+Total number of LBA ranges that have been trimmed.
+.It Va kern.cam.nda.N.trim_count
+Total number of trims sent to the hardware.
+.It Va kern.cam.nda.N.deletes
+Total number of
+.Va BIO_DELETE
+requests queued to the device.
+.El
+.Sh NAMESPACE MAPPING
+Each
+.Xr nvme 4
+drive has one or more namespaces associated with it.
+One instance of the
+.Nm
+driver will be created for each of the namespaces on
+the drive.
+All the
+.Nm
+nodes for a
+.Xr nvme 4
+device are at target 0.
+However, the namespace ID maps to the CAM lun, as reported
+in kernel messages and in the
+.Va devlist
+sub command of
+.Xr camcontrol 8 .
+.Pp
+Namespaces are managed with the
+.Va ns
+sub command of
+.Xr nvmecontrol 8 .
+Not all drives support namespace management,
+but all drives support at least one namespace.
+Device nodes for
+.Nm
+will be created and destroyed dynamically as

Re: svn commit: r361867 - head/share/man/man4

2020-06-06 Thread Warner Losh
On Sat, Jun 6, 2020 at 12:22 AM Mark Linimon  wrote:

> On Sat, Jun 06, 2020 at 06:21:20AM +, Warner Losh wrote:
> > Document all the sysctl values for the nda devices.
>
> Thank you.
>

You are welcome. This is overdue. And is likely missing a MFC After line.

And if you read developers, you know why I did it. :)

Warner
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r361867 - head/share/man/man4

2020-06-06 Thread Mark Linimon
On Sat, Jun 06, 2020 at 06:21:20AM +, Warner Losh wrote:
> Document all the sysctl values for the nda devices.

Thank you.

mcl
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361866 - head/sys/cam/nvme

2020-06-06 Thread Warner Losh
Author: imp
Date: Sat Jun  6 06:21:15 2020
New Revision: 361866
URL: https://svnweb.freebsd.org/changeset/base/361866

Log:
  Add a tunable for the nvd symlink creation.
  
  Some automation tries to detect if nvd or nda is in used, and the presence of
  both confuses it. Provide a knob to turn off nvd alias creation
  (kern.cam.nda.nvd_compat=0) for these situations. The default is the same:
  create the nvd compat link.

Modified:
  head/sys/cam/nvme/nvme_da.c

Modified: head/sys/cam/nvme/nvme_da.c
==
--- head/sys/cam/nvme/nvme_da.c Sat Jun  6 06:20:04 2020(r361865)
+++ head/sys/cam/nvme/nvme_da.c Sat Jun  6 06:21:15 2020(r361866)
@@ -185,11 +185,14 @@ static int nda_send_ordered = NDA_DEFAULT_SEND_ORDERED
 static int nda_default_timeout = NDA_DEFAULT_TIMEOUT;
 static int nda_max_trim_entries = NDA_MAX_TRIM_ENTRIES;
 static int nda_enable_biospeedup = 1;
+static int nda_nvd_compat = 1;
 SYSCTL_INT(_kern_cam_nda, OID_AUTO, max_trim, CTLFLAG_RDTUN,
 _max_trim_entries, NDA_MAX_TRIM_ENTRIES,
 "Maximum number of BIO_DELETE to send down as a DSM TRIM.");
 SYSCTL_INT(_kern_cam_nda, OID_AUTO, enable_biospeedup, CTLFLAG_RDTUN,
-_enable_biospeedup, 0, "Enable BIO_SPEEDUP processing");
+_enable_biospeedup, 0, "Enable BIO_SPEEDUP processing.");
+SYSCTL_INT(_kern_cam_nda, OID_AUTO, nvd_compat, CTLFLAG_RDTUN,
+_nvd_compat, 1, "Enable creation of nvd aliases.");
 
 /*
  * All NVMe media is non-rotational, so all nvme device instances
@@ -950,7 +953,8 @@ ndaregister(struct cam_periph *periph, void *arg)
/*
 * Add alias for older nvd drives to ease transition.
 */
-   disk_add_alias(disk, "nvd");
+   if (nda_nvd_compat)
+   disk_add_alias(disk, "nvd");
 
/*
 * Acquire a reference to the periph before we register with GEOM.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361867 - head/share/man/man4

2020-06-06 Thread Warner Losh
Author: imp
Date: Sat Jun  6 06:21:20 2020
New Revision: 361867
URL: https://svnweb.freebsd.org/changeset/base/361867

Log:
  Document all the sysctl values for the nda devices. Include some minimal
  documentation on namespace support for nda devices. Fix a few typos
  and formatting nits to apease igor.

Modified:
  head/share/man/man4/nda.4

Modified: head/share/man/man4/nda.4
==
--- head/share/man/man4/nda.4   Sat Jun  6 06:21:15 2020(r361866)
+++ head/share/man/man4/nda.4   Sat Jun  6 06:21:20 2020(r361867)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 20, 2017
+.Dd June 6, 2020
 .Dt NDA 4
 .Os
 .Sh NAME
@@ -48,37 +48,156 @@ variables and
 .Xr loader 8
 tunables:
 .Bl -tag -width 12
+.It Va hw.nvme.use_nvd
+The
+.Xr nvme 4
+driver will create
+.Nm
+device nodes for block storage when set to 0.
+Create
+.Xr nvd 4
+device nodes for block storage when set to 1.
+See
+.Xr nvd 4
+when set to 1.
+.It Va kern.cam.nda.nvd_compat
+When set to 1,
+.Xr nvd 4
+aliases will be created for all
+.Nm
+devices, including partitions and other
+.Xr goem 4
+providers that take their names from the disk's name.
+.Xr nvd
+devices will not, however, be reported in the
+.Va kern.disks
+.Xr sysctl 8 .
 .It Va kern.cam.nda.sort_io_queue
-.Pp
 This variable determines whether the software queued entries are
 sorted in LBA order or not.
 Sorting is almost always a waste of time.
 The default is to not sort.
+.It Va kern.cam.nda.enable_biospeedup
+This variable determines if the
+.Nm
+devices participate in the speedup protocol.
+When the device participates in the speedup, then when the upper layers
+send a
+.Va BIO_SPEEDUP ,
+all current
+.Va BIO_DELETE
+requests not yet sent to the hardware are completed successfully immediate
+without sending them to the hardware.
+Used in low disk space scenarios when the filesystem encounters
+a critical shortage and needs blocks immediately.
+Since trims have maximum benefit when the LBA is unused for a long time,
+skipping the trim when space is needed for immediate writes results in little 
to
+no excess wear.
+When participation is disabled,
+.Va BIO_SPEEDUP
+requests are ignored.
+.It Va kern.cam.nda.max_trim
+The maximum number of LBA ranges to be collected together for each DSM trims
+send to the hardware.
+Defaults to 256, which is the maximum number of ranges the protocol supports.
+Sometimes poor trim performance can be mitigated by limiting the number of
+ranges sent to the device.
+This value must be between 1 and 256 inclusive.
 .El
 .Pp
 The following report per-device settings, and are read-only unless
-otherwise indicated. Replace
+otherwise indicated.
+Replace
 .Va N
 with the device unit number.
 .Bl -tag -width 12
 .It Va kern.cam.nda.N.rotating
-.Pp
 This variable reports whether the storage volume is spinning or
 flash.
-It's value is hard coded to 0 indicating flash.
+Its value is hard coded to 0 indicating flash.
 .It Va kern.cam.nda.N.unmapped_io
 This variable reports whether the
 .Nm
 driver accepts unmapped I/O for this unit.
+.It Va kern.cam.nda.N.flags
+This variable reports the current flags.
+.Bl -tag -width 12
+.It Va OPEN
+The device is open.
+.It Va DIRTY
+Set when a write to the drive is scheduled.
+Cleared after flush commands.
+.It Va SCTX_INIT
+Internal flag set after
+.Xr sysctl 8
+nodes have been created.
 .El
+.It Va kern.cam.nda.N.sort_io_queue
+Same as the
+.Va kern.cam.nda.sort_io_queue
+tunable.
+.It Va kern.cam.nda.N.trim_ticks
+Writable.
+When greater than zero, hold trims for up to this many ticks before sending
+to the drive.
+Sometimes waiting a little bit to collect more trims to send at one time
+improves trim performance.
+When 0, no delaying of trims are done.
+.It Va kern.cam.nda.N.trim_goal
+Writable.
+When delaying a bit to collect multiple trims, send the accumulated DSM TRIM to
+the drive.
+.It Va kern.cam.nda.N.trim_lbas
+Total number of LBAs that have been trimmed.
+.It Va kern.cam.nda.N.trim_ranges
+Total number of LBA ranges that have been trimmed.
+.It Va kern.cam.nda.N.trim_count
+Total number of trims sent to the hardware.
+.It Va kern.cam.nda.N.deletes
+Total number of
+.Va BIO_DELETE
+requests queued to the device.
+.El
+.Sh NAMESPACE MAPPING
+Each
+.Xr nvme 4
+drive has one or more namespaces associated with it.
+One instance of the
+.Nm
+driver will be created for each of the namespaces on
+the drive.
+All the
+.Nm
+nodes for a
+.Xr nvme 4
+device are at target 0.
+However, the namespace ID maps to the CAM lun, as reported
+in kernel messages and in the
+.Va devlist
+sub command of
+.Xr camcontrol 8 .
+.Pp
+Namespaces are managed with the
+.Va ns
+sub command of
+.Xr nvmecontrol 8 .
+Not all drives support namespace management,
+but all drives support at least one namespace.
+Device nodes for
+.Nm
+will be created and destroyed dynamically as
+namespaces are activated or detached.
 .Sh FILES
 .Bl -tag -width ".Pa 

svn commit: r361865 - head/sys/cam/nvme

2020-06-06 Thread Warner Losh
Author: imp
Date: Sat Jun  6 06:20:04 2020
New Revision: 361865
URL: https://svnweb.freebsd.org/changeset/base/361865

Log:
  Ensure that we send at least LBA range per TRIM.

Modified:
  head/sys/cam/nvme/nvme_da.c

Modified: head/sys/cam/nvme/nvme_da.c
==
--- head/sys/cam/nvme/nvme_da.c Sat Jun  6 06:17:51 2020(r361864)
+++ head/sys/cam/nvme/nvme_da.c Sat Jun  6 06:20:04 2020(r361865)
@@ -1082,6 +1082,7 @@ ndastart(struct cam_periph *periph, union ccb *start_c
TAILQ_INIT(>bps);
bp1 = bp;
ents = min(nitems(trim->dsm), nda_max_trim_entries);
+   ents = max(ents, 1);
dsm_range = trim->dsm;
dsm_end = dsm_range + ents;
do {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r361864 - head/sys/net80211

2020-06-06 Thread Adrian Chadd
Author: adrian
Date: Sat Jun  6 06:17:51 2020
New Revision: 361864
URL: https://svnweb.freebsd.org/changeset/base/361864

Log:
  [net80211] Fix this typo!
  
  I've just started using this macro in upcoming amsdu/ampdu/ff rework and
  yes, too many parens.  Oops!

Modified:
  head/sys/net80211/ieee80211_ht.h

Modified: head/sys/net80211/ieee80211_ht.h
==
--- head/sys/net80211/ieee80211_ht.hSat Jun  6 05:46:12 2020
(r361863)
+++ head/sys/net80211/ieee80211_ht.hSat Jun  6 06:17:51 2020
(r361864)
@@ -74,7 +74,7 @@ struct ieee80211_tx_ampdu {
  * A-MSDU in A-MPDU
  */
 #defineIEEE80211_AMPDU_RUNNING_AMSDU(tap) \
-   tap)->txa_flags & (IEEE80211_AGGR_RUNNING | IEEE80211_AGGR_AMSDU)) \
+   (((tap)->txa_flags & (IEEE80211_AGGR_RUNNING | IEEE80211_AGGR_AMSDU)) \
== (IEEE80211_AGGR_RUNNING | IEEE80211_AGGR_AMSDU))
 
 /* return non-zero if AMPDU tx for the TID was NACKed */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"