svn commit: r366469 - head/tests/sys/kern

2020-10-05 Thread Li-Wen Hsu
Author: lwhsu
Date: Tue Oct  6 04:18:42 2020
New Revision: 366469
URL: https://svnweb.freebsd.org/changeset/base/366469

Log:
  Clear the dmesg buffer to prevent rotating causes issues
  
  This is a workaround for the current continuously failing test case
  
  sys.kern.sonewconn_overflow.sonewconn_overflow_01
  
  The side effect is the dmesg buffer got cleared and may effect other tests
  depends on dmesg output running in parallel.  The better solution would be
  tailing the log file like /var/log/debug.log
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tests/sys/kern/sonewconn_overflow.py

Modified: head/tests/sys/kern/sonewconn_overflow.py
==
--- head/tests/sys/kern/sonewconn_overflow.py   Tue Oct  6 02:57:37 2020
(r366468)
+++ head/tests/sys/kern/sonewconn_overflow.py   Tue Oct  6 04:18:42 2020
(r366469)
@@ -85,6 +85,8 @@ class UnixTest(GenericTest):
 
 class LogChecker():
 def __init__(self):
+# Clear the dmesg buffer to prevent rotating causes issues
+os.system('/sbin/dmesg -c > /dev/null')
 # Figure out how big the dmesg buffer is.
 self.dmesgOff = len(check_output("/sbin/dmesg"))
 
___
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: r366468 - head/lib/libkvm

2020-10-05 Thread Mateusz Guzik
Author: mjg
Date: Tue Oct  6 02:57:37 2020
New Revision: 366468
URL: https://svnweb.freebsd.org/changeset/base/366468

Log:
  libkvm: catch up with pre-subtracated per-cpu addresses
  
  Only concerns amd64.
  
  Reported by:  imp

Modified:
  head/lib/libkvm/kvm_pcpu.c

Modified: head/lib/libkvm/kvm_pcpu.c
==
--- head/lib/libkvm/kvm_pcpu.c  Mon Oct  5 22:18:04 2020(r366467)
+++ head/lib/libkvm/kvm_pcpu.c  Tue Oct  6 02:57:37 2020(r366468)
@@ -50,15 +50,23 @@ __FBSDID("$FreeBSD$");
 
 #include "kvm_private.h"
 
+#ifdef __amd64__
+#define__OFFSET_BY_PCPU
+#endif
+
 static struct nlist kvm_pcpu_nl[] = {
{ .n_name = "_cpuid_to_pcpu" },
{ .n_name = "_mp_maxcpus" },
{ .n_name = "_mp_ncpus" },
+#ifdef __OFFSET_BY_PCPU
+   { .n_name = "___pcpu" },
+#endif
{ .n_name = NULL },
 };
 #defineNL_CPUID_TO_PCPU0
 #defineNL_MP_MAXCPUS   1
 #defineNL_MP_NCPUS 2
+#defineNL___PCPU   3
 
 /*
  * Kernel per-CPU data state.  We cache this stuff on the first
@@ -71,6 +79,9 @@ static struct nlist kvm_pcpu_nl[] = {
 static void **pcpu_data;
 static int maxcpu;
 static int mp_ncpus;
+#ifdef __OFFSET_BY_PCPU
+static unsigned long __pcpu;
+#endif
 
 static int
 _kvm_pcpu_init(kvm_t *kd)
@@ -103,6 +114,17 @@ _kvm_pcpu_init(kvm_t *kd)
_kvm_err(kd, kd->program, "cannot read mp_ncpus");
return (-1);
}
+#ifdef __OFFSET_BY_PCPU
+   if (kvm_pcpu_nl[NL___PCPU].n_value == 0) {
+   _kvm_err(kd, kd->program, "unable to find __pcpu");
+   return (-1);
+   }
+   if (kvm_read(kd, kvm_pcpu_nl[NL___PCPU].n_value, &__pcpu,
+   sizeof(__pcpu)) != sizeof(__pcpu)) {
+   _kvm_err(kd, kd->program, "cannot read __pcpu");
+   return (-1);
+   }
+#endif
len = max * sizeof(void *);
data = malloc(len);
if (data == NULL) {
@@ -329,6 +351,13 @@ kvm_read_zpcpu(kvm_t *kd, u_long base, void *buf, size
 
if (!kvm_native(kd))
return (-1);
+   if (mp_ncpus == 0)
+   if (_kvm_pcpu_init(kd) < 0)
+   return (0);
+
+#ifdef __OFFSET_BY_PCPU
+   base += __pcpu;
+#endif
return (kvm_read(kd, (uintptr_t)(base + sizeof(struct pcpu) * cpu),
buf, size));
 }
___
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: r366429 - in head/sys: kern sys

2020-10-05 Thread Scott Long


> On Oct 5, 2020, at 1:35 PM, Mateusz Guzik  wrote:
> 
> On 10/5/20, Konstantin Belousov  wrote:
>> On Sun, Oct 04, 2020 at 09:06:02PM +, Rick Macklem wrote:
>>> Mateusz Guzik wrote:
 Why is the process lock always taken? It looks like both routines just
 check a thread-local flag, so perhaps this can get away without
 serializing this process-wide?
>>> I did spot this slight difference between the initial version of
>>> sig_intr() and
>>> this one.  At least w.r.t. copy_file_range(2), the call happens
>>> infrequently
>>> enough that the overhead of acquiring the lock is not significant.
>>> 
>> Yes, the function should not be on any frequent path.
>> 
>> That said, all signal delivery to process is covered by the process lock,
>> so checks under process lock make the advisory answer provide less false
>> negatives.  If considered too importand in some cases (when ?), the
>> following
>> patch can be applied.
>> 
>> diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
>> index 8108d4cb3a5..ed4dd52b66d 100644
>> --- a/sys/kern/kern_sig.c
>> +++ b/sys/kern/kern_sig.c
>> @@ -3212,6 +3212,9 @@ sig_intr(void)
>>  int ret;
>> 
>>  td = curthread;
>> +if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) == 0)
>> +return (0);
>> +
>>  p = td->td_proc;
>> 
>>  PROC_LOCK(p);
>> 
> 
> I presume copy_file_range will not be the only consumer going forward.
> 
> The default for all new code should be to avoid locks or other atomics
> if it can be helped, otherwise it's just never ending whack-a-mole and
> this is bound to become a bottleneck at some point.
> 
> So happens process lock is already quite contended (e.g., when running
> poudriere) and adding to it is the wrong way to go.
> 
> -- 
> 

Agreed.  After all of the work that’s been done in the last 20 years to make
SMP work well on FreeBSD, I’m not sure why it’s ok to wave ones hand and
say that serializing locks are still ok, or that they don’t matter.  The bias 
needs
to be against adding more serialization points, even if it’s not convenient.

Scott


___
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: r366466 - head/usr.sbin/crunch/crunchgen

2020-10-05 Thread Kyle Evans
On Mon, Oct 5, 2020 at 4:39 PM Alexey Dokuchaev  wrote:
>
> On Mon, Oct 05, 2020 at 08:57:44PM +, Kyle Evans wrote:
> > New Revision: 366466
> > URL: https://svnweb.freebsd.org/changeset/base/366466
> >
> > Log:
> >   crunchgen: fix MK_AUTO_OBJ logic after r364166
> >
> >   r364166 converted echo -n `/bin/pwd` to a raw pwd invocation, leaving a
> >   trailing newline at the end of path.  This caused a later stat() of it to
> >   erroneously fail and the fallback to MK_AUTO_OBJ=no logic proceeded as
> >   unexpected.
>
> [...]
> @@ -648,8 +653,7 @@
>
> /* Determine the actual srcdir (maybe symlinked). */
> if (p->srcdir) {
> -   snprintf(line, MAXLINELEN, "cd %s && echo -n `/bin/pwd`",
> -   p->srcdir);
> +   snprintf(line, MAXLINELEN, "cd %s && pwd", p->srcdir);
> f = popen(line,"r");
>
> Calling popen("cd somedir && pwd") in a C program to resolve symlinks,
> seriously?  Why not simply call realpath(3) instead? :-/
>

Excellent question. :-) CC'ing Alex, because he might have looked at
this more in-depth. I don't see any real reason for the status quo vs.
realpath(3) off the top of my head, but I'm not familiar with the
history and don't quite have the time to track down the ramifications
of the change.

Thanks,

Kyle Evans
___
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: r366467 - head/sys/dev/cxgbe

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 22:18:04 2020
New Revision: 366467
URL: https://svnweb.freebsd.org/changeset/base/366467

Log:
  cxgbe(4) sysctls do not need Giant.
  
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cMon Oct  5 20:57:44 2020
(r366466)
+++ head/sys/dev/cxgbe/t4_main.cMon Oct  5 22:18:04 2020
(r366467)
@@ -6327,7 +6327,7 @@ t4_sysctls(struct adapter *sc)
sc->params.nports, "# of ports");
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "doorbells",
-   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, doorbells,
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, doorbells,
(uintptr_t)>doorbells, sysctl_bitfield_8b, "A",
"available doorbells");
 
@@ -6335,12 +6335,12 @@ t4_sysctls(struct adapter *sc)
sc->params.vpd.cclk, "core clock frequency (in KHz)");
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_timers",
-   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT,
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
sc->params.sge.timer_val, sizeof(sc->params.sge.timer_val),
sysctl_int_array, "A", "interrupt holdoff timer values (us)");
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pkt_counts",
-   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT,
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
sc->params.sge.counter_val, sizeof(sc->params.sge.counter_val),
sysctl_int_array, "A", "interrupt holdoff packet counter values");
 
@@ -6400,7 +6400,7 @@ t4_sysctls(struct adapter *sc)
 
 #define SYSCTL_CAP(name, n, text) \
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, #name, \
-   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, caps_decoder[n], \
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, caps_decoder[n], \
(uintptr_t)>name, sysctl_bitfield_16b, "A", \
"available " text " capabilities")
 
@@ -6419,27 +6419,27 @@ t4_sysctls(struct adapter *sc)
NULL, sc->tids.nftids, "number of filters");
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature",
-   CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0,
+   CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0,
sysctl_temperature, "I", "chip temperature (in Celsius)");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "reset_sensor",
-   CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0,
+   CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0,
sysctl_reset_sensor, "I", "reset the chip's temperature sensor.");
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "loadavg",
-   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0,
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0,
sysctl_loadavg, "A",
"microprocessor load averages (debug firmwares only)");
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "core_vdd",
-   CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_vdd,
+   CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_vdd,
"I", "core Vdd (in mV)");
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "local_cpus",
-   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, LOCAL_CPUS,
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, LOCAL_CPUS,
sysctl_cpus, "A", "local CPUs");
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_cpus",
-   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, INTR_CPUS,
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, INTR_CPUS,
sysctl_cpus, "A", "preferred CPUs for interrupts");
 
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "swintr", CTLFLAG_RW,
@@ -6454,175 +6454,175 @@ t4_sysctls(struct adapter *sc)
children = SYSCTL_CHILDREN(oid);
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cctrl",
-   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0,
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0,
sysctl_cctrl, "A", "congestion control");
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_tp0",
-   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0,
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0,
sysctl_cim_ibq_obq, "A", "CIM IBQ 0 (TP0)");
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_tp1",
-   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 1,
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 1,
sysctl_cim_ibq_obq, "A", "CIM IBQ 1 (TP1)");
 
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_ulp",
-   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 2,
+   

Re: svn commit: r366466 - head/usr.sbin/crunch/crunchgen

2020-10-05 Thread Alexey Dokuchaev
On Mon, Oct 05, 2020 at 08:57:44PM +, Kyle Evans wrote:
> New Revision: 366466
> URL: https://svnweb.freebsd.org/changeset/base/366466
> 
> Log:
>   crunchgen: fix MK_AUTO_OBJ logic after r364166
>   
>   r364166 converted echo -n `/bin/pwd` to a raw pwd invocation, leaving a
>   trailing newline at the end of path.  This caused a later stat() of it to
>   erroneously fail and the fallback to MK_AUTO_OBJ=no logic proceeded as
>   unexpected.

[...]
@@ -648,8 +653,7 @@
 
/* Determine the actual srcdir (maybe symlinked). */
if (p->srcdir) {
-   snprintf(line, MAXLINELEN, "cd %s && echo -n `/bin/pwd`",
-   p->srcdir);
+   snprintf(line, MAXLINELEN, "cd %s && pwd", p->srcdir);
f = popen(line,"r");

Calling popen("cd somedir && pwd") in a C program to resolve symlinks,
seriously?  Why not simply call realpath(3) instead? :-/

./danfe
___
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: r366466 - head/usr.sbin/crunch/crunchgen

2020-10-05 Thread Kyle Evans
Author: kevans
Date: Mon Oct  5 20:57:44 2020
New Revision: 366466
URL: https://svnweb.freebsd.org/changeset/base/366466

Log:
  crunchgen: fix MK_AUTO_OBJ logic after r364166
  
  r364166 converted echo -n `/bin/pwd` to a raw pwd invocation, leaving a
  trailing newline at the end of path.  This caused a later stat() of it to
  erroneously fail and the fallback to MK_AUTO_OBJ=no logic proceeded as
  unexpected.
  
  Harry Schmalzbauer bissected the resulting build failure he experienced
  (stable/12 host, -HEAD build) down to r365887. This change is mostly
  unrelated, except it switches the build to bootstrapped crunchgen - clue!
  
  I then bissected recent crunchgen changes going back a bit since we wouldn't
  observe the failure immediately with -CURRENT in most configurations, which
  landed me on r364166. After many intense head-scratching minutes and printf
  debugging, I realized that the newline was the difference. This is where our
  tale ends.
  
  Reported by:  Harry Schmalzbauer, O. Hartmann, Mike Tancsa, kevans
  MFC after:3 days

Modified:
  head/usr.sbin/crunch/crunchgen/crunchgen.c

Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c
==
--- head/usr.sbin/crunch/crunchgen/crunchgen.c  Mon Oct  5 20:13:22 2020
(r366465)
+++ head/usr.sbin/crunch/crunchgen/crunchgen.c  Mon Oct  5 20:57:44 2020
(r366466)
@@ -666,6 +666,8 @@ fillin_program(prog_t *p)
if (!*path)
errx(1, "Can't perform pwd on: %s\n", p->srcdir);
 
+   /* Chop off trailing newline. */
+   path[strlen(path) - 1] = '\0';
p->realsrcdir = strdup(path);
}
 
___
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: r366465 - in head: sbin/sysctl sys/kern sys/sys usr.bin/truss

2020-10-05 Thread Ryan Moeller
Author: freqlabs
Date: Mon Oct  5 20:13:22 2020
New Revision: 366465
URL: https://svnweb.freebsd.org/changeset/base/366465

Log:
  Enable iterating all sysctls, even ones with CTLFLAG_SKIP
  
  Add an "nextnoskip" sysctl that allows for listing of sysctls intended to be
  normally skipped for cost reasons.
  
  This makes it so the names/descriptions of those sysctls can be discovered 
with
  sysctl -aN/sysctl -ad/sysctl -at.
  
  It also makes it so children are visited when a node flagged with CTLFLAG_SKIP
  is explicitly requested.
  
  The intended use case is to mark the root "kstat" node with CTLFLAG_SKIP so 
that
  the extensive and expensive stats are skipped by default but may still be 
easily
  obtained without having to know them all (which may not even be possible) and
  request each one-by-one.
  
  Reviewed by:  jhb
  MFC after:2 weeks
  Relnotes: yes
  Sponsored by: iXsystems, Inc.
  Differential Revision:https://reviews.freebsd.org/D26560

Modified:
  head/sbin/sysctl/sysctl.c
  head/sys/kern/kern_sysctl.c
  head/sys/sys/sysctl.h
  head/usr.bin/truss/syscalls.c

Modified: head/sbin/sysctl/sysctl.c
==
--- head/sbin/sysctl/sysctl.c   Mon Oct  5 19:58:55 2020(r366464)
+++ head/sbin/sysctl/sysctl.c   Mon Oct  5 20:13:22 2020(r366465)
@@ -81,7 +81,7 @@ static intNflag, nflag, oflag, qflag, tflag, Tflag, W
 static int oidfmt(int *, int, char *, u_int *);
 static int parsefile(const char *);
 static int parse(const char *, int);
-static int show_var(int *, int);
+static int show_var(int *, int, bool);
 static int sysctl_all(int *oid, int len);
 static int name2oid(const char *, int *);
 
@@ -428,13 +428,13 @@ parse(const char *string, int lineno)
if (newvalstr == NULL || dflag) {
if ((kind & CTLTYPE) == CTLTYPE_NODE) {
if (dflag) {
-   i = show_var(mib, len);
+   i = show_var(mib, len, false);
if (!i && !bflag)
putchar('\n');
}
sysctl_all(mib, len);
} else {
-   i = show_var(mib, len);
+   i = show_var(mib, len, false);
if (!i && !bflag)
putchar('\n');
}
@@ -504,7 +504,7 @@ parse(const char *string, int lineno)
break;
}
 
-   i = show_var(mib, len);
+   i = show_var(mib, len, false);
if (sysctl(mib, len, 0, 0, newval, newsize) == -1) {
free(newbuf);
if (!i && !bflag)
@@ -532,7 +532,7 @@ parse(const char *string, int lineno)
printf(" -> ");
i = nflag;
nflag = 1;
-   j = show_var(mib, len);
+   j = show_var(mib, len, false);
if (!j && !bflag)
putchar('\n');
nflag = i;
@@ -942,7 +942,7 @@ oidfmt(int *oid, int len, char *fmt, u_int *kind)
  * Return minus one if we had errors.
  */
 static int
-show_var(int *oid, int nlen)
+show_var(int *oid, int nlen, bool honor_skip)
 {
u_char buf[BUFSIZ], *val, *oval, *p;
char name[BUFSIZ], fmt[BUFSIZ];
@@ -976,11 +976,11 @@ show_var(int *oid, int nlen)
oidfmt(oid, nlen, fmt, );
/* if Wflag then only list sysctls that are writeable and not stats. */
if (Wflag && ((kind & CTLFLAG_WR) == 0 || (kind & CTLFLAG_STATS) != 0))
-   return 1;
+   return (1);
 
/* if Tflag then only list sysctls that are tuneables. */
if (Tflag && (kind & CTLFLAG_TUN) == 0)
-   return 1;
+   return (1);
 
if (Nflag) {
printf("%s", name);
@@ -1013,6 +1013,10 @@ show_var(int *oid, int nlen)
return (0);
}
 
+   /* bail before fetching the value if we're honoring skip */
+   if (honor_skip && (kind & CTLFLAG_SKIP) != 0)
+   return (1);
+
/* don't fetch opaques that we don't know how to print */
if (ctltype == CTLTYPE_OPAQUE) {
if (strcmp(fmt, "S,clockinfo") == 0)
@@ -1195,15 +1199,17 @@ sysctl_all(int *oid, int len)
int name1[22], name2[22];
int i, j;
size_t l1, l2;
+   bool honor_skip = false;
 
-   name1[0] = 0;
-   name1[1] = 2;
+   name1[0] = CTL_SYSCTL;
+   name1[1] = (oid != NULL || Nflag || dflag || tflag) ?
+   CTL_SYSCTL_NEXTNOSKIP : CTL_SYSCTL_NEXT;
l1 = 2;
if (len) {
-   memcpy(name1+2, oid, len * sizeof(int));
+   memcpy(name1 + 2, oid, len * sizeof(int));
l1 += len;
} else {
-   name1[2] = 1;
+   

svn commit: r366464 - in head/sys/dev: re rl

2020-10-05 Thread Mark Johnston
Author: markj
Date: Mon Oct  5 19:58:55 2020
New Revision: 366464
URL: https://svnweb.freebsd.org/changeset/base/366464

Log:
  re(4): Add a 8168-compatible device ID
  
  This is described in RealTek's driver as a "RTL8168 Series add-on card."
  
  PR:   250037
  Submitted by: Hiroshi HASEGAWA 
  MFC after:1 week

Modified:
  head/sys/dev/re/if_re.c
  head/sys/dev/rl/if_rlreg.h

Modified: head/sys/dev/re/if_re.c
==
--- head/sys/dev/re/if_re.c Mon Oct  5 19:45:11 2020(r366463)
+++ head/sys/dev/re/if_re.c Mon Oct  5 19:58:55 2020(r366464)
@@ -186,6 +186,8 @@ static const struct rl_type re_devs[] = {
"RealTek 810xE PCIe 10/100baseTX" },
{ RT_VENDORID, RT_DEVICEID_8168, 0,
"RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet" },
+   { RT_VENDORID, RT_DEVICEID_8161, 0,
+   "RealTek 8168 Gigabit Ethernet" },
{ NCUBE_VENDORID, RT_DEVICEID_8168, 0,
"TP-Link TG-3468 v2 (RTL8168) Gigabit Ethernet" },
{ RT_VENDORID, RT_DEVICEID_8169, 0,

Modified: head/sys/dev/rl/if_rlreg.h
==
--- head/sys/dev/rl/if_rlreg.h  Mon Oct  5 19:45:11 2020(r366463)
+++ head/sys/dev/rl/if_rlreg.h  Mon Oct  5 19:58:55 2020(r366464)
@@ -999,6 +999,7 @@ struct rl_softc {
 #defineRT_DEVICEID_81380x8138
 #defineRT_DEVICEID_81390x8139
 #defineRT_DEVICEID_8169SC  0x8167
+#defineRT_DEVICEID_81610x8161
 #defineRT_DEVICEID_81680x8168
 #defineRT_DEVICEID_81690x8169
 #defineRT_DEVICEID_81000x8100
___
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: r366463 - stable/12/sys/dev/cxgbe

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 19:45:11 2020
New Revision: 366463
URL: https://svnweb.freebsd.org/changeset/base/366463

Log:
  MFC r366354:
  
  cxgbe(4): validate largest_rx_cluster and safest_rx_cluster.
  
  These tunables can only be set to a valid cluster size (2K, 4K, 9K, or
  16K) as documented in the man page.  Anything else could lead to a
  panic on interface up.
  
  Reported by:  mav@
  Sponsored by: Chelsio Communications

Modified:
  stable/12/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/t4_sge.c
==
--- stable/12/sys/dev/cxgbe/t4_sge.cMon Oct  5 19:38:51 2020
(r366462)
+++ stable/12/sys/dev/cxgbe/t4_sge.cMon Oct  5 19:45:11 2020
(r366463)
@@ -538,6 +538,28 @@ t4_sge_modload(void)
tscale = 1;
}
 
+   if (largest_rx_cluster != MCLBYTES &&
+#if MJUMPAGESIZE != MCLBYTES
+   largest_rx_cluster != MJUMPAGESIZE &&
+#endif
+   largest_rx_cluster != MJUM9BYTES &&
+   largest_rx_cluster != MJUM16BYTES) {
+   printf("Invalid hw.cxgbe.largest_rx_cluster value (%d),"
+   " using %d instead.\n", largest_rx_cluster, MJUM16BYTES);
+   largest_rx_cluster = MJUM16BYTES;
+   }
+
+   if (safest_rx_cluster != MCLBYTES &&
+#if MJUMPAGESIZE != MCLBYTES
+   safest_rx_cluster != MJUMPAGESIZE &&
+#endif
+   safest_rx_cluster != MJUM9BYTES &&
+   safest_rx_cluster != MJUM16BYTES) {
+   printf("Invalid hw.cxgbe.safest_rx_cluster value (%d),"
+   " using %d instead.\n", safest_rx_cluster, MJUMPAGESIZE);
+   safest_rx_cluster = MJUMPAGESIZE;
+   }
+
extfree_refs = counter_u64_alloc(M_WAITOK);
extfree_rels = counter_u64_alloc(M_WAITOK);
pullups = counter_u64_alloc(M_WAITOK);
___
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: r366462 - in head/sys: kern sys

2020-10-05 Thread Mateusz Guzik
Author: mjg
Date: Mon Oct  5 19:38:51 2020
New Revision: 366462
URL: https://svnweb.freebsd.org/changeset/base/366462

Log:
  cache: fix pwd use-after-free in setting up fallback
  
  Since the code exits smr section prior to calling pwd_hold, the used
  pwd can be freed and a new one allocated with the same address, making
  the comparison erroneously true.
  
  Note it is very unlikely anyone ran into it.

Modified:
  head/sys/kern/kern_descrip.c
  head/sys/kern/vfs_cache.c
  head/sys/sys/filedesc.h

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cMon Oct  5 19:26:54 2020
(r366461)
+++ head/sys/kern/kern_descrip.cMon Oct  5 19:38:51 2020
(r366462)
@@ -3344,6 +3344,17 @@ pwd_hold_filedesc(struct filedesc *fdp)
return (pwd);
 }
 
+bool
+pwd_hold_smr(struct pwd *pwd)
+{
+
+   MPASS(pwd != NULL);
+   if (__predict_true(refcount_acquire_if_not_zero(>pwd_refcount))) {
+   return (true);
+   }
+   return (false);
+}
+
 struct pwd *
 pwd_hold(struct thread *td)
 {
@@ -3354,8 +3365,7 @@ pwd_hold(struct thread *td)
 
vfs_smr_enter();
pwd = vfs_smr_entered_load(>fd_pwd);
-   MPASS(pwd != NULL);
-   if (__predict_true(refcount_acquire_if_not_zero(>pwd_refcount))) {
+   if (pwd_hold_smr(pwd)) {
vfs_smr_exit();
return (pwd);
}

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Mon Oct  5 19:26:54 2020(r366461)
+++ head/sys/kern/vfs_cache.c   Mon Oct  5 19:38:51 2020(r366462)
@@ -3484,25 +3484,24 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl)
 
ndp = fpl->ndp;
cnp = fpl->cnp;
+   pwd = fpl->pwd;
dvp = fpl->dvp;
dvp_seqc = fpl->dvp_seqc;
 
-   dvs = vget_prep_smr(dvp);
-   if (__predict_false(dvs == VGET_NONE)) {
+   if (!pwd_hold_smr(pwd)) {
cache_fpl_smr_exit(fpl);
return (cache_fpl_aborted(fpl));
}
 
+   dvs = vget_prep_smr(dvp);
cache_fpl_smr_exit(fpl);
-
-   vget_finish_ref(dvp, dvs);
-   if (!vn_seqc_consistent(dvp, dvp_seqc)) {
-   vrele(dvp);
+   if (__predict_false(dvs == VGET_NONE)) {
+   pwd_drop(pwd);
return (cache_fpl_aborted(fpl));
}
 
-   pwd = pwd_hold(curthread);
-   if (fpl->pwd != pwd) {
+   vget_finish_ref(dvp, dvs);
+   if (!vn_seqc_consistent(dvp, dvp_seqc)) {
vrele(dvp);
pwd_drop(pwd);
return (cache_fpl_aborted(fpl));

Modified: head/sys/sys/filedesc.h
==
--- head/sys/sys/filedesc.h Mon Oct  5 19:26:54 2020(r366461)
+++ head/sys/sys/filedesc.h Mon Oct  5 19:38:51 2020(r366462)
@@ -302,6 +302,7 @@ voidpwd_ensure_dirs(void);
 void   pwd_set_rootvnode(void);
 
 struct pwd *pwd_hold_filedesc(struct filedesc *fdp);
+bool   pwd_hold_smr(struct pwd *pwd);
 struct pwd *pwd_hold(struct thread *td);
 void   pwd_drop(struct pwd *pwd);
 static inline void
___
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: r366429 - in head/sys: kern sys

2020-10-05 Thread Mateusz Guzik
On 10/5/20, Konstantin Belousov  wrote:
> On Sun, Oct 04, 2020 at 09:06:02PM +, Rick Macklem wrote:
>> Mateusz Guzik wrote:
>> >Why is the process lock always taken? It looks like both routines just
>> >check a thread-local flag, so perhaps this can get away without
>> >serializing this process-wide?
>> I did spot this slight difference between the initial version of
>> sig_intr() and
>> this one.  At least w.r.t. copy_file_range(2), the call happens
>> infrequently
>> enough that the overhead of acquiring the lock is not significant.
>>
> Yes, the function should not be on any frequent path.
>
> That said, all signal delivery to process is covered by the process lock,
> so checks under process lock make the advisory answer provide less false
> negatives.  If considered too importand in some cases (when ?), the
> following
> patch can be applied.
>
> diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
> index 8108d4cb3a5..ed4dd52b66d 100644
> --- a/sys/kern/kern_sig.c
> +++ b/sys/kern/kern_sig.c
> @@ -3212,6 +3212,9 @@ sig_intr(void)
>   int ret;
>
>   td = curthread;
> + if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) == 0)
> + return (0);
> +
>   p = td->td_proc;
>
>   PROC_LOCK(p);
>

I presume copy_file_range will not be the only consumer going forward.

The default for all new code should be to avoid locks or other atomics
if it can be helped, otherwise it's just never ending whack-a-mole and
this is bound to become a bottleneck at some point.

So happens process lock is already quite contended (e.g., when running
poudriere) and adding to it is the wrong way to go.

-- 
Mateusz Guzik 
___
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: r366461 - head/sbin/devfs

2020-10-05 Thread Kristof Provost
Author: kp
Date: Mon Oct  5 19:26:54 2020
New Revision: 366461
URL: https://svnweb.freebsd.org/changeset/base/366461

Log:
  devfs.rules: unhide pf in vnet jails
  
  /dev/pf is usable in vnet jails, so don't hide the node there.
  
  We shouldn't expose /dev/pf in regular jails, as that gives them control over
  the host (or parent vnet jail) firewall.
  
  Reviewed by:  bz
  Differential Revision:https://reviews.freebsd.org/D26537

Modified:
  head/sbin/devfs/devfs.rules

Modified: head/sbin/devfs/devfs.rules
==
--- head/sbin/devfs/devfs.rules Mon Oct  5 19:22:28 2020(r366460)
+++ head/sbin/devfs/devfs.rules Mon Oct  5 19:26:54 2020(r366461)
@@ -86,3 +86,7 @@ add include $devfsrules_unhide_basic
 add include $devfsrules_unhide_login
 add path fuse unhide
 add path zfs unhide
+
+[devfsrules_jail_vnet=5]
+add include $devfsrules_jail
+add path pf unhide
___
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: r366460 - stable/12/sys/dev/cxgbe

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 19:22:28 2020
New Revision: 366460
URL: https://svnweb.freebsd.org/changeset/base/366460

Log:
  MFC r366247:
  
  cxgbe(4): Avoid unnecessary work in the firmware during netmap tx.
  
  Bind the netmap tx queues to a special '0xff' scheduling class which
  makes the firmware skip some processing related to rate limiting on the
  outgoing traffic.  Future firmwares will do this automatically.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/12/sys/dev/cxgbe/t4_netmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/t4_netmap.c
==
--- stable/12/sys/dev/cxgbe/t4_netmap.c Mon Oct  5 18:59:10 2020
(r366459)
+++ stable/12/sys/dev/cxgbe/t4_netmap.c Mon Oct  5 19:22:28 2020
(r366460)
@@ -329,6 +329,22 @@ alloc_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq
nm_txq->udb = (volatile void *)udb;
}
 
+   if (sc->params.fw_vers < FW_VERSION32(1, 25, 1, 0)) {
+   uint32_t param, val;
+
+   param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) |
+   V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH) 
|
+   V_FW_PARAMS_PARAM_YZ(nm_txq->cntxt_id);
+   val = 0xff;
+   rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, , );
+   if (rc != 0) {
+   device_printf(vi->dev,
+   "failed to bind netmap txq %d to class 0xff: %d\n",
+   nm_txq->cntxt_id, rc);
+   rc = 0;
+   }
+   }
+
return (rc);
 }
 
___
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: r366459 - stable/12/sys/dev/cxgbe

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 18:59:10 2020
New Revision: 366459
URL: https://svnweb.freebsd.org/changeset/base/366459

Log:
  MFC r366246:
  
  Remove duplicate line.

Modified:
  stable/12/sys/dev/cxgbe/t4_netmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/t4_netmap.c
==
--- stable/12/sys/dev/cxgbe/t4_netmap.c Mon Oct  5 18:49:55 2020
(r366458)
+++ stable/12/sys/dev/cxgbe/t4_netmap.c Mon Oct  5 18:59:10 2020
(r366459)
@@ -216,9 +216,6 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq
param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) |
V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_CONM_CTXT) |
V_FW_PARAMS_PARAM_YZ(nm_rxq->iq_cntxt_id);
-   param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) |
-   V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_CONM_CTXT) |
-   V_FW_PARAMS_PARAM_YZ(nm_rxq->iq_cntxt_id);
if (cong == 0)
val = 1 << 19;
else {
___
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: r366431 - head/sys/dev/usb/serial

2020-10-05 Thread Warner Losh
On Mon, Oct 5, 2020 at 5:46 AM Ronald Klop  wrote:

> Hi,
>
> I was interested by this commit. But the commit and commit message don't
> have much information. I was surprised that the "Differential Revision"
> link contains a lot of info about this. How permanent is this
> review.freebsd.org server? Wil it stay after the git migration?
>

Yes. It's anticipated that we'll keep it around forever.

Warner


> Ronald.
>
>
> *Van:* Hans Petter Selasky 
> *Datum:* zondag, 4 oktober 2020 19:17
> *Aan:* src-committ...@freebsd.org, svn-src-all@freebsd.org,
> svn-src-h...@freebsd.org
> *Onderwerp:* svn commit: r366431 - head/sys/dev/usb/serial
>
> Author: hselasky
> Date: Sun Oct  4 17:17:16 2020
> New Revision: 366431
> URL: https://svnweb.freebsd.org/changeset/base/366431
>
> Log:
>   Add support for Google Cr50 (GSC) Closed Case Debugging UART interfaces
> to
>   the USB generic serial port driver, ugensa.
>
>   MFC after:1 week
>   Differential Revision:https://reviews.freebsd.org/D21863
>   Submitted by: greg_unrelenting.technology (Greg V)
>   Sponsored by: Mellanox Technologies // NVIDIA Networking
>
> Modified:
>   head/sys/dev/usb/serial/ugensa.c
>
> Modified: head/sys/dev/usb/serial/ugensa.c
>
> ==
> --- head/sys/dev/usb/serial/ugensa.cSun Oct  4 17:07:13 2020
>(r366430)
> +++ head/sys/dev/usb/serial/ugensa.cSun Oct  4 17:17:16 2020
>(r366431)
> @@ -161,6 +161,8 @@ static const STRUCT_USB_HOST_ID ugensa_devs[] = {
> {USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 1)},
> {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_49GPLUS, 1)},
> {USB_VPI(USB_VENDOR_NOVATEL2, USB_PRODUCT_NOVATEL2_FLEXPACKGPS, 3)},
> +   {USB_VENDOR(USB_VENDOR_GOOGLE), USB_IFACE_CLASS(UICLASS_VENDOR),
> +   USB_IFACE_SUBCLASS(0x50), USB_IFACE_PROTOCOL(0x01),
> USB_DRIVER_INFO(10)},
>  };
>
>  DRIVER_MODULE(ugensa, uhub, ugensa_driver, ugensa_devclass, NULL, 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"
> --
>
>
___
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: r366458 - stable/12/sys/dev/cxgbe

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 18:49:55 2020
New Revision: 366458
URL: https://svnweb.freebsd.org/changeset/base/366458

Log:
  MFC r366245:
  
  cxgbe(4): adjust the doorbell threshold for netmap freelists to match the
  maximum burst size used when fetching descriptors from the list.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/12/sys/dev/cxgbe/adapter.h
  stable/12/sys/dev/cxgbe/t4_netmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/adapter.h
==
--- stable/12/sys/dev/cxgbe/adapter.h   Mon Oct  5 18:47:12 2020
(r366457)
+++ stable/12/sys/dev/cxgbe/adapter.h   Mon Oct  5 18:49:55 2020
(r366458)
@@ -716,6 +716,7 @@ struct sge_nm_rxq {
uint32_t fl_sidx2;  /* copy of fl_sidx */
uint32_t fl_db_val;
u_int fl_db_saved;
+   u_int fl_db_threshold;  /* in descriptors */
u_int fl_hwidx:4;
 
/*

Modified: stable/12/sys/dev/cxgbe/t4_netmap.c
==
--- stable/12/sys/dev/cxgbe/t4_netmap.c Mon Oct  5 18:47:12 2020
(r366457)
+++ stable/12/sys/dev/cxgbe/t4_netmap.c Mon Oct  5 18:49:55 2020
(r366458)
@@ -196,6 +196,9 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq
 
nm_rxq->fl_cntxt_id = be16toh(c.fl0id);
nm_rxq->fl_pidx = nm_rxq->fl_cidx = 0;
+   nm_rxq->fl_db_saved = 0;
+   /* matches the X_FETCHBURSTMAX_512B or X_FETCHBURSTMAX_256B above. */
+   nm_rxq->fl_db_threshold = chip_id(sc) <= CHELSIO_T5 ? 8 : 4;
MPASS(nm_rxq->fl_sidx == na->num_rx_desc);
cntxt_id = nm_rxq->fl_cntxt_id - sc->sge.eq_start;
if (cntxt_id >= sc->sge.neq) {
@@ -1063,7 +1066,7 @@ cxgbe_netmap_rxsync(struct netmap_kring *kring, int fl
fl_pidx = 0;
slot = >slot[0];
}
-   if (++dbinc == 8 && n >= 32) {
+   if (++dbinc == nm_rxq->fl_db_threshold) {
wmb();
if (starve_fl)
nm_rxq->fl_db_saved += dbinc;
___
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: r366457 - stable/12/sys/dev/cxgbe

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 18:47:12 2020
New Revision: 366457
URL: https://svnweb.freebsd.org/changeset/base/366457

Log:
  MFC r366244:
  
  cxgbe(4): display an error message when netmap cannot be enabled because
  the interface is down.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/12/sys/dev/cxgbe/t4_netmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/t4_netmap.c
==
--- stable/12/sys/dev/cxgbe/t4_netmap.c Mon Oct  5 18:46:14 2020
(r366456)
+++ stable/12/sys/dev/cxgbe/t4_netmap.c Mon Oct  5 18:47:12 2020
(r366457)
@@ -536,8 +536,11 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi
MPASS(vi->nnmtxq > 0);
 
if ((vi->flags & VI_INIT_DONE) == 0 ||
-   (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+   (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
+   if_printf(ifp, "cannot enable netmap operation because "
+   "interface is not UP.\n");
return (EAGAIN);
+   }
 
rxb = >sge.rx_buf_info[0];
for (i = 0; i < SW_ZONE_SIZES; i++, rxb++) {
___
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: r366456 - head/sys/arm64/arm64

2020-10-05 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Oct  5 18:46:14 2020
New Revision: 366456
URL: https://svnweb.freebsd.org/changeset/base/366456

Log:
  Tweak arm64's cpu_fetch_syscall_args().  This should make it possible
  for the compiler to inline the memcpy().
  
  Reviewed by:  andrew
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26629

Modified:
  head/sys/arm64/arm64/trap.c

Modified: head/sys/arm64/arm64/trap.c
==
--- head/sys/arm64/arm64/trap.c Mon Oct  5 18:45:32 2020(r366455)
+++ head/sys/arm64/arm64/trap.c Mon Oct  5 18:46:14 2020(r366456)
@@ -123,30 +123,31 @@ int
 cpu_fetch_syscall_args(struct thread *td)
 {
struct proc *p;
-   register_t *ap;
+   register_t *ap, *dst_ap;
struct syscall_args *sa;
-   int nap;
 
-   nap = MAXARGS;
p = td->td_proc;
-   ap = td->td_frame->tf_x;
sa = >td_sa;
+   ap = td->td_frame->tf_x;
+   dst_ap = >args[0];
 
sa->code = td->td_frame->tf_x[8];
 
-   if (sa->code == SYS_syscall || sa->code == SYS___syscall) {
+   if (__predict_false(sa->code == SYS_syscall || sa->code == 
SYS___syscall)) {
sa->code = *ap++;
-   nap--;
+   } else {
+   *dst_ap++ = *ap++;
}
 
-   if (sa->code >= p->p_sysent->sv_size)
+   if (__predict_false(sa->code >= p->p_sysent->sv_size))
sa->callp = >p_sysent->sv_table[0];
else
sa->callp = >p_sysent->sv_table[sa->code];
 
-   memcpy(sa->args, ap, nap * sizeof(register_t));
-   if (sa->callp->sy_narg > nap)
-   panic("ARM64TODO: Could we have more than %d args?", MAXARGS);
+   KASSERT(sa->callp->sy_narg <= nitems(sa->args),
+   ("Syscall %d takes too many arguments", sa->code));
+
+   memcpy(dst_ap, ap, (MAXARGS - 1) * sizeof(register_t));
 
td->td_retval[0] = 0;
td->td_retval[1] = 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"


svn commit: r366455 - stable/12/sys/dev/cxgbe

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 18:45:32 2020
New Revision: 366455
URL: https://svnweb.freebsd.org/changeset/base/366455

Log:
  MFC r366242:
  
  cxgbe(4): fixes for netmap operation with only some queues active.
  
  - Only active netmap receive queues should be in the RSS lookup table.
  
  - The RSS table should be restored for NIC operation when the last
active netmap queue is switched off, not the first one.
  
  - Support repeated netmap ON/OFF on a subset of the queues.  This works
whether the the queues being enabled and disabled are the only ones
active or not.  Some kring indexes have to be reset in the driver for
the second case.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/12/sys/dev/cxgbe/t4_netmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/t4_netmap.c
==
--- stable/12/sys/dev/cxgbe/t4_netmap.c Mon Oct  5 18:41:35 2020
(r366454)
+++ stable/12/sys/dev/cxgbe/t4_netmap.c Mon Oct  5 18:45:32 2020
(r366455)
@@ -347,6 +347,180 @@ free_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq 
 }
 
 static int
+cxgbe_netmap_simple_rss(struct adapter *sc, struct vi_info *vi,
+struct ifnet *ifp, struct netmap_adapter *na)
+{
+   struct netmap_kring *kring;
+   struct sge_nm_rxq *nm_rxq;
+   int rc, i, j, nm_state, defq;
+   uint16_t *rss;
+
+   /*
+* Check if there's at least one active (or about to go active) netmap
+* rx queue.
+*/
+   defq = -1;
+   for_each_nm_rxq(vi, j, nm_rxq) {
+   nm_state = atomic_load_int(_rxq->nm_state);
+   kring = na->rx_rings[nm_rxq->nid];
+   if ((nm_state != NM_OFF && !nm_kring_pending_off(kring)) ||
+   (nm_state == NM_OFF && nm_kring_pending_on(kring))) {
+   MPASS(nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID);
+   if (defq == -1) {
+   defq = nm_rxq->iq_abs_id;
+   break;
+   }
+   }
+   }
+
+   if (defq == -1) {
+   /* No active netmap queues.  Switch back to NIC queues. */
+   rss = vi->rss;
+   defq = vi->rss[0];
+   } else {
+   for (i = 0; i < vi->rss_size;) {
+   for_each_nm_rxq(vi, j, nm_rxq) {
+   nm_state = atomic_load_int(_rxq->nm_state);
+   kring = na->rx_rings[nm_rxq->nid];
+   if ((nm_state != NM_OFF &&
+   !nm_kring_pending_off(kring)) ||
+   (nm_state == NM_OFF &&
+   nm_kring_pending_on(kring))) {
+   MPASS(nm_rxq->iq_cntxt_id !=
+   INVALID_NM_RXQ_CNTXT_ID);
+   vi->nm_rss[i++] = nm_rxq->iq_abs_id;
+   if (i == vi->rss_size)
+   break;
+   }
+   }
+   }
+   rss = vi->nm_rss;
+   }
+
+   rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, rss,
+   vi->rss_size);
+   if (rc != 0)
+   if_printf(ifp, "netmap rss_config failed: %d\n", rc);
+
+   rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, defq, 0, 0);
+   if (rc != 0) {
+   if_printf(ifp, "netmap defaultq config failed: %d\n", rc);
+   }
+
+   return (rc);
+}
+
+/*
+ * Odd number of rx queues work best for split RSS mode as the first queue can
+ * be dedicated for non-RSS traffic and the rest divided into two equal halves.
+ */
+static int
+cxgbe_netmap_split_rss(struct adapter *sc, struct vi_info *vi,
+struct ifnet *ifp, struct netmap_adapter *na)
+{
+   struct netmap_kring *kring;
+   struct sge_nm_rxq *nm_rxq;
+   int rc, i, j, nm_state, defq;
+   int nactive[2] = {0, 0};
+   int dq[2] = {-1, -1};
+   bool dq_norss;  /* default queue should not be in RSS table. */
+
+   MPASS(nm_split_rss != 0);
+   MPASS(vi->nnmrxq > 1);
+
+   for_each_nm_rxq(vi, i, nm_rxq) {
+   j = i / ((vi->nnmrxq + 1) / 2);
+   nm_state = atomic_load_int(_rxq->nm_state);
+   kring = na->rx_rings[nm_rxq->nid];
+   if ((nm_state != NM_OFF && !nm_kring_pending_off(kring)) ||
+   (nm_state == NM_OFF && nm_kring_pending_on(kring))) {
+   MPASS(nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID);
+   nactive[j]++;
+   if (dq[j] == -1) {
+   dq[j] = nm_rxq->iq_abs_id;
+   break;
+   }
+   }
+ 

svn commit: r366454 - head/sys/riscv/riscv

2020-10-05 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Oct  5 18:41:35 2020
New Revision: 366454
URL: https://svnweb.freebsd.org/changeset/base/366454

Log:
  Drop useless assignment, and add a KASSERT to make sure it really was useless.
  
  Reviewed by:  nick, jhb
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26649

Modified:
  head/sys/riscv/riscv/trap.c

Modified: head/sys/riscv/riscv/trap.c
==
--- head/sys/riscv/riscv/trap.c Mon Oct  5 18:17:50 2020(r366453)
+++ head/sys/riscv/riscv/trap.c Mon Oct  5 18:41:35 2020(r366454)
@@ -163,7 +163,9 @@ svc_handler(struct trapframe *frame)
struct thread *td;
 
td = curthread;
-   td->td_frame = frame;
+
+   KASSERT(td->td_frame == frame,
+   ("%s: td_frame %p != frame %p", __func__, td->td_frame, frame));
 
syscallenter(td);
syscallret(td);
___
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: r366453 - head/sys/ufs/ufs

2020-10-05 Thread Chuck Silvers
Author: chs
Date: Mon Oct  5 18:17:50 2020
New Revision: 366453
URL: https://svnweb.freebsd.org/changeset/base/366453

Log:
  ufs: restore uniqueness of st_dev as returned by ufs_stat()
  
  switch ufs_stat() to use the same value for st_dev as was used by
  the previous ufs_getattr() stat path.
  
  Submitted by: gallatin
  Reviewed by:  mjg, imp, kib, mckusick
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D26596

Modified:
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cMon Oct  5 18:08:52 2020
(r366452)
+++ head/sys/ufs/ufs/ufs_vnops.cMon Oct  5 18:17:50 2020
(r366453)
@@ -498,7 +498,7 @@ ufs_stat(struct vop_stat_args *ap)
}
VI_UNLOCK(vp);
 
-   sb->st_dev = vp->v_mount->mnt_stat.f_fsid.val[0];
+   sb->st_dev = dev2udev(ITOUMP(ip)->um_dev);
sb->st_ino = ip->i_number;
sb->st_mode = (ip->i_mode & ~IFMT) | VTTOIF(vp->v_type);
sb->st_nlink = ip->i_effnlink;
___
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: r366452 - in stable: 11/contrib/llvm-project/clang/lib/Basic/Targets 11/contrib/llvm-project/llvm/lib/Target/X86 12/contrib/llvm-project/clang/lib/Basic/Targets 12/contrib/llvm-project/...

2020-10-05 Thread Dimitry Andric
Author: dim
Date: Mon Oct  5 18:08:52 2020
New Revision: 366452
URL: https://svnweb.freebsd.org/changeset/base/366452

Log:
  Merge commit 0fac1c191 from llvm git (by Craig Topper):
  
[X86] Allow Yz inline assembly constraint to choose ymm0 or zmm0 when
avx/avx512 are enabled and type is 256 or 512 bits
  
gcc supports selecting ymm0/zmm0 for the Yz constraint when used with
256 or 512 bit vector types.
  
Fixes PR45806
  
Differential Revision: https://reviews.llvm.org/D79448
  
  This should fix 'fatal error: error in backend: Cannot select' errors if
  assertions are disabled, or 'Assertion failed: (isVector() && "Invalid
  vector type!"), function getVectorNumElements, file
  /usr/src/contrib/llvm-project/llvm/include/llvm/CodeGen/ValueTypes.h,
  line 276.', when building the audio/lsp-plugins-lv2 port.
  
  Direct commit to stable/{11,12} since head has clang 11.0.0, which
  already includes this fix.
  
  Reported by:  yuri
  PR:   232911

Modified:
  stable/11/contrib/llvm-project/clang/lib/Basic/Targets/X86.cpp
  stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp

Changes in other areas also in this revision:
Modified:
  stable/12/contrib/llvm-project/clang/lib/Basic/Targets/X86.cpp
  stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp

Modified: stable/11/contrib/llvm-project/clang/lib/Basic/Targets/X86.cpp
==
--- stable/11/contrib/llvm-project/clang/lib/Basic/Targets/X86.cpp  Mon Oct 
 5 16:39:38 2020(r366451)
+++ stable/11/contrib/llvm-project/clang/lib/Basic/Targets/X86.cpp  Mon Oct 
 5 18:08:52 2020(r366452)
@@ -1772,8 +1772,14 @@ bool X86TargetInfo::validateOperandSize(const llvm::St
   return Size <= 64;
 case 'z':
 case '0':
-  // XMM0
-  if (FeatureMap.lookup("sse"))
+  // XMM0/YMM/ZMM0
+  if (FeatureMap.lookup("avx512f"))
+// ZMM0 can be used if target supports AVX512F.
+return Size <= 512U;
+  else if (FeatureMap.lookup("avx"))
+// YMM0 can be used if target supports AVX.
+return Size <= 256U;
+  else if (FeatureMap.lookup("sse"))
 return Size <= 128U;
   return false;
 case 'i':

Modified: stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp
==
--- stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp  
Mon Oct  5 16:39:38 2020(r366451)
+++ stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp  
Mon Oct  5 18:08:52 2020(r366452)
@@ -46555,7 +46555,9 @@ TargetLowering::ConstraintWeight
   // XMM0
   case 'z':
   case '0':
-if ((type->getPrimitiveSizeInBits() == 128) && Subtarget.hasSSE1())
+if (((type->getPrimitiveSizeInBits() == 128) && Subtarget.hasSSE1()) ||
+((type->getPrimitiveSizeInBits() == 256) && Subtarget.hasAVX()) ||
+((type->getPrimitiveSizeInBits() == 512) && Subtarget.hasAVX512()))
   return CW_SpecificReg;
 return CW_Invalid;
   // Conditional OpMask regs (AVX512)
@@ -47005,6 +47007,8 @@ X86TargetLowering::getRegForInlineAsmConstraint(const 
 if (Subtarget.hasAVX())
   return std::make_pair(0U, ::VR256RegClass);
 break;
+  case MVT::v64i8:
+  case MVT::v32i16:
   case MVT::v8f64:
   case MVT::v16f32:
   case MVT::v16i32:
@@ -47030,7 +47034,42 @@ X86TargetLowering::getRegForInlineAsmConstraint(const 
 case 'z':
 case '0':
   if (!Subtarget.hasSSE1()) break;
-  return std::make_pair(X86::XMM0, ::VR128RegClass);
+  switch (VT.SimpleTy) {
+  default: break;
+  // Scalar SSE types.
+  case MVT::f32:
+  case MVT::i32:
+return std::make_pair(X86::XMM0, ::FR32RegClass);
+  case MVT::f64:
+  case MVT::i64:
+return std::make_pair(X86::XMM0, ::FR64RegClass);
+  case MVT::f128:
+  case MVT::v16i8:
+  case MVT::v8i16:
+  case MVT::v4i32:
+  case MVT::v2i64:
+  case MVT::v4f32:
+  case MVT::v2f64:
+return std::make_pair(X86::XMM0, ::VR128RegClass);
+  // AVX types.
+  case MVT::v32i8:
+  case MVT::v16i16:
+  case MVT::v8i32:
+  case MVT::v4i64:
+  case MVT::v8f32:
+  case MVT::v4f64:
+if (Subtarget.hasAVX())
+  return std::make_pair(X86::YMM0, ::VR256RegClass);
+break;
+  case MVT::v8f64:
+  case MVT::v16f32:
+  case MVT::v16i32:
+  case MVT::v8i64:
+if (Subtarget.hasAVX512())
+  return std::make_pair(X86::ZMM0, ::VR512_0_15RegClass);
+break;
+  }
+  break;
 case 'k':
   // This register class doesn't allocate k0 for masked vector operation.
   if (Subtarget.hasAVX512()) {
___
svn-src-all@freebsd.org mailing list

svn commit: r366452 - in stable: 11/contrib/llvm-project/clang/lib/Basic/Targets 11/contrib/llvm-project/llvm/lib/Target/X86 12/contrib/llvm-project/clang/lib/Basic/Targets 12/contrib/llvm-project/...

2020-10-05 Thread Dimitry Andric
Author: dim
Date: Mon Oct  5 18:08:52 2020
New Revision: 366452
URL: https://svnweb.freebsd.org/changeset/base/366452

Log:
  Merge commit 0fac1c191 from llvm git (by Craig Topper):
  
[X86] Allow Yz inline assembly constraint to choose ymm0 or zmm0 when
avx/avx512 are enabled and type is 256 or 512 bits
  
gcc supports selecting ymm0/zmm0 for the Yz constraint when used with
256 or 512 bit vector types.
  
Fixes PR45806
  
Differential Revision: https://reviews.llvm.org/D79448
  
  This should fix 'fatal error: error in backend: Cannot select' errors if
  assertions are disabled, or 'Assertion failed: (isVector() && "Invalid
  vector type!"), function getVectorNumElements, file
  /usr/src/contrib/llvm-project/llvm/include/llvm/CodeGen/ValueTypes.h,
  line 276.', when building the audio/lsp-plugins-lv2 port.
  
  Direct commit to stable/{11,12} since head has clang 11.0.0, which
  already includes this fix.
  
  Reported by:  yuri
  PR:   232911

Modified:
  stable/12/contrib/llvm-project/clang/lib/Basic/Targets/X86.cpp
  stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp

Changes in other areas also in this revision:
Modified:
  stable/11/contrib/llvm-project/clang/lib/Basic/Targets/X86.cpp
  stable/11/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp

Modified: stable/12/contrib/llvm-project/clang/lib/Basic/Targets/X86.cpp
==
--- stable/12/contrib/llvm-project/clang/lib/Basic/Targets/X86.cpp  Mon Oct 
 5 16:39:38 2020(r366451)
+++ stable/12/contrib/llvm-project/clang/lib/Basic/Targets/X86.cpp  Mon Oct 
 5 18:08:52 2020(r366452)
@@ -1772,8 +1772,14 @@ bool X86TargetInfo::validateOperandSize(const llvm::St
   return Size <= 64;
 case 'z':
 case '0':
-  // XMM0
-  if (FeatureMap.lookup("sse"))
+  // XMM0/YMM/ZMM0
+  if (FeatureMap.lookup("avx512f"))
+// ZMM0 can be used if target supports AVX512F.
+return Size <= 512U;
+  else if (FeatureMap.lookup("avx"))
+// YMM0 can be used if target supports AVX.
+return Size <= 256U;
+  else if (FeatureMap.lookup("sse"))
 return Size <= 128U;
   return false;
 case 'i':

Modified: stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp
==
--- stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp  
Mon Oct  5 16:39:38 2020(r366451)
+++ stable/12/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp  
Mon Oct  5 18:08:52 2020(r366452)
@@ -46555,7 +46555,9 @@ TargetLowering::ConstraintWeight
   // XMM0
   case 'z':
   case '0':
-if ((type->getPrimitiveSizeInBits() == 128) && Subtarget.hasSSE1())
+if (((type->getPrimitiveSizeInBits() == 128) && Subtarget.hasSSE1()) ||
+((type->getPrimitiveSizeInBits() == 256) && Subtarget.hasAVX()) ||
+((type->getPrimitiveSizeInBits() == 512) && Subtarget.hasAVX512()))
   return CW_SpecificReg;
 return CW_Invalid;
   // Conditional OpMask regs (AVX512)
@@ -47005,6 +47007,8 @@ X86TargetLowering::getRegForInlineAsmConstraint(const 
 if (Subtarget.hasAVX())
   return std::make_pair(0U, ::VR256RegClass);
 break;
+  case MVT::v64i8:
+  case MVT::v32i16:
   case MVT::v8f64:
   case MVT::v16f32:
   case MVT::v16i32:
@@ -47030,7 +47034,42 @@ X86TargetLowering::getRegForInlineAsmConstraint(const 
 case 'z':
 case '0':
   if (!Subtarget.hasSSE1()) break;
-  return std::make_pair(X86::XMM0, ::VR128RegClass);
+  switch (VT.SimpleTy) {
+  default: break;
+  // Scalar SSE types.
+  case MVT::f32:
+  case MVT::i32:
+return std::make_pair(X86::XMM0, ::FR32RegClass);
+  case MVT::f64:
+  case MVT::i64:
+return std::make_pair(X86::XMM0, ::FR64RegClass);
+  case MVT::f128:
+  case MVT::v16i8:
+  case MVT::v8i16:
+  case MVT::v4i32:
+  case MVT::v2i64:
+  case MVT::v4f32:
+  case MVT::v2f64:
+return std::make_pair(X86::XMM0, ::VR128RegClass);
+  // AVX types.
+  case MVT::v32i8:
+  case MVT::v16i16:
+  case MVT::v8i32:
+  case MVT::v4i64:
+  case MVT::v8f32:
+  case MVT::v4f64:
+if (Subtarget.hasAVX())
+  return std::make_pair(X86::YMM0, ::VR256RegClass);
+break;
+  case MVT::v8f64:
+  case MVT::v16f32:
+  case MVT::v16i32:
+  case MVT::v8i64:
+if (Subtarget.hasAVX512())
+  return std::make_pair(X86::ZMM0, ::VR512_0_15RegClass);
+break;
+  }
+  break;
 case 'k':
   // This register class doesn't allocate k0 for masked vector operation.
   if (Subtarget.hasAVX512()) {
___
svn-src-all@freebsd.org mailing list

svn commit: r366451 - releng/12.2/sys/dev/cxgbe/tom

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 16:39:38 2020
New Revision: 366451
URL: https://svnweb.freebsd.org/changeset/base/366451

Log:
  MFS r366438:
  cxgbe(4): set up the firmware flowc for the tid before send_abort_rpl.
  
  Approved by:  re@ (gjb@)
  Sponsored by: Chelsio Communications

Modified:
  releng/12.2/sys/dev/cxgbe/tom/t4_listen.c
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/sys/dev/cxgbe/tom/t4_listen.c
==
--- releng/12.2/sys/dev/cxgbe/tom/t4_listen.c   Mon Oct  5 15:54:19 2020
(r366450)
+++ releng/12.2/sys/dev/cxgbe/tom/t4_listen.c   Mon Oct  5 16:39:38 2020
(r366451)
@@ -341,48 +341,32 @@ release_lctx(struct adapter *sc, struct listen_ctx *lc
 }
 
 static void
-send_reset_synqe(struct toedev *tod, struct synq_entry *synqe)
+send_flowc_wr_synqe(struct adapter *sc, struct synq_entry *synqe)
 {
-   struct adapter *sc = tod->tod_softc;
struct mbuf *m = synqe->syn;
struct ifnet *ifp = m->m_pkthdr.rcvif;
struct vi_info *vi = ifp->if_softc;
struct port_info *pi = vi->pi;
-   struct l2t_entry *e = >l2t->l2tab[synqe->params.l2t_idx];
struct wrqe *wr;
struct fw_flowc_wr *flowc;
-   struct cpl_abort_req *req;
-   int flowclen;
struct sge_wrq *ofld_txq;
struct sge_ofld_rxq *ofld_rxq;
const int nparams = 6;
+   const int flowclen = sizeof(*flowc) + nparams * sizeof(struct 
fw_flowc_mnemval);
const u_int pfvf = sc->pf << S_FW_VIID_PFN;
 
INP_WLOCK_ASSERT(synqe->lctx->inp);
+   MPASS((synqe->flags & TPF_FLOWC_WR_SENT) == 0);
 
-   CTR5(KTR_CXGBE, "%s: synqe %p (0x%x), tid %d%s",
-   __func__, synqe, synqe->flags, synqe->tid,
-   synqe->flags & TPF_ABORT_SHUTDOWN ?
-   " (abort already in progress)" : "");
-   if (synqe->flags & TPF_ABORT_SHUTDOWN)
-   return; /* abort already in progress */
-   synqe->flags |= TPF_ABORT_SHUTDOWN;
-
ofld_txq = >sge.ofld_txq[synqe->params.txq_idx];
ofld_rxq = >sge.ofld_rxq[synqe->params.rxq_idx];
 
-   /* The wrqe will have two WRs - a flowc followed by an abort_req */
-   flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval);
-
-   wr = alloc_wrqe(roundup2(flowclen, EQ_ESIZE) + sizeof(*req), ofld_txq);
+   wr = alloc_wrqe(roundup2(flowclen, 16), ofld_txq);
if (wr == NULL) {
/* XXX */
panic("%s: allocation failure.", __func__);
}
flowc = wrtod(wr);
-   req = (void *)((caddr_t)flowc + roundup2(flowclen, EQ_ESIZE));
-
-   /* First the flowc ... */
memset(flowc, 0, wr->wr_len);
flowc->op_to_nparams = htobe32(V_FW_WR_OP(FW_FLOWC_WR) |
V_FW_FLOWC_WR_NPARAMS(nparams));
@@ -396,19 +380,47 @@ send_reset_synqe(struct toedev *tod, struct synq_entry
flowc->mnemval[2].val = htobe32(pi->tx_chan);
flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID;
flowc->mnemval[3].val = htobe32(ofld_rxq->iq.abs_id);
-   flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF;
-   flowc->mnemval[4].val = htobe32(512);
-   flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_MSS;
-   flowc->mnemval[5].val = htobe32(512);
+   flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF;
+   flowc->mnemval[4].val = htobe32(512);
+   flowc->mnemval[5].mnemonic = FW_FLOWC_MNEM_MSS;
+   flowc->mnemval[5].val = htobe32(512);
+
synqe->flags |= TPF_FLOWC_WR_SENT;
+   t4_wrq_tx(sc, wr);
+}
 
-   /* ... then ABORT request */
+static void
+send_reset_synqe(struct toedev *tod, struct synq_entry *synqe)
+{
+   struct adapter *sc = tod->tod_softc;
+   struct wrqe *wr;
+   struct cpl_abort_req *req;
+
+   INP_WLOCK_ASSERT(synqe->lctx->inp);
+
+   CTR5(KTR_CXGBE, "%s: synqe %p (0x%x), tid %d%s",
+   __func__, synqe, synqe->flags, synqe->tid,
+   synqe->flags & TPF_ABORT_SHUTDOWN ?
+   " (abort already in progress)" : "");
+   if (synqe->flags & TPF_ABORT_SHUTDOWN)
+   return; /* abort already in progress */
+   synqe->flags |= TPF_ABORT_SHUTDOWN;
+
+   if (!(synqe->flags & TPF_FLOWC_WR_SENT))
+   send_flowc_wr_synqe(sc, synqe);
+
+   wr = alloc_wrqe(sizeof(*req), >sge.ofld_txq[synqe->params.txq_idx]);
+   if (wr == NULL) {
+   /* XXX */
+   panic("%s: allocation failure.", __func__);
+   }
+   req = wrtod(wr);
INIT_TP_WR_MIT_CPL(req, CPL_ABORT_REQ, synqe->tid);
req->rsvd0 = 0; /* don't have a snd_nxt */
req->rsvd1 = 1; /* no data sent yet */
req->cmd = CPL_ABORT_SEND_RST;
 
-   t4_l2t_send(sc, wr, e);
+   t4_l2t_send(sc, wr, >l2t->l2tab[synqe->params.l2t_idx]);
 }
 
 static int
@@ -888,6 +900,9 @@ do_abort_req_synqe(struct sge_iq *iq, const struct rss
INP_WLOCK(inp);
 
ofld_txq = 

svn commit: r366450 - head/sys/kern

2020-10-05 Thread Mark Johnston
Author: markj
Date: Mon Oct  5 15:54:19 2020
New Revision: 366450
URL: https://svnweb.freebsd.org/changeset/base/366450

Log:
  Remove sysctl_kern_consmute()
  
  It is a trivial wrapper for sysctl_handle_int() since r184521.  Also
  remove the NEEDGIANT flag, cn_mute is accessed locklessly.
  
  MFC after:1 week

Modified:
  head/sys/kern/kern_cons.c

Modified: head/sys/kern/kern_cons.c
==
--- head/sys/kern/kern_cons.c   Mon Oct  5 14:07:32 2020(r366449)
+++ head/sys/kern/kern_cons.c   Mon Oct  5 15:54:19 2020(r366450)
@@ -93,7 +93,11 @@ int  cons_avail_mask = 0;/* Bit mask. Each registered 
 * (i.e., if it is in graphics mode) will have
 * this bit cleared.
 */
+
 static int cn_mute;
+SYSCTL_INT(_kern, OID_AUTO, consmute, CTLFLAG_RW, _mute, 0,
+"State of the console muting");
+
 static char *consbuf;  /* buffer used by `consmsgbuf' */
 static struct callout conscallout; /* callout for outputting to constty */
 struct msgbuf consmsgbuf;  /* message buffer for console tty */
@@ -364,26 +368,6 @@ SYSCTL_PROC(_kern, OID_AUTO, console,
 CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, 0,
 sysctl_kern_console, "A",
 "Console device control");
-
-/*
- * User has changed the state of the console muting.
- * This may require us to open or close the device in question.
- */
-static int
-sysctl_kern_consmute(SYSCTL_HANDLER_ARGS)
-{
-   int error;
-
-   error = sysctl_handle_int(oidp, _mute, 0, req);
-   if (error != 0 || req->newptr == NULL)
-   return (error);
-   return (error);
-}
-
-SYSCTL_PROC(_kern, OID_AUTO, consmute,
-CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(cn_mute),
-sysctl_kern_consmute, "I",
-"State of the console muting");
 
 void
 cngrab()
___
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: r366449 - head/usr.bin/procstat

2020-10-05 Thread Fernando Apesteguía
Author: fernape (ports committer)
Date: Mon Oct  5 14:07:32 2020
New Revision: 366449
URL: https://svnweb.freebsd.org/changeset/base/366449

Log:
  procstat(1): Add EXAMPLES section
  
  * Add some examples showing binary, arguments and file info from living
processes.
  * Show information from core dumps including an attempt using an old core 
file.
  * While here, fix warning 'no blank before trailing delimiter' reported by 
igor.
  
  Approved by:  manpages (0mp@)
  Differential Revision:https://reviews.freebsd.org/D25467

Modified:
  head/usr.bin/procstat/procstat.1

Modified: head/usr.bin/procstat/procstat.1
==
--- head/usr.bin/procstat/procstat.1Mon Oct  5 13:52:31 2020
(r366448)
+++ head/usr.bin/procstat/procstat.1Mon Oct  5 14:07:32 2020
(r366449)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 14, 2020
+.Dd October 5, 2020
 .Dt PROCSTAT 1
 .Os
 .Sh NAME
@@ -710,6 +710,51 @@ auxiliary vector value
 .El
 .Sh EXIT STATUS
 .Ex -std
+.Sh EXAMPLES
+Show binary information about the current shell:
+.Bd -literal -offset indent
+$ procstat binary $$
+  PID COMMOSREL PATH
+46620 bash  1201000 /usr/local/bin/bash
+.Ed
+.Pp
+Same as above but showing information about open file descriptors:
+.Bd -literal -offset indent
+$ procstat files $$
+  PID COMMFD T V FLAGSREF  OFFSET PRO NAME
+46620 bash  text v r r---   -   - -   /usr/local/bin/bash
+46620 bash  ctty v c rw--   -   - -   /dev/pts/12
+46620 bash   cwd v d r---   -   - -   /tmp
+46620 bash  root v d r---   -   - -   /
+46620 bash 0 v c rw--   7  372071 -   /dev/pts/12
+46620 bash 1 v c rw--   7  372071 -   /dev/pts/12
+46620 bash 2 v c rw--   7  372071 -   /dev/pts/12
+46620 bash   255 v c rw--   7  372071 -   /dev/pts/12
+.Ed
+.Pp
+Show the arguments used to launch
+.Xr init 8 :
+.Bd -literal -offset indent
+$ procstat arguments 1
+  PID COMM ARGS
+1 init /sbin/init --
+.Ed
+.Pp
+Extract binary information from a core dump:
+.Bd -literal -offset indent
+$ procstat binary core.36642
+  PID COMMOSREL PATH
+36642 top   1201000 /usr/bin/top
+.Ed
+.Pp
+Trying to extract information from a core file generated in a different major
+.Fx
+version might show an error like this:
+.Bd -literal -offset indent
+$ procstat mplayer.core
+procstat: kinfo_proc structure size mismatch
+procstat: procstat_getprocs()
+.Ed
 .Sh SEE ALSO
 .Xr fstat 1 ,
 .Xr ps 1 ,
___
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"


r366448 differential review

2020-10-05 Thread Fernando Apesteguía
It should have been this:

https://reviews.freebsd.org/D26665

It seems my selection buffer is misbehaving. Sorry about that.
___
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: r366448 - head/bin/pkill

2020-10-05 Thread Fernando Apesteguía
Author: fernape (ports committer)
Date: Mon Oct  5 13:52:31 2020
New Revision: 366448
URL: https://svnweb.freebsd.org/changeset/base/366448

Log:
  pkill(1): Add EXAMPLES section to man page
  
  Add a dozen of examples to the EXAMPLES section for pgrep(1) and pkill(1).
  
  Flags covered: -f, -F, -n, -j, -l, -S, -x
  
  Approved by:  mandoc (bcr@)
  Differential Revision:pkill(1): Add EXAMPLES section to man page

Modified:
  head/bin/pkill/pkill.1

Modified: head/bin/pkill/pkill.1
==
--- head/bin/pkill/pkill.1  Mon Oct  5 13:49:45 2020(r366447)
+++ head/bin/pkill/pkill.1  Mon Oct  5 13:52:31 2020(r366448)
@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 3, 2018
+.Dd October 5, 2020
 .Dt PKILL 1
 .Os
 .Sh NAME
@@ -270,6 +270,111 @@ Invalid options were specified on the command line.
 .It 3
 An internal error occurred.
 .El
+.Sh EXAMPLES
+Show the pid of the process holding the
+.Pa /tmp/.X0-lock
+pid file:
+.Bd -literal -offset indent
+$ pgrep -F /tmp/.X0-lock
+1211
+.Ed
+.Pp
+Show the pid and the name of the process including kernel threads in the
+search:
+.Bd -literal -offset indent
+$ pgrep -lS vnlru
+37 vnlru
+.Ed
+.Pp
+Search for processes including kernel threads that match the extended regular
+expression pattern:
+.Bd -literal -offset indent
+$ pgrep -S 'crypto.*[2-3]'
+20
+19
+6
+5
+.Ed
+.Pp
+Show long output for firefox processes:
+.Bd -literal -offset indent
+$ pgrep -l firefox
+1312 firefox
+1309 firefox
+1288 firefox
+1280 firefox
+1279 firefox
+1278 firefox
+1277 firefox
+1264 firefox
+.Ed
+.Pp
+Same as above but just showing the pid of the most recent process:
+.Bd -literal -offset indent
+$ pgrep -n firefox
+1312
+.Ed
+.Pp
+Look for vim processes.
+Match against the full argument list:
+.Bd -literal -offset indent
+$ pgrep -f vim
+44968
+30790
+.Ed
+.Pp
+Same as above but matching against the
+.Ql list
+word and showing the full argument list:
+.Bd -literal -offset indent
+$ pgrep -f -l list
+30790 vim list.txt
+.Ed
+.Pp
+Send
+.Va SIGSTOP
+signal to processes that are an exact match:
+.Bd -literal -offset indent
+$ pkill -SIGSTOP -f -x "vim list.txt"
+.Ed
+.Pp
+Without
+.Fl f
+names over 19 characters will silently fail:
+.Bd -literal -offset indent
+$ vim this_is_a_very_long_file_name &
+[1] 36689
+$
+
+[1]+  Stopped vim this_is_a_very_long_file_name
+$ pgrep "vim this"
+$
+.Ed
+.Pp
+Same as above using the
+.Fl f
+flag:
+.Bd -literal -offset indent
+$ pgrep -f "vim this"
+36689
+.Ed
+.Pp
+Find the
+.Xr top 1
+command running in any jail:
+.Bd -literal -offset indent
+$ pgrep -j any top
+34498
+.Ed
+.Pp
+Show all processes running in jail ID 58:
+.Bd -literal -offset indent
+$ pgrep -l -j58 '.*'
+28397 pkg-static
+28396 pkg-static
+28255 sh
+28254 make
+.Ed
 .Sh COMPATIBILITY
 Historically the option
 .Dq Fl j Li 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"


svn commit: r366447 - head/bin/kenv

2020-10-05 Thread Fernando Apesteguía
Author: fernape (ports committer)
Date: Mon Oct  5 13:49:45 2020
New Revision: 366447
URL: https://svnweb.freebsd.org/changeset/base/366447

Log:
  kenv(1): Add EXAMPLES to man page
  
  Add EXAMPLES section covering all the options
  
  Approved by:  manpages (bcr@)
  Differential Revision:https://reviews.freebsd.org/D26664

Modified:
  head/bin/kenv/kenv.1

Modified: head/bin/kenv/kenv.1
==
--- head/bin/kenv/kenv.1Mon Oct  5 13:46:19 2020(r366446)
+++ head/bin/kenv/kenv.1Mon Oct  5 13:49:45 2020(r366447)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 11, 2012
+.Dd October 5, 2020
 .Dt KENV 1
 .Os
 .Sh NAME
@@ -102,6 +102,44 @@ Almost any printable character except
 .Sq =
 is acceptable as part of a name.
 Quotes are optional and necessary only if the value contains whitespace.
+.Sh EXAMPLES
+Show kernel probe hints variable names and filter for the uart
+device
+.Bd -literal -offset indent
+$ kenv -h -N | grep uart
+hint.uart.0.at
+hint.uart.0.flags
+hint.uart.0.irq
+hint.uart.0.port
+hint.uart.1.at
+hint.uart.1.irq
+hint.uart.1.port
+.Ed
+.Pp
+Show the value of a specific variable:
+.Bd -literal -offset indent
+$ kenv hint.uart.1.at
+isa
+.Ed
+.Pp
+Same as above but adding the name of the variable in the report:
+.Bd -literal -offset indent
+$ kenv -v hint.uart.1.at
+hint.uart.1.at="isa"
+.Ed
+.Pp
+Try to delete a variable and suppress warnings if any:
+.Bd -literal -offset indent
+$ kenv -q -u hint.uart.1.at
+.Ed
+.Pp
+Set the value of the
+.Ev verbose_loading
+variable
+.Bd -literal -offset indent
+$ kenv verbose_loading="YES"
+verbose_loading="YES"
+.Ed
 .Sh SEE ALSO
 .Xr kenv 2 ,
 .Xr config 5 ,
___
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: r366446 - head/bin/hostname

2020-10-05 Thread Fernando Apesteguía
Author: fernape (ports committer)
Date: Mon Oct  5 13:46:19 2020
New Revision: 366446
URL: https://svnweb.freebsd.org/changeset/base/366446

Log:
  hostname(1): Add EXAMPLES to man page
  
  Add a very simple set of examples
  
  Approved by:  manpages (bcr@)
  Differential Revision:https://reviews.freebsd.org/D26663

Modified:
  head/bin/hostname/hostname.1

Modified: head/bin/hostname/hostname.1
==
--- head/bin/hostname/hostname.1Mon Oct  5 13:39:37 2020
(r366445)
+++ head/bin/hostname/hostname.1Mon Oct  5 13:46:19 2020
(r366446)
@@ -29,7 +29,7 @@
 .\"@(#)hostname.1  8.2 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd November 10, 2016
+.Dd October 5, 2020
 .Dt HOSTNAME 1
 .Os
 .Sh NAME
@@ -66,6 +66,25 @@ name.
 .It Fl d
 Only print domain information.
 .El
+.Sh EXAMPLES
+Set the host name of the machine and check the result:
+.Bd -literal -offset indent
+$ hostname beastie.localdomain.org
+$ hostname
+beastie.localdomain.org
+.Ed
+.Pp
+Do not show domain information:
+.Bd -literal -offset indent
+$ hostname -s
+beastie
+.Ed
+.Pp
+Show only domain information:
+.Bd -literal -offset indent
+$ hostname -d
+localdomain.org
+.Ed
 .Sh SEE ALSO
 .Xr gethostname 3 ,
 .Xr rc.conf 5
___
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: r366445 - head/bin/df

2020-10-05 Thread Fernando Apesteguía
Author: fernape (ports committer)
Date: Mon Oct  5 13:39:37 2020
New Revision: 366445
URL: https://svnweb.freebsd.org/changeset/base/366445

Log:
  df(1): Add EXAMPLES section to man page
  
  * Add EXAMPLES section with four simple examples.
  * Simplify -H flag description. This makes easy to see the difference between
this flag and -h
  * While here, fix .Tn deprecated macro.
  
  Approved by:  manpages (bcr@)
  Differential Revision:https://reviews.freebsd.org/D26662

Modified:
  head/bin/df/df.1

Modified: head/bin/df/df.1
==
--- head/bin/df/df.1Mon Oct  5 13:35:34 2020(r366444)
+++ head/bin/df/df.1Mon Oct  5 13:39:37 2020(r366445)
@@ -29,7 +29,7 @@
 .\" @(#)df.1   8.3 (Berkeley) 5/8/95
 .\" $FreeBSD$
 .\"
-.Dd August 8, 2017
+.Dd October 5, 2020
 .Dt DF 1
 .Os
 .Sh NAME
@@ -98,12 +98,9 @@ Use unit suffixes: Byte, Kibibyte, Mebibyte, Gibibyte,
 Pebibyte (based on powers of 1024) in order to reduce the number of
 digits to four or fewer.
 .It Fl H , Fl Fl si
-.Dq Human-readable
-output.
-Use unit suffixes: Byte, Kilobyte, Megabyte,
-Gigabyte, Terabyte and Petabyte (based on powers of 1000) in order to
-reduce the number of
-digits to four or fewer.
+Same as
+.Fl h
+but based on powers of 1000.
 .It Fl i
 Include statistics on the number of free and used inodes.
 In conjunction with the
@@ -159,10 +156,7 @@ command:
 df -t nonfs,nullfs
 .Ed
 .Pp
-lists all file systems except those of type
-.Tn NFS
-and
-.Tn NULLFS .
+lists all file systems except those of type NFS and NULLFS.
 The
 .Xr lsvfs 1
 command can be used to find out the types of file systems
@@ -193,6 +187,52 @@ which allows units of bytes or numbers scaled with the
 The allowed range is 512 bytes to 1 GB.
 If the value is outside, it will be set to the appropriate limit.
 .El
+.Sh EXAMPLES
+Show human readable free disk space for all mount points including file system
+type:
+.Bd -literal -offset indent
+$ df -ahT
+Filesystem   TypeSizeUsed   Avail Capacity  Mounted on
+/dev/ada1p2  ufs 213G152G 44G78%/
+devfsdevfs   1.0K1.0K  0B   100%/dev
+/dev/ada0p1  ufs 1.8T168G1.5T10%/data
+linsysfs linsysfs4.0K4.0K  0B   100%/compat/linux/sys
+/dev/da0 msdosfs 7.6G424M7.2G 5%/mnt/usb
+.Ed
+.Pp
+Show previously collected data including inode statistics except for devfs or
+linsysfs file systems.
+Note that the
+.Dq no
+prefix affects all the file systems in the list and the
+.Fl t
+option can be specified only once:
+.Bd -literal -offset indent
+$ df -i -n -t nodevfs,linsysfs
+Filesystem   1K-blocks  Used  Avail Capacity iused ifree %iused
+Mounted on
+/dev/ada1p2  223235736 159618992   4575788878% 1657590  272345686%   /
+/dev/ada0p1 1892163184 176319420 156447071210% 1319710 2433005761%
+/data
+/dev/da0   79898884336647556224 5%   0 0  100%
+/mnt/usb
+.Ed
+.Pp
+Show human readable information for the file system containing the file
+.Pa /etc/rc.conf
+:
+.Bd -literal -offset indent
+$ df -h /etc/rc.conf
+Filesystem SizeUsed   Avail Capacity  Mounted on
+/dev/ada1p2213G152G 44G78%/
+.Ed
+.Pp
+Same as above but specifying some file system:
+.Bd -literal -offset indent
+$ df -h /dev/ada1p2
+Filesystem SizeUsed   Avail Capacity  Mounted on
+/dev/ada1p2213G152G 44G78%/
+.Ed
 .Sh SEE ALSO
 .Xr lsvfs 1 ,
 .Xr quota 1 ,
___
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: r366444 - head/bin/pwait

2020-10-05 Thread Fernando Apesteguía
Author: fernape (ports committer)
Date: Mon Oct  5 13:35:34 2020
New Revision: 366444
URL: https://svnweb.freebsd.org/changeset/base/366444

Log:
  pwait(1): Add EXAMPLES section to man page
  
  * Add small EXAMPLES section to the man page showing the different
flags and exit codes.
  
  * Complete description for -v flag.
  
  Approved by:  manpages (bcr@)

Modified:
  head/bin/pwait/pwait.1

Modified: head/bin/pwait/pwait.1
==
--- head/bin/pwait/pwait.1  Mon Oct  5 09:03:17 2020(r366443)
+++ head/bin/pwait/pwait.1  Mon Oct  5 13:35:34 2020(r366444)
@@ -32,7 +32,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 26, 2020
+.Dd October 5, 2020
 .Dt PWAIT 1
 .Os
 .Sh NAME
@@ -73,7 +73,9 @@ minutes
 hours
 .El
 .It Fl v
-Print the exit status when each process terminates.
+Print the exit status when each process terminates or
+.Ql timeout
+if the timer goes off earlier.
 .El
 .Sh EXIT STATUS
 The
@@ -85,6 +87,52 @@ If the
 flag is specified and a timeout occurs, the exit status will be 124.
 .Pp
 Invalid pids elicit a warning message but are otherwise ignored.
+.Sh EXAMPLES
+Start two
+.Xr sleep 1
+processes in the background.
+The first one will sleep for 30 seconds and the second one for one hour.
+Wait for any of them to finish but no more than 5 seconds.
+Since a timeout occurs the exit status is 124:
+.Bd -literal -offset indent
+$ sleep 30 & sleep 3600 &
+[1] 1646
+[2] 1647
+$ pwait -o -t5 1646 1647
+$?
+124
+.Ed
+.Pp
+Same as above but try to obtain the exit status of the processes.
+In this case
+.Ql timeout
+is shown and the exit status is 124:
+.Bd -literal -offset indent
+$ sleep 30 & sleep 3600 &
+[1] 1652
+[2] 1653
+$ pwait -v -t 5 1652 1653
+timeout
+$?
+124
+.Ed
+.Pp
+Start two
+.Xr sleep 1
+processes in the background sleeping for 30 and 40 seconds respectively.
+Wait 60 seconds for any of them to finish and get their exit codes:
+.Bd -literal -offset indent
+$ sleep 30 & sleep 40 &
+[1] 1674
+[2] 1675
+$ pwait -v -t 60 1674 1675
+1674: exited with status 0.
+1675: exited with status 0.
+[1]-  Donesleep 30
+[2]+  Donesleep 40
+$ echo $?
+0
+.Ed
 .Sh SEE ALSO
 .Xr kill 1 ,
 .Xr pkill 1 ,
___
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: r366431 - head/sys/dev/usb/serial

2020-10-05 Thread Ed Maste
On Mon, 5 Oct 2020 at 07:46, Ronald Klop  wrote:
>
> Hi,
>
> I was interested by this commit. But the commit and commit message don't have 
> much information. I was surprised that the "Differential Revision" link 
> contains a lot of info about this. How permanent is this review.freebsd.org 
> server? Wil it stay after the git migration?

It will remain, but commit messages ought to contain all of the
information necessary to make sense of the commit even in the absence
of reviews.freebsd.org.
___
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: r366431 - head/sys/dev/usb/serial

2020-10-05 Thread Ronald Klop

Hi,

I was interested by this commit. But the commit and commit message don't have much 
information. I was surprised that the "Differential Revision" link contains a 
lot of info about this. How permanent is this review.freebsd.org server? Wil it stay 
after the git migration?

Ronald.

Van: Hans Petter Selasky 
Datum: zondag, 4 oktober 2020 19:17
Aan: src-committ...@freebsd.org, svn-src-all@freebsd.org, 
svn-src-h...@freebsd.org
Onderwerp: svn commit: r366431 - head/sys/dev/usb/serial


Author: hselasky
Date: Sun Oct  4 17:17:16 2020
New Revision: 366431
URL: https://svnweb.freebsd.org/changeset/base/366431

Log:
  Add support for Google Cr50 (GSC) Closed Case Debugging UART interfaces to
  the USB generic serial port driver, ugensa.
  
  MFC after:1 week

  Differential Revision:https://reviews.freebsd.org/D21863
  Submitted by: greg_unrelenting.technology (Greg V)
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  head/sys/dev/usb/serial/ugensa.c

Modified: head/sys/dev/usb/serial/ugensa.c
==
--- head/sys/dev/usb/serial/ugensa.cSun Oct  4 17:07:13 2020(r366430)
+++ head/sys/dev/usb/serial/ugensa.cSun Oct  4 17:17:16 2020(r366431)
@@ -161,6 +161,8 @@ static const STRUCT_USB_HOST_ID ugensa_devs[] = {
{USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 1)},
{USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_49GPLUS, 1)},
{USB_VPI(USB_VENDOR_NOVATEL2, USB_PRODUCT_NOVATEL2_FLEXPACKGPS, 3)},
+   {USB_VENDOR(USB_VENDOR_GOOGLE), USB_IFACE_CLASS(UICLASS_VENDOR),
+   USB_IFACE_SUBCLASS(0x50), USB_IFACE_PROTOCOL(0x01), 
USB_DRIVER_INFO(10)},
 };
 
 DRIVER_MODULE(ugensa, uhub, ugensa_driver, ugensa_devclass, NULL, 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"




___
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: r366403 - head/bin/ls

2020-10-05 Thread Gordon Bergling
On Sat, Oct 03, 2020 at 10:33:28PM +0300, xto...@hotmail.com wrote:
> Gordon Bergling wrote:
> > On Sat, Oct 03, 2020 at 09:47:48PM +0300, xto...@hotmail.com wrote:
> >> Gordon Bergling wrote:
> >>> Author: gbe (doc committer)
> >>> Date: Sat Oct  3 18:34:24 2020
> >>> New Revision: 366403
> >>> URL: https://svnweb.freebsd.org/changeset/base/366403
> >>>
> >>> Log:
> >>> ls(1): Bugfix for an issue reported by mandoc
> >>> 
> >>> - no blank before trailing delimiter
> >>> 
> >>> MFC after:1 week
> >>>
> >>> Modified:
> >>> head/bin/ls/ls.1
> >>>
> >>> Modified: head/bin/ls/ls.1
> >>> ==
> >>> --- head/bin/ls/ls.1  Sat Oct  3 18:30:01 2020(r366402)
> >>> +++ head/bin/ls/ls.1  Sat Oct  3 18:34:24 2020(r366403)
> >>> @@ -40,7 +40,7 @@
> >>>.Nd list directory contents
> >>>.Sh SYNOPSIS
> >>>.Nm
> >>> -.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,
> >>> +.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1 ,
> >>
> >> This makes the "," appear after the "]", how about using the following
> >> instead:
> >>
> >> .Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1\&,
> > 
> > The comma is appearing right before the ']', like it was before. I'll check
> > the recommended syntax regarding '\&' tomorrow.
> 
> That's not what I'm seeing:
> 
> polaris:xtouqh:/usr/src$ svnlite info bin/ls/ls.1
> Path: bin/ls/ls.1
> Name: ls.1
> Working Copy Root Path: /usr/src
> URL: svn://svn.freebsd.org/base/head/bin/ls/ls.1
> Relative URL: ^/head/bin/ls/ls.1
> Repository Root: svn://svn.freebsd.org/base
> Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
> Revision: 366414
> Node Kind: file
> Schedule: normal
> Last Changed Author: gbe
> Last Changed Rev: 366403
> Last Changed Date: 2020-10-03 18:34:24 + (Sat, 03 Oct 2020)
> Text Last Updated: 2020-10-03 18:51:31 + (Sat, 03 Oct 2020)
> Checksum: 72fe092ab2b5ac3363ea0681cfda216876d24fcd
> 
> $ man bin/ls/ls.1 | head
> LS(1)   FreeBSD General Commands Manual 
>   LS(1)
> 
> NAME
>   ls – list directory contents
> 
> SYNOPSIS
>   ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1], [--color=when] [-D 
> format]
>  [file ...]
> 
> DESCRIPTION

That is strange. I have checked the output from mandoc and man, and with
r366403 applied, it is always the following:

---
LS(1)   FreeBSD General Commands Manual  LS(1)

NAME
 ls – list directory contents

SYNOPSIS
 ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [--color=when] [-D format]
[file ...]

DESCRIPTION
---

--Gordon
___
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: r366443 - in stable/12: share/man/man4 sys/dev/cxgbe

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 09:03:17 2020
New Revision: 366443
URL: https://svnweb.freebsd.org/changeset/base/366443

Log:
  MFC r365993:
  
  cxgbe(4): let the PF driver use VM work requests for transmit.
  
  This allows the PF interfaces to communicate with the VF interfaces over
  the internal switch in the ASIC.  Fix the GL limits for VM work requests
  while here.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/12/share/man/man4/cxgbe.4
  stable/12/sys/dev/cxgbe/adapter.h
  stable/12/sys/dev/cxgbe/t4_main.c
  stable/12/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/cxgbe.4
==
--- stable/12/share/man/man4/cxgbe.4Mon Oct  5 08:51:03 2020
(r366442)
+++ stable/12/share/man/man4/cxgbe.4Mon Oct  5 09:03:17 2020
(r366443)
@@ -351,6 +351,17 @@ This tunable is for specialized applications only and 
 normal operation.
 The capabilities for which hardware resources have been reserved are listed in
 dev..X.*caps sysctls.
+.It Va hw.cxgbe.tx_vm_wr
+Setting this to 1 instructs the driver to use VM work requests to transmit 
data.
+This lets PF interfaces transmit frames to VF interfaces over the internal
+switch in the ASIC.
+Note that the
+.Xr cxgbev 4
+VF driver always uses VM work requests and is not affected by this tunable.
+The default value is 0 and should be changed only if PF and VF interfaces need
+to communicate with each other.
+Different interfaces can be assigned different values using the
+dev..X.tx_vm_wr sysctl when the interface is administratively down.
 .El
 .Sh SUPPORT
 For general information and support,

Modified: stable/12/sys/dev/cxgbe/adapter.h
==
--- stable/12/sys/dev/cxgbe/adapter.h   Mon Oct  5 08:51:03 2020
(r366442)
+++ stable/12/sys/dev/cxgbe/adapter.h   Mon Oct  5 09:03:17 2020
(r366443)
@@ -120,6 +120,8 @@ enum {
SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR size in desc */
TX_SGL_SEGS = 39,
TX_SGL_SEGS_TSO = 38,
+   TX_SGL_SEGS_VM = 38,
+   TX_SGL_SEGS_VM_TSO = 37,
TX_SGL_SEGS_EO_TSO = 30,/* XXX: lower for IPv6. */
TX_SGL_SEGS_VXLAN_TSO = 37,
TX_WR_FLITS = SGE_MAX_WR_LEN / 8
@@ -174,6 +176,7 @@ enum {
DOOMED  = (1 << 0),
VI_INIT_DONE= (1 << 1),
VI_SYSCTL_CTX   = (1 << 2),
+   TX_USES_VM_WR   = (1 << 3),
 
/* adapter debug_flags */
DF_DUMP_MBOX= (1 << 0), /* Log all mbox cmd/rpl. */
@@ -1238,7 +1241,7 @@ void t4_intr_evt(void *);
 void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *);
 void t4_update_fl_bufsize(struct ifnet *);
 struct mbuf *alloc_wr_mbuf(int, int);
-int parse_pkt(struct adapter *, struct mbuf **);
+int parse_pkt(struct mbuf **, bool);
 void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *);
 void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *);
 int tnl_cong(struct port_info *, int);

Modified: stable/12/sys/dev/cxgbe/t4_main.c
==
--- stable/12/sys/dev/cxgbe/t4_main.c   Mon Oct  5 08:51:03 2020
(r366442)
+++ stable/12/sys/dev/cxgbe/t4_main.c   Mon Oct  5 09:03:17 2020
(r366443)
@@ -575,6 +575,10 @@ static int t4_panic_on_fatal_err = 0;
 SYSCTL_INT(_hw_cxgbe, OID_AUTO, panic_on_fatal_err, CTLFLAG_RDTUN,
 _panic_on_fatal_err, 0, "panic on fatal errors");
 
+static int t4_tx_vm_wr = 0;
+SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_vm_wr, CTLFLAG_RWTUN, _tx_vm_wr, 0,
+"Use VM work requests to transmit packets.");
+
 #ifdef TCP_OFFLOAD
 /*
  * TOE tunables.
@@ -655,6 +659,7 @@ static int sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS);
 static int sysctl_bitfield_16b(SYSCTL_HANDLER_ARGS);
 static int sysctl_btphy(SYSCTL_HANDLER_ARGS);
 static int sysctl_noflowq(SYSCTL_HANDLER_ARGS);
+static int sysctl_tx_vm_wr(SYSCTL_HANDLER_ARGS);
 static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS);
 static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS);
 static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS);
@@ -1669,6 +1674,8 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi)
 
vi->xact_addr_filt = -1;
callout_init(>tick, 1);
+   if (sc->flags & IS_VF || t4_tx_vm_wr != 0)
+   vi->flags |= TX_USES_VM_WR;
 
/* Allocate an ifnet and set it up */
ifp = if_alloc(IFT_ETHER);
@@ -1718,7 +1725,10 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi)
 #endif
 
ifp->if_hw_tsomax = IP_MAXPACKET;
-   ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_TSO;
+   if (vi->flags & TX_USES_VM_WR)
+   ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_VM_TSO;
+   else
+   ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_TSO;
 #ifdef RATELIMIT
if (is_ethoffload(sc) && vi->nofldtxq != 0)

svn commit: r366442 - in stable/12: share/man/man4 sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/firmware

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 08:51:03 2020
New Revision: 366442
URL: https://svnweb.freebsd.org/changeset/base/366442

Log:
  MFC r365871.  This needs a couple other revisions which aren't in
  stable/12 yet to actually work but is being committed out of order to
  ease other cxgbe MFCs.
  
  r365871:
  cxgbe(4): add support for stateless offloads for VXLAN traffic.
  
  Hardware assistance includes checksumming (tx and rx), TSO, and RSS on
  the inner traffic in a VXLAN tunnel.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/12/share/man/man4/cxgbe.4
  stable/12/sys/dev/cxgbe/adapter.h
  stable/12/sys/dev/cxgbe/common/common.h
  stable/12/sys/dev/cxgbe/common/t4_hw.c
  stable/12/sys/dev/cxgbe/firmware/t6fw_cfg.txt
  stable/12/sys/dev/cxgbe/t4_main.c
  stable/12/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/cxgbe.4
==
--- stable/12/share/man/man4/cxgbe.4Mon Oct  5 07:26:06 2020
(r366441)
+++ stable/12/share/man/man4/cxgbe.4Mon Oct  5 08:51:03 2020
(r366442)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd Dec 10, 2019
+.Dd September 17, 2020
 .Dt CXGBE 4
 .Os
 .Sh NAME
@@ -61,8 +61,8 @@ driver provides support for PCI Express Ethernet adapt
 the Chelsio Terminator 4, Terminator 5, and Terminator 6 ASICs (T4, T5, and 
T6).
 The driver supports Jumbo Frames, Transmit/Receive checksum offload,
 TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN
-tag insertion/extraction, VLAN checksum offload, VLAN TSO, and
-Receive Side Steering (RSS).
+tag insertion/extraction, VLAN checksum offload, VLAN TSO, VXLAN checksum
+offload, VXLAN TSO, and Receive Side Steering (RSS).
 For further hardware information and questions related to hardware
 requirements, see
 .Pa http://www.chelsio.com/ .

Modified: stable/12/sys/dev/cxgbe/adapter.h
==
--- stable/12/sys/dev/cxgbe/adapter.h   Mon Oct  5 07:26:06 2020
(r366441)
+++ stable/12/sys/dev/cxgbe/adapter.h   Mon Oct  5 08:51:03 2020
(r366442)
@@ -121,6 +121,7 @@ enum {
TX_SGL_SEGS = 39,
TX_SGL_SEGS_TSO = 38,
TX_SGL_SEGS_EO_TSO = 30,/* XXX: lower for IPv6. */
+   TX_SGL_SEGS_VXLAN_TSO = 37,
TX_WR_FLITS = SGE_MAX_WR_LEN / 8
 };
 
@@ -286,6 +287,7 @@ struct port_info {
int nvi;
int up_vis;
int uld_vis;
+   bool vxlan_tcam_entry;
 
struct tx_sched_params *sched_params;
 
@@ -593,6 +595,8 @@ struct sge_txq {
uint64_t txpkts0_pkts;  /* # of frames in type0 coalesced tx WRs */
uint64_t txpkts1_pkts;  /* # of frames in type1 coalesced tx WRs */
uint64_t raw_wrs;   /* # of raw work requests (alloc_wr_mbuf) */
+   uint64_t vxlan_tso_wrs; /* # of VXLAN TSO work requests */
+   uint64_t vxlan_txcsum;
 
/* stats for not-that-common events */
 } __aligned(CACHE_LINE_SIZE);
@@ -611,6 +615,7 @@ struct sge_rxq {
 
uint64_t rxcsum;/* # of times hardware assisted with checksum */
uint64_t vlan_extraction;/* # of times VLAN tag was extracted */
+   uint64_t vxlan_rxcsum;
 
/* stats for not-that-common events */
 
@@ -833,6 +838,11 @@ struct adapter {
struct sge sge;
int lro_timeout;
int sc_do_rxcopy;
+
+   int vxlan_port;
+   u_int vxlan_refcount;
+   int rawf_base;
+   int nrawf;
 
struct taskqueue *tq[MAX_NCHAN];/* General purpose taskqueues */
struct port_info *port[MAX_NPORTS];

Modified: stable/12/sys/dev/cxgbe/common/common.h
==
--- stable/12/sys/dev/cxgbe/common/common.h Mon Oct  5 07:26:06 2020
(r366441)
+++ stable/12/sys/dev/cxgbe/common/common.h Mon Oct  5 08:51:03 2020
(r366442)
@@ -249,7 +249,7 @@ struct tp_params {
uint32_t max_rx_pdu;
uint32_t max_tx_pdu;
uint64_t hash_filter_mask;
-   __be16 err_vec_mask;
+   bool rx_pkt_encap;
 
int8_t fcoe_shift;
int8_t port_shift;

Modified: stable/12/sys/dev/cxgbe/common/t4_hw.c
==
--- stable/12/sys/dev/cxgbe/common/t4_hw.c  Mon Oct  5 07:26:06 2020
(r366441)
+++ stable/12/sys/dev/cxgbe/common/t4_hw.c  Mon Oct  5 08:51:03 2020
(r366442)
@@ -9627,19 +9627,11 @@ int t4_init_tp_params(struct adapter *adap, bool sleep
 
read_filter_mode_and_ingress_config(adap, sleep_ok);
 
-   /*
-* Cache a mask of the bits that represent the error vector portion of
-* rx_pkt.err_vec.  T6+ can use a compressed error vector to make room
-* for information about outer encapsulation (GENEVE/VXLAN/NVGRE).
-*/
-   tpp->err_vec_mask = htobe16(0x);
if (chip_id(adap) > 

svn commit: r366441 - in stable/12: sbin/ifconfig sys/net

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 07:26:06 2020
New Revision: 366441
URL: https://svnweb.freebsd.org/changeset/base/366441

Log:
  MFC r365868:
  
  Add two new ifnet capabilities for hw checksumming and TSO for VXLAN traffic.
  
  These are similar to the existing VLAN capabilities.
  
  Reviewed by:  kib@
  Sponsored by: Chelsio Communications

Modified:
  stable/12/sbin/ifconfig/ifconfig.8
  stable/12/sbin/ifconfig/ifconfig.c
  stable/12/sbin/ifconfig/ifvxlan.c
  stable/12/sys/net/if.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/ifconfig/ifconfig.8
==
--- stable/12/sbin/ifconfig/ifconfig.8  Mon Oct  5 06:53:29 2020
(r366440)
+++ stable/12/sbin/ifconfig/ifconfig.8  Mon Oct  5 07:26:06 2020
(r366441)
@@ -28,7 +28,7 @@
 .\" From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd June 4, 2020
+.Dd September 17, 2020
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -559,7 +559,7 @@ If the driver offers user-configurable VLAN support, e
 reception of extended frames, tag processing in hardware,
 frame filtering in hardware, checksum offloading, or TSO on VLAN,
 respectively.
-Note that this must be issued on a physical interface associated with
+Note that this must be configured on a physical interface associated with
 .Xr vlan 4 ,
 not on a
 .Xr vlan 4
@@ -569,6 +569,21 @@ If the driver offers user-configurable VLAN support, d
 reception of extended frames, tag processing in hardware,
 frame filtering in hardware, or TSO on VLAN,
 respectively.
+.It Cm vxlanhwcsum , vxlanhwtso
+If the driver offers user-configurable VXLAN support, enable inner checksum
+offloading (receive and transmit) or TSO on VXLAN, respectively.
+Note that this must be configured on a physical interface associated with
+.Xr vxlan 4 ,
+not on a
+.Xr vxlan 4
+interface itself.
+The physical interface is either the interface specified as the vxlandev
+or the interface hosting the vxlanlocal address.
+The driver will offload as much checksum work and TSO as it can reliably
+support, the exact level of offloading may vary between drivers.
+.It Fl vxlanhwcsum , vxlanhwtso
+If the driver offers user-configurable VXLAN support, disable checksum
+offloading (receive and transmit) or TSO on VXLAN, respectively.
 .It Cm vnet Ar jail
 Move the interface to the
 .Xr jail 8 ,

Modified: stable/12/sbin/ifconfig/ifconfig.c
==
--- stable/12/sbin/ifconfig/ifconfig.c  Mon Oct  5 06:53:29 2020
(r366440)
+++ stable/12/sbin/ifconfig/ifconfig.c  Mon Oct  5 07:26:06 2020
(r366441)
@@ -1344,7 +1344,8 @@ unsetifdescr(const char *val, int value, int s, const 
 "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \
 "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \
 "\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \
-"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP"
+"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP" \
+"\36VXLAN_HWCSUM\37VXLAN_HWTSO"
 
 /*
  * Print the status of the interface.  If an address family was

Modified: stable/12/sbin/ifconfig/ifvxlan.c
==
--- stable/12/sbin/ifconfig/ifvxlan.c   Mon Oct  5 06:53:29 2020
(r366440)
+++ stable/12/sbin/ifconfig/ifvxlan.c   Mon Oct  5 07:26:06 2020
(r366441)
@@ -620,6 +620,11 @@ static struct cmd vxlan_cmds[] = {
 
DEF_CMD("vxlanflush", 0,setvxlan_flush),
DEF_CMD("vxlanflushall", 1, setvxlan_flush),
+
+   DEF_CMD("vxlanhwcsum",  IFCAP_VXLAN_HWCSUM, setifcap),
+   DEF_CMD("-vxlanhwcsum", -IFCAP_VXLAN_HWCSUM,setifcap),
+   DEF_CMD("vxlanhwtso",   IFCAP_VXLAN_HWTSO,  setifcap),
+   DEF_CMD("-vxlanhwtso",  -IFCAP_VXLAN_HWTSO, setifcap),
 };
 
 static struct afswtch af_vxlan = {

Modified: stable/12/sys/net/if.h
==
--- stable/12/sys/net/if.h  Mon Oct  5 06:53:29 2020(r366440)
+++ stable/12/sys/net/if.h  Mon Oct  5 07:26:06 2020(r366441)
@@ -246,6 +246,8 @@ struct if_data {
 #defineIFCAP_HWSTATS   0x80 /* manages counters internally 
*/
 #defineIFCAP_TXRTLMT   0x100 /* hardware supports TX rate 
limiting */
 #defineIFCAP_HWRXTSTMP 0x200 /* hardware rx timestamping */
+#defineIFCAP_VXLAN_HWCSUM  0x2000 /* can do IFCAN_HWCSUM on 
VXLANs */
+#defineIFCAP_VXLAN_HWTSO   0x4000 /* can do IFCAP_TSO on 
VXLANs */
 
 #define IFCAP_HWCSUM_IPV6  (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6)
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to 

svn commit: r366440 - head/tools/tools/cxgbtool

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 06:53:29 2020
New Revision: 366440
URL: https://svnweb.freebsd.org/changeset/base/366440

Log:
  Get tools/tools/cxgbtool to build with the latest clang.
  
  Reported by:  olivier@

Modified:
  head/tools/tools/cxgbtool/Makefile

Modified: head/tools/tools/cxgbtool/Makefile
==
--- head/tools/tools/cxgbtool/Makefile  Mon Oct  5 06:38:56 2020
(r366439)
+++ head/tools/tools/cxgbtool/Makefile  Mon Oct  5 06:53:29 2020
(r366440)
@@ -6,5 +6,6 @@ MAN=
 CFLAGS+= -I${.CURDIR}/../../../sys/dev/cxgb -I.
 CFLAGS+= -DCONFIG_T3_REGS -DCHELSIO_INTERNAL
 BINDIR?= /usr/sbin
+WARNS?= 3
 
 .include 
___
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: r366439 - stable/12/sys/sys

2020-10-05 Thread Navdeep Parhar
Author: np
Date: Mon Oct  5 06:38:56 2020
New Revision: 366439
URL: https://svnweb.freebsd.org/changeset/base/366439

Log:
  MFC r365867:
  
  mbuf checksum flags and fields to support tunneling protocols.
  
  These are being added to support VXLAN but will work for GENEVE as well.
  ENCAP_RSVD1 will likely become ENCAP_GENEVE in the future.
  
  The size of struct mbuf does not change and that means this change can be 
MFC'd.
  If size wasn't a constraint a cleaner way may have been to add 
inner_csum_flags
  and inner_csum_data to go with csum_flags and csum_data.
  
  Reviewed by:  kib@
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D25873

Modified:
  stable/12/sys/sys/mbuf.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/sys/mbuf.h
==
--- stable/12/sys/sys/mbuf.hMon Oct  5 05:36:01 2020(r366438)
+++ stable/12/sys/sys/mbuf.hMon Oct  5 06:38:56 2020(r366439)
@@ -168,7 +168,10 @@ struct pkthdr {
uint8_t  l3hlen;/* layer 3 hdr len */
uint8_t  l4hlen;/* layer 4 hdr len */
uint8_t  l5hlen;/* layer 5 hdr len */
-   uint32_t spare;
+   uint8_t  inner_l2hlen;
+   uint8_t  inner_l3hlen;
+   uint8_t  inner_l4hlen;
+   uint8_t  inner_l5hlen;
};
};
union {
@@ -497,7 +500,13 @@ struct mbuf {
  * Outbound flags that are set by upper protocol layers requesting lower
  * layers, or ideally the hardware, to perform these offloading tasks.
  * For outbound packets this field and its flags can be directly tested
- * against ifnet if_hwassist.
+ * against ifnet if_hwassist.  Note that the outbound and the inbound flags do
+ * not collide right now but they could be allowed to (as long as the flags are
+ * scrubbed appropriately when the direction of an mbuf changes).  CSUM_BITS
+ * would also have to split into CSUM_BITS_TX and CSUM_BITS_RX.
+ *
+ * CSUM_INNER_ is the same as CSUM_ but it applies to the inner frame.
+ * The CSUM_ENCAP_ bits identify the outer encapsulation.
  */
 #defineCSUM_IP 0x0001  /* IP header checksum 
offload */
 #defineCSUM_IP_UDP 0x0002  /* UDP checksum offload 
*/
@@ -506,13 +515,28 @@ struct mbuf {
 #defineCSUM_IP_TSO 0x0010  /* TCP segmentation 
offload */
 #defineCSUM_IP_ISCSI   0x0020  /* iSCSI checksum 
offload */
 
+#defineCSUM_INNER_IP6_UDP  0x0040
+#defineCSUM_INNER_IP6_TCP  0x0080
+#defineCSUM_INNER_IP6_TSO  0x0100
 #defineCSUM_IP6_UDP0x0200  /* UDP checksum offload 
*/
 #defineCSUM_IP6_TCP0x0400  /* TCP checksum offload 
*/
 #defineCSUM_IP6_SCTP   0x0800  /* SCTP checksum 
offload */
 #defineCSUM_IP6_TSO0x1000  /* TCP segmentation 
offload */
 #defineCSUM_IP6_ISCSI  0x2000  /* iSCSI checksum 
offload */
 
+#defineCSUM_INNER_IP   0x4000
+#defineCSUM_INNER_IP_UDP   0x8000
+#defineCSUM_INNER_IP_TCP   0x0001
+#defineCSUM_INNER_IP_TSO   0x0002
+
+#defineCSUM_ENCAP_VXLAN0x0004  /* VXLAN outer 
encapsulation */
+#defineCSUM_ENCAP_RSVD10x0008
+
 /* Inbound checksum support where the checksum was verified by hardware. */
+#defineCSUM_INNER_L3_CALC  0x0010
+#defineCSUM_INNER_L3_VALID 0x0020
+#defineCSUM_INNER_L4_CALC  0x0040
+#defineCSUM_INNER_L4_VALID 0x0080
 #defineCSUM_L3_CALC0x0100  /* calculated layer 3 
csum */
 #defineCSUM_L3_VALID   0x0200  /* checksum is correct 
*/
 #defineCSUM_L4_CALC0x0400  /* calculated layer 4 
csum */
@@ -523,16 +547,31 @@ struct mbuf {
 
 #defineCSUM_SND_TAG0x8000  /* Packet header has 
send tag */
 
+#define CSUM_FLAGS_TX (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | CSUM_IP_SCTP | \
+CSUM_IP_TSO | CSUM_IP_ISCSI | CSUM_INNER_IP6_UDP | CSUM_INNER_IP6_TCP | \
+CSUM_INNER_IP6_TSO | CSUM_IP6_UDP | CSUM_IP6_TCP | CSUM_IP6_SCTP | \
+CSUM_IP6_TSO | CSUM_IP6_ISCSI | CSUM_INNER_IP | CSUM_INNER_IP_UDP | \
+CSUM_INNER_IP_TCP | CSUM_INNER_IP_TSO | CSUM_ENCAP_VXLAN | \
+CSUM_ENCAP_RSVD1 | CSUM_SND_TAG)
+
+#define CSUM_FLAGS_RX (CSUM_INNER_L3_CALC | CSUM_INNER_L3_VALID | \
+CSUM_INNER_L4_CALC | CSUM_INNER_L4_VALID | CSUM_L3_CALC | CSUM_L3_VALID | \
+CSUM_L4_CALC | CSUM_L4_VALID | CSUM_L5_CALC | CSUM_L5_VALID | \
+