Re: svn commit: r336188 - head/usr.sbin/bhyve

2018-07-10 Thread Marcelo Araujo
Hi Ravi,

Yes, you are correct! I have discussed about it in the review and the
approach you mentioned is exactly I'm gonna do. Although with this patch
the intention for now is make exit(1) more unique for "powered off".

Snipped from the review:
"OK, I will update the manpage and commit it as-is just to make the exit(1)
more unique for now. I have intention to revisit it and improve all the
exit returns. I will replace fprintf/perror + exit as soon as I finish the
drivers analysis to make sure what can be improved as error, exit and
return code."

The full discussion is at that review.

Best,

2018-07-11 11:28 GMT+08:00 Ravi Pokala :

> Hi Marcelo,
>
> If the intention is to have specific exit codes have specific meanings,
> wouldn't it be useful to set up defines or an enum or something, so a
> symbolic value can be used rather than a bare integer?
>
> Thanks,
>
> Ravi (rpokala@)
>
> -Original Message-
> From:  on behalf of Marcelo Araujo
> 
> Date: 2018-07-10, Tuesday at 20:23
> To: , , <
> svn-src-h...@freebsd.org>
> Subject: svn commit: r336188 - head/usr.sbin/bhyve
>
> Author: araujo
> Date: Wed Jul 11 03:23:09 2018
> New Revision: 336188
> URL: https://svnweb.freebsd.org/changeset/base/336188
>
> Log:
>   Improve bhyve exit(3) error code.
>
>   The bhyve(8) exit status indicates how the VM was terminated:
>
>   0 rebooted
>   1 powered off
>   2 halted
>   3 triple fault
>
>   The problem is when we have wrappers around bhyve that parses the exit
>   error code and gets an exit(1) for an error but interprets it as
> "powered off".
>   So to mitigate this issue and makes it less error prone for third part
>   applications, I have added a new exit code 4 that is "exited due to an
> error".
>
>   For now the bhyve(8) exit status are:
>   0 rebooted
>   1 powered off
>   2 halted
>   3 triple fault
>   4 exited due to an error
>
>   Reviewed by:  @jhb
>   MFC after:2 weeks.
>   Sponsored by: iXsystems Inc.
>   Differential Revision:https://reviews.freebsd.org/D16161
>
> Modified:
>   head/usr.sbin/bhyve/bhyve.8
>   head/usr.sbin/bhyve/bhyverun.c
>   head/usr.sbin/bhyve/dbgport.c
>   head/usr.sbin/bhyve/fwctl.c
>   head/usr.sbin/bhyve/mevent_test.c
>   head/usr.sbin/bhyve/pci_e82545.c
>
> Modified: head/usr.sbin/bhyve/bhyve.8
> 
> ==
> --- head/usr.sbin/bhyve/bhyve.8 Wed Jul 11 02:32:06 2018(r336187)
> +++ head/usr.sbin/bhyve/bhyve.8 Wed Jul 11 03:23:09 2018(r336188)
> @@ -24,7 +24,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd Jul 05, 2018
> +.Dd Jul 11, 2018
>  .Dt BHYVE 8
>  .Os
>  .Sh NAME
> @@ -520,6 +520,8 @@ powered off
>  halted
>  .It 3
>  triple fault
> +.It 4
> +exited due to an error
>  .El
>  .Sh EXAMPLES
>  If not using a boot ROM, the guest operating system must have been loaded
> with
>
> Modified: head/usr.sbin/bhyve/bhyverun.c
> 
> ==
> --- head/usr.sbin/bhyve/bhyverun.c  Wed Jul 11 02:32:06 2018
> (r336187)
> +++ head/usr.sbin/bhyve/bhyverun.c  Wed Jul 11 03:23:09 2018
> (r336188)
> @@ -397,7 +397,7 @@ fbsdrun_deletecpu(struct vmctx *ctx, int vcpu)
>
> if (!CPU_ISSET(vcpu, )) {
> fprintf(stderr, "Attempting to delete unknown cpu %d\n",
> vcpu);
> -   exit(1);
> +   exit(4);
> }
>
> CPU_CLR_ATOMIC(vcpu, );
> @@ -742,7 +742,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip
> if (exitcode >= VM_EXITCODE_MAX || handler[exitcode] ==
> NULL) {
> fprintf(stderr, "vm_loop: unexpected exitcode
> 0x%x\n",
> exitcode);
> -   exit(1);
> +   exit(4);
> }
>
> rc = (*handler[exitcode])(ctx, [vcpu], );
> @@ -753,7 +753,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip
> case VMEXIT_ABORT:
> abort();
> default:
> -   exit(1);
> +   exit(4);
> }
> }
> fprintf(stderr, "vm_run error %d, errno %d\n", error, errno);
> @@ -785,7 +785,7 @@ fbsdrun_set_capabilities(struct vmctx *ctx, int cpu)
> err = vm_get_capability(ctx, cpu, VM_CAP_HALT_EXIT, );
> if (err < 0) {
> fprintf(stderr, "VM exit on HLT not supported\n");
> -   exit(1);
> +   exit(4);
> }
> vm_set_capability(ctx, cpu, VM_CAP_HALT_EXIT, 1);
> if (cpu == BSP)
> @@ -800,7 +800,7 @@ fbsdrun_set_capabilities(struct vmctx *ctx, int cpu)
> if (err < 0) {
> fprintf(stderr,
> "SMP mux requested, no pause support\n");
> -   exit(1);
> +   

Re: svn commit: r336188 - head/usr.sbin/bhyve

2018-07-10 Thread Ravi Pokala
Hi Marcelo,

If the intention is to have specific exit codes have specific meanings, 
wouldn't it be useful to set up defines or an enum or something, so a symbolic 
value can be used rather than a bare integer?

Thanks,

Ravi (rpokala@)

-Original Message-
From:  on behalf of Marcelo Araujo 

Date: 2018-07-10, Tuesday at 20:23
To: , , 

Subject: svn commit: r336188 - head/usr.sbin/bhyve

Author: araujo
Date: Wed Jul 11 03:23:09 2018
New Revision: 336188
URL: https://svnweb.freebsd.org/changeset/base/336188

Log:
  Improve bhyve exit(3) error code.
  
  The bhyve(8) exit status indicates how the VM was terminated:
  
  0 rebooted
  1 powered off
  2 halted
  3 triple fault
  
  The problem is when we have wrappers around bhyve that parses the exit
  error code and gets an exit(1) for an error but interprets it as "powered 
off".
  So to mitigate this issue and makes it less error prone for third part
  applications, I have added a new exit code 4 that is "exited due to an error".
  
  For now the bhyve(8) exit status are:
  0 rebooted
  1 powered off
  2 halted
  3 triple fault
  4 exited due to an error
  
  Reviewed by:  @jhb
  MFC after:2 weeks.
  Sponsored by: iXsystems Inc.
  Differential Revision:https://reviews.freebsd.org/D16161

Modified:
  head/usr.sbin/bhyve/bhyve.8
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/dbgport.c
  head/usr.sbin/bhyve/fwctl.c
  head/usr.sbin/bhyve/mevent_test.c
  head/usr.sbin/bhyve/pci_e82545.c

Modified: head/usr.sbin/bhyve/bhyve.8
==
--- head/usr.sbin/bhyve/bhyve.8 Wed Jul 11 02:32:06 2018(r336187)
+++ head/usr.sbin/bhyve/bhyve.8 Wed Jul 11 03:23:09 2018(r336188)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd Jul 05, 2018
+.Dd Jul 11, 2018
 .Dt BHYVE 8
 .Os
 .Sh NAME
@@ -520,6 +520,8 @@ powered off
 halted
 .It 3
 triple fault
+.It 4
+exited due to an error
 .El
 .Sh EXAMPLES
 If not using a boot ROM, the guest operating system must have been loaded with

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Wed Jul 11 02:32:06 2018
(r336187)
+++ head/usr.sbin/bhyve/bhyverun.c  Wed Jul 11 03:23:09 2018
(r336188)
@@ -397,7 +397,7 @@ fbsdrun_deletecpu(struct vmctx *ctx, int vcpu)
 
if (!CPU_ISSET(vcpu, )) {
fprintf(stderr, "Attempting to delete unknown cpu %d\n", vcpu);
-   exit(1);
+   exit(4);
}
 
CPU_CLR_ATOMIC(vcpu, );
@@ -742,7 +742,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip
if (exitcode >= VM_EXITCODE_MAX || handler[exitcode] == NULL) {
fprintf(stderr, "vm_loop: unexpected exitcode 0x%x\n",
exitcode);
-   exit(1);
+   exit(4);
}
 
rc = (*handler[exitcode])(ctx, [vcpu], );
@@ -753,7 +753,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip
case VMEXIT_ABORT:
abort();
default:
-   exit(1);
+   exit(4);
}
}
fprintf(stderr, "vm_run error %d, errno %d\n", error, errno);
@@ -785,7 +785,7 @@ fbsdrun_set_capabilities(struct vmctx *ctx, int cpu)
err = vm_get_capability(ctx, cpu, VM_CAP_HALT_EXIT, );
if (err < 0) {
fprintf(stderr, "VM exit on HLT not supported\n");
-   exit(1);
+   exit(4);
}
vm_set_capability(ctx, cpu, VM_CAP_HALT_EXIT, 1);
if (cpu == BSP)
@@ -800,7 +800,7 @@ fbsdrun_set_capabilities(struct vmctx *ctx, int cpu)
if (err < 0) {
fprintf(stderr,
"SMP mux requested, no pause support\n");
-   exit(1);
+   exit(4);
}
vm_set_capability(ctx, cpu, VM_CAP_PAUSE_EXIT, 1);
if (cpu == BSP)
@@ -814,7 +814,7 @@ fbsdrun_set_capabilities(struct vmctx *ctx, int cpu)
 
if (err) {
fprintf(stderr, "Unable to set x2apic state (%d)\n", err);
-   exit(1);
+   exit(4);
}
 
vm_set_capability(ctx, cpu, VM_CAP_ENABLE_INVPCID, 1);
@@ -850,7 +850,7 @@ do_open(const char *vmname)
}
} else {
perror("vm_create");
-   exit(1);
+   exit(4);
}
} else {
if (!romboot) {
@@ -859,14 +859,14 @@ do_open(const char *vmname)
 * bootrom must be configured to boot it.
 */
fprintf(stderr, "virtual machine 

svn commit: r336188 - head/usr.sbin/bhyve

2018-07-10 Thread Marcelo Araujo
Author: araujo
Date: Wed Jul 11 03:23:09 2018
New Revision: 336188
URL: https://svnweb.freebsd.org/changeset/base/336188

Log:
  Improve bhyve exit(3) error code.
  
  The bhyve(8) exit status indicates how the VM was terminated:
  
  0 rebooted
  1 powered off
  2 halted
  3 triple fault
  
  The problem is when we have wrappers around bhyve that parses the exit
  error code and gets an exit(1) for an error but interprets it as "powered 
off".
  So to mitigate this issue and makes it less error prone for third part
  applications, I have added a new exit code 4 that is "exited due to an error".
  
  For now the bhyve(8) exit status are:
  0 rebooted
  1 powered off
  2 halted
  3 triple fault
  4 exited due to an error
  
  Reviewed by:  @jhb
  MFC after:2 weeks.
  Sponsored by: iXsystems Inc.
  Differential Revision:https://reviews.freebsd.org/D16161

Modified:
  head/usr.sbin/bhyve/bhyve.8
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/dbgport.c
  head/usr.sbin/bhyve/fwctl.c
  head/usr.sbin/bhyve/mevent_test.c
  head/usr.sbin/bhyve/pci_e82545.c

Modified: head/usr.sbin/bhyve/bhyve.8
==
--- head/usr.sbin/bhyve/bhyve.8 Wed Jul 11 02:32:06 2018(r336187)
+++ head/usr.sbin/bhyve/bhyve.8 Wed Jul 11 03:23:09 2018(r336188)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd Jul 05, 2018
+.Dd Jul 11, 2018
 .Dt BHYVE 8
 .Os
 .Sh NAME
@@ -520,6 +520,8 @@ powered off
 halted
 .It 3
 triple fault
+.It 4
+exited due to an error
 .El
 .Sh EXAMPLES
 If not using a boot ROM, the guest operating system must have been loaded with

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Wed Jul 11 02:32:06 2018
(r336187)
+++ head/usr.sbin/bhyve/bhyverun.c  Wed Jul 11 03:23:09 2018
(r336188)
@@ -397,7 +397,7 @@ fbsdrun_deletecpu(struct vmctx *ctx, int vcpu)
 
if (!CPU_ISSET(vcpu, )) {
fprintf(stderr, "Attempting to delete unknown cpu %d\n", vcpu);
-   exit(1);
+   exit(4);
}
 
CPU_CLR_ATOMIC(vcpu, );
@@ -742,7 +742,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip
if (exitcode >= VM_EXITCODE_MAX || handler[exitcode] == NULL) {
fprintf(stderr, "vm_loop: unexpected exitcode 0x%x\n",
exitcode);
-   exit(1);
+   exit(4);
}
 
rc = (*handler[exitcode])(ctx, [vcpu], );
@@ -753,7 +753,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t startrip
case VMEXIT_ABORT:
abort();
default:
-   exit(1);
+   exit(4);
}
}
fprintf(stderr, "vm_run error %d, errno %d\n", error, errno);
@@ -785,7 +785,7 @@ fbsdrun_set_capabilities(struct vmctx *ctx, int cpu)
err = vm_get_capability(ctx, cpu, VM_CAP_HALT_EXIT, );
if (err < 0) {
fprintf(stderr, "VM exit on HLT not supported\n");
-   exit(1);
+   exit(4);
}
vm_set_capability(ctx, cpu, VM_CAP_HALT_EXIT, 1);
if (cpu == BSP)
@@ -800,7 +800,7 @@ fbsdrun_set_capabilities(struct vmctx *ctx, int cpu)
if (err < 0) {
fprintf(stderr,
"SMP mux requested, no pause support\n");
-   exit(1);
+   exit(4);
}
vm_set_capability(ctx, cpu, VM_CAP_PAUSE_EXIT, 1);
if (cpu == BSP)
@@ -814,7 +814,7 @@ fbsdrun_set_capabilities(struct vmctx *ctx, int cpu)
 
if (err) {
fprintf(stderr, "Unable to set x2apic state (%d)\n", err);
-   exit(1);
+   exit(4);
}
 
vm_set_capability(ctx, cpu, VM_CAP_ENABLE_INVPCID, 1);
@@ -850,7 +850,7 @@ do_open(const char *vmname)
}
} else {
perror("vm_create");
-   exit(1);
+   exit(4);
}
} else {
if (!romboot) {
@@ -859,14 +859,14 @@ do_open(const char *vmname)
 * bootrom must be configured to boot it.
 */
fprintf(stderr, "virtual machine cannot be booted\n");
-   exit(1);
+   exit(4);
}
}
 
ctx = vm_open(vmname);
if (ctx == NULL) {
perror("vm_open");
-   exit(1);
+   exit(4);
}
 
 #ifndef WITHOUT_CAPSICUM
@@ -888,7 +888,7 @@ do_open(const char *vmname)
error = vm_reinit(ctx);
  

Re: svn commit: r336187 - in head: share/man/man4 sys/dev/usb sys/dev/usb/wlan

2018-07-10 Thread Ben Widawsky
I accidentally snipped the Submitted By: before committing. This was actually
authored by Scott...
Scott Phillips 

On 18-07-11 02:32:06, Ben Widawsky wrote:
> Author: bwidawsk
> Date: Wed Jul 11 02:32:06 2018
> New Revision: 336187
> URL: https://svnweb.freebsd.org/changeset/base/336187
> 
> Log:
>   run(4): Add a new USB device ID.
>   
>   Summary:
>   Add the device id of the Panda Wireless PAU06 which seems to be
>   the already-supported combination of RT5392 MAC and RF RT5372
>   radio.
>   
>   Reviewed By: allanjude, eadler, jhb
>   Approved By: jhb
>   Differential Revision: https://reviews.freebsd.org/D16211
> 
> Modified:
>   head/share/man/man4/run.4
>   head/sys/dev/usb/usbdevs
>   head/sys/dev/usb/wlan/if_run.c
> 
> Modified: head/share/man/man4/run.4
> ==
> --- head/share/man/man4/run.4 Wed Jul 11 02:09:11 2018(r336186)
> +++ head/share/man/man4/run.4 Wed Jul 11 02:32:06 2018(r336187)
> @@ -16,7 +16,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd April 19, 2015
> +.Dd July 10, 2018
>  .Dt RUN 4
>  .Os
>  .Sh NAME
> @@ -164,6 +164,7 @@ driver supports the following wireless adapters:
>  .It Linksys WUSB600N
>  .It Logitec LAN-W150N/U2
>  .It Mvix Nubbin MS-811N
> +.It Panda Wireless PAU06
>  .It Planex GW-USMicroN
>  .It Planex GW-US300MiniS
>  .It Sitecom WL-182
> 
> Modified: head/sys/dev/usb/usbdevs
> ==
> --- head/sys/dev/usb/usbdevs  Wed Jul 11 02:09:11 2018(r336186)
> +++ head/sys/dev/usb/usbdevs  Wed Jul 11 02:32:06 2018(r336187)
> @@ -3900,6 +3900,7 @@ product RALINK RT3370   0x3370  RT3370
>  product RALINK RT35720x3572  RT3572
>  product RALINK RT35730x3573  RT3573
>  product RALINK RT53700x5370  RT5370
> +product RALINK RT53720x5372  RT5372
>  product RALINK RT55720x5572  RT5572
>  product RALINK RT80700x8070  RT8070
>  product RALINK RT2570_3  0x9020  RT2500USB Wireless Adapter
> 
> Modified: head/sys/dev/usb/wlan/if_run.c
> ==
> --- head/sys/dev/usb/wlan/if_run.cWed Jul 11 02:09:11 2018
> (r336186)
> +++ head/sys/dev/usb/wlan/if_run.cWed Jul 11 02:32:06 2018
> (r336187)
> @@ -301,6 +301,7 @@ static const STRUCT_USB_HOST_ID run_devs[] = {
>  RUN_DEV(RALINK,  RT3572),
>  RUN_DEV(RALINK,  RT3573),
>  RUN_DEV(RALINK,  RT5370),
> +RUN_DEV(RALINK,  RT5372),
>  RUN_DEV(RALINK,  RT5572),
>  RUN_DEV(RALINK,  RT8070),
>  RUN_DEV(SAMSUNG, WIS09ABGN),
> 
___
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: r336187 - in head: share/man/man4 sys/dev/usb sys/dev/usb/wlan

2018-07-10 Thread Ben Widawsky
Author: bwidawsk
Date: Wed Jul 11 02:32:06 2018
New Revision: 336187
URL: https://svnweb.freebsd.org/changeset/base/336187

Log:
  run(4): Add a new USB device ID.
  
  Summary:
  Add the device id of the Panda Wireless PAU06 which seems to be
  the already-supported combination of RT5392 MAC and RF RT5372
  radio.
  
  Reviewed By: allanjude, eadler, jhb
  Approved By: jhb
  Differential Revision: https://reviews.freebsd.org/D16211

Modified:
  head/share/man/man4/run.4
  head/sys/dev/usb/usbdevs
  head/sys/dev/usb/wlan/if_run.c

Modified: head/share/man/man4/run.4
==
--- head/share/man/man4/run.4   Wed Jul 11 02:09:11 2018(r336186)
+++ head/share/man/man4/run.4   Wed Jul 11 02:32:06 2018(r336187)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 19, 2015
+.Dd July 10, 2018
 .Dt RUN 4
 .Os
 .Sh NAME
@@ -164,6 +164,7 @@ driver supports the following wireless adapters:
 .It Linksys WUSB600N
 .It Logitec LAN-W150N/U2
 .It Mvix Nubbin MS-811N
+.It Panda Wireless PAU06
 .It Planex GW-USMicroN
 .It Planex GW-US300MiniS
 .It Sitecom WL-182

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsWed Jul 11 02:09:11 2018(r336186)
+++ head/sys/dev/usb/usbdevsWed Jul 11 02:32:06 2018(r336187)
@@ -3900,6 +3900,7 @@ product RALINK RT3370 0x3370  RT3370
 product RALINK RT3572  0x3572  RT3572
 product RALINK RT3573  0x3573  RT3573
 product RALINK RT5370  0x5370  RT5370
+product RALINK RT5372  0x5372  RT5372
 product RALINK RT5572  0x5572  RT5572
 product RALINK RT8070  0x8070  RT8070
 product RALINK RT2570_30x9020  RT2500USB Wireless Adapter

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Wed Jul 11 02:09:11 2018
(r336186)
+++ head/sys/dev/usb/wlan/if_run.c  Wed Jul 11 02:32:06 2018
(r336187)
@@ -301,6 +301,7 @@ static const STRUCT_USB_HOST_ID run_devs[] = {
 RUN_DEV(RALINK,RT3572),
 RUN_DEV(RALINK,RT3573),
 RUN_DEV(RALINK,RT5370),
+RUN_DEV(RALINK,RT5372),
 RUN_DEV(RALINK,RT5572),
 RUN_DEV(RALINK,RT8070),
 RUN_DEV(SAMSUNG,   WIS09ABGN),
___
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: r336186 - head/sys/sys

2018-07-10 Thread David Bright
Author: dab
Date: Wed Jul 11 02:09:11 2018
New Revision: 336186
URL: https://svnweb.freebsd.org/changeset/base/336186

Log:
  Address some (although not all) style(9) issues in event.h after r335776.
  
  Reported by:  bde@
  MFC after:1 day
  Sponsored by: Dell EMC

Modified:
  head/sys/sys/event.h

Modified: head/sys/sys/event.h
==
--- head/sys/sys/event.hWed Jul 11 01:37:01 2018(r336185)
+++ head/sys/sys/event.hWed Jul 11 02:09:11 2018(r336186)
@@ -50,16 +50,16 @@
 #define EVFILT_SYSCOUNT13
 
 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-#define EV_SET(kevp_, a, b, c, d, e, f) do {   \
-*(kevp_) = (struct kevent){\
-   .ident = (a),   \
-   .filter = (b),  \
-   .flags = (c),   \
-   .fflags = (d),  \
-   .data = (e),\
-   .udata = (f),   \
-   .ext = {0}, \
-}; \
+#defineEV_SET(kevp_, a, b, c, d, e, f) do {\
+   *(kevp_) = (struct kevent){ \
+   .ident = (a),   \
+   .filter = (b),  \
+   .flags = (c),   \
+   .fflags = (d),  \
+   .data = (e),\
+   .udata = (f),   \
+   .ext = {0}, \
+   };  \
 } while(0)
 #else /* Pre-C99 or not STDC (e.g., C++) */
 /* The definition of the local variable kevp could possibly conflict
___
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: r336185 - head/usr.sbin/acpi/acpidump

2018-07-10 Thread Ben Widawsky
Here is sample output from the tool:
LPIT: Length=148, Revision=1, Checksum=32,
  OEMID=INTEL, OEM Table ID=SKL, OEM Revision=0x0,
  Creator ID=MSFT, Creator Revision=0x5f

  Type=ACPI_LPIT_TYPE_NATIVE_CSTATE
  Length=56
  UniqueId=0x
  Flags=
  EntryTrigger=0x0060 (?) Residency=3
  Latency=3000
  ResidencyCounter=0x0632 (?) CounterFrequency=TSC

  Type=ACPI_LPIT_TYPE_NATIVE_CSTATE
  Length=56
  UniqueId=0x0001
  Flags=
  EntryTrigger=0x0060 (?) Residency=3
  Latency=3000
  ResidencyCounter=0x0632 (?) CounterFrequency=TSC


On 18-07-11 01:37:01, Ben Widawsky wrote:
> Author: bwidawsk
> Date: Wed Jul 11 01:37:01 2018
> New Revision: 336185
> URL: https://svnweb.freebsd.org/changeset/base/336185
> 
> Log:
>   acpidump(8): Add ACPI LPIT (Low Power Idle Table)
>   
>   The LPIT is the part of the "standardized" way that one can enumerate
>   various power state information on Intel platforms.
>   
>   The documentation for this change can be found here:
>   
> http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf
>   
>   Reviewed By: jhb
>   Approved By: jhb
>   Differential Revision: https://reviews.freebsd.org/D15931
> 
> Modified:
>   head/usr.sbin/acpi/acpidump/acpi.c
>   head/usr.sbin/acpi/acpidump/acpidump.8
> 
> Modified: head/usr.sbin/acpi/acpidump/acpi.c
> ==
> --- head/usr.sbin/acpi/acpidump/acpi.cTue Jul 10 23:30:19 2018
> (r336184)
> +++ head/usr.sbin/acpi/acpidump/acpi.cWed Jul 11 01:37:01 2018
> (r336185)
> @@ -68,6 +68,7 @@ static void acpi_handle_hpet(ACPI_TABLE_HEADER *sdp);
>  static void  acpi_handle_mcfg(ACPI_TABLE_HEADER *sdp);
>  static void  acpi_handle_slit(ACPI_TABLE_HEADER *sdp);
>  static void  acpi_handle_wddt(ACPI_TABLE_HEADER *sdp);
> +static void  acpi_handle_lpit(ACPI_TABLE_HEADER *sdp);
>  static void  acpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain,
>   uint32_t flags);
>  static void  acpi_print_srat_memory(ACPI_SRAT_MEM_AFFINITY *mp);
> @@ -716,6 +717,79 @@ acpi_handle_wddt(ACPI_TABLE_HEADER *sdp)
>  }
>  
>  static void
> +acpi_print_native_lpit(ACPI_LPIT_NATIVE *nl)
> +{
> + printf("\tEntryTrigger=");
> + acpi_print_gas(>EntryTrigger);
> + printf("\tResidency=%u\n", nl->Residency);
> + printf("\tLatency=%u\n", nl->Latency);
> + if (nl->Header.Flags & ACPI_LPIT_NO_COUNTER)
> + printf("\tResidencyCounter=Not Present");
> + else {
> + printf("\tResidencyCounter=");
> + acpi_print_gas(>ResidencyCounter);
> + }
> + if (nl->CounterFrequency)
> + printf("\tCounterFrequency=%ju\n", nl->CounterFrequency);
> + else
> + printf("\tCounterFrequency=TSC\n");
> +}
> +
> +static void
> +acpi_print_lpit(ACPI_LPIT_HEADER *lpit)
> +{
> + if (lpit->Type == ACPI_LPIT_TYPE_NATIVE_CSTATE)
> + printf("\tType=ACPI_LPIT_TYPE_NATIVE_CSTATE\n");
> + else
> + warnx("unknown LPIT type %u", lpit->Type);
> +
> + printf("\tLength=%u\n", lpit->Length);
> + printf("\tUniqueId=0x%04x\n", lpit->UniqueId);
> +#define  PRINTFLAG(var, flag)printflag((var), ACPI_LPIT_## flag, 
> #flag)
> + printf("\tFlags=");
> + PRINTFLAG(lpit->Flags, STATE_DISABLED);
> + PRINTFLAG_END();
> +#undef PRINTFLAG
> +
> + if (lpit->Type == ACPI_LPIT_TYPE_NATIVE_CSTATE)
> + return acpi_print_native_lpit((ACPI_LPIT_NATIVE *)lpit);
> +}
> +
> +static void
> +acpi_walk_lpit(ACPI_TABLE_HEADER *table, void *first,
> +void (*action)(ACPI_LPIT_HEADER *))
> +{
> + ACPI_LPIT_HEADER *subtable;
> + char *end;
> +
> + subtable = first;
> + end = (char *)table + table->Length;
> + while ((char *)subtable < end) {
> + printf("\n");
> + if (subtable->Length < sizeof(ACPI_LPIT_HEADER)) {
> + warnx("invalid subtable length %u", subtable->Length);
> + return;
> + }
> + action(subtable);
> + subtable = (ACPI_LPIT_HEADER *)((char *)subtable +
> + subtable->Length);
> + }
> +}
> +
> +static void
> +acpi_handle_lpit(ACPI_TABLE_HEADER *sdp)
> +{
> + ACPI_TABLE_LPIT *lpit;
> +
> + printf(BEGIN_COMMENT);
> + acpi_print_sdt(sdp);
> + lpit = (ACPI_TABLE_LPIT *)sdp;
> + acpi_walk_lpit(sdp, (lpit + 1), acpi_print_lpit);
> +
> + printf(END_COMMENT);
> +}
> +
> +static void
>  acpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain,
>  uint32_t flags)
>  {
> @@ -1693,6 +1767,8 @@ acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp)
>   acpi_handle_nfit(sdp);
>   else if (!memcmp(sdp->Signature, ACPI_SIG_WDDT, 4))
>   acpi_handle_wddt(sdp);
> + else if 

svn commit: r336185 - head/usr.sbin/acpi/acpidump

2018-07-10 Thread Ben Widawsky
Author: bwidawsk
Date: Wed Jul 11 01:37:01 2018
New Revision: 336185
URL: https://svnweb.freebsd.org/changeset/base/336185

Log:
  acpidump(8): Add ACPI LPIT (Low Power Idle Table)
  
  The LPIT is the part of the "standardized" way that one can enumerate
  various power state information on Intel platforms.
  
  The documentation for this change can be found here:
  
http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf
  
  Reviewed By: jhb
  Approved By: jhb
  Differential Revision: https://reviews.freebsd.org/D15931

Modified:
  head/usr.sbin/acpi/acpidump/acpi.c
  head/usr.sbin/acpi/acpidump/acpidump.8

Modified: head/usr.sbin/acpi/acpidump/acpi.c
==
--- head/usr.sbin/acpi/acpidump/acpi.c  Tue Jul 10 23:30:19 2018
(r336184)
+++ head/usr.sbin/acpi/acpidump/acpi.c  Wed Jul 11 01:37:01 2018
(r336185)
@@ -68,6 +68,7 @@ static void   acpi_handle_hpet(ACPI_TABLE_HEADER *sdp);
 static voidacpi_handle_mcfg(ACPI_TABLE_HEADER *sdp);
 static voidacpi_handle_slit(ACPI_TABLE_HEADER *sdp);
 static voidacpi_handle_wddt(ACPI_TABLE_HEADER *sdp);
+static voidacpi_handle_lpit(ACPI_TABLE_HEADER *sdp);
 static voidacpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain,
uint32_t flags);
 static voidacpi_print_srat_memory(ACPI_SRAT_MEM_AFFINITY *mp);
@@ -716,6 +717,79 @@ acpi_handle_wddt(ACPI_TABLE_HEADER *sdp)
 }
 
 static void
+acpi_print_native_lpit(ACPI_LPIT_NATIVE *nl)
+{
+   printf("\tEntryTrigger=");
+   acpi_print_gas(>EntryTrigger);
+   printf("\tResidency=%u\n", nl->Residency);
+   printf("\tLatency=%u\n", nl->Latency);
+   if (nl->Header.Flags & ACPI_LPIT_NO_COUNTER)
+   printf("\tResidencyCounter=Not Present");
+   else {
+   printf("\tResidencyCounter=");
+   acpi_print_gas(>ResidencyCounter);
+   }
+   if (nl->CounterFrequency)
+   printf("\tCounterFrequency=%ju\n", nl->CounterFrequency);
+   else
+   printf("\tCounterFrequency=TSC\n");
+}
+
+static void
+acpi_print_lpit(ACPI_LPIT_HEADER *lpit)
+{
+   if (lpit->Type == ACPI_LPIT_TYPE_NATIVE_CSTATE)
+   printf("\tType=ACPI_LPIT_TYPE_NATIVE_CSTATE\n");
+   else
+   warnx("unknown LPIT type %u", lpit->Type);
+
+   printf("\tLength=%u\n", lpit->Length);
+   printf("\tUniqueId=0x%04x\n", lpit->UniqueId);
+#definePRINTFLAG(var, flag)printflag((var), ACPI_LPIT_## flag, 
#flag)
+   printf("\tFlags=");
+   PRINTFLAG(lpit->Flags, STATE_DISABLED);
+   PRINTFLAG_END();
+#undef PRINTFLAG
+
+   if (lpit->Type == ACPI_LPIT_TYPE_NATIVE_CSTATE)
+   return acpi_print_native_lpit((ACPI_LPIT_NATIVE *)lpit);
+}
+
+static void
+acpi_walk_lpit(ACPI_TABLE_HEADER *table, void *first,
+void (*action)(ACPI_LPIT_HEADER *))
+{
+   ACPI_LPIT_HEADER *subtable;
+   char *end;
+
+   subtable = first;
+   end = (char *)table + table->Length;
+   while ((char *)subtable < end) {
+   printf("\n");
+   if (subtable->Length < sizeof(ACPI_LPIT_HEADER)) {
+   warnx("invalid subtable length %u", subtable->Length);
+   return;
+   }
+   action(subtable);
+   subtable = (ACPI_LPIT_HEADER *)((char *)subtable +
+   subtable->Length);
+   }
+}
+
+static void
+acpi_handle_lpit(ACPI_TABLE_HEADER *sdp)
+{
+   ACPI_TABLE_LPIT *lpit;
+
+   printf(BEGIN_COMMENT);
+   acpi_print_sdt(sdp);
+   lpit = (ACPI_TABLE_LPIT *)sdp;
+   acpi_walk_lpit(sdp, (lpit + 1), acpi_print_lpit);
+
+   printf(END_COMMENT);
+}
+
+static void
 acpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain,
 uint32_t flags)
 {
@@ -1693,6 +1767,8 @@ acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp)
acpi_handle_nfit(sdp);
else if (!memcmp(sdp->Signature, ACPI_SIG_WDDT, 4))
acpi_handle_wddt(sdp);
+   else if (!memcmp(sdp->Signature, ACPI_SIG_LPIT, 4))
+   acpi_handle_lpit(sdp);
else {
printf(BEGIN_COMMENT);
acpi_print_sdt(sdp);

Modified: head/usr.sbin/acpi/acpidump/acpidump.8
==
--- head/usr.sbin/acpi/acpidump/acpidump.8  Tue Jul 10 23:30:19 2018
(r336184)
+++ head/usr.sbin/acpi/acpidump/acpidump.8  Wed Jul 11 01:37:01 2018
(r336185)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 20, 2018
+.Dd July 10, 2018
 .Dt ACPIDUMP 8
 .Os
 .Sh NAME
@@ -103,6 +103,7 @@ utility dumps contents of the following tables:
 .It FACS
 .It FADT
 .It HPET
+.It LPIT
 .It MADT
 .It MCFG
 .It NFIT
___
svn-src-all@freebsd.org mailing list

svn commit: r336184 - head/sys/net80211

2018-07-10 Thread Kyle Evans
Author: kevans
Date: Tue Jul 10 23:30:19 2018
New Revision: 336184
URL: https://svnweb.freebsd.org/changeset/base/336184

Log:
  net80211: Fix ifdetach w/o ifattach, small whitespace cleanup
  
  As the comment says, ifdetach might be called during the course of driver
  detach if initialization failed. This shouldn't be a total failure, though,
  we just have nothing to do there.
  
  This has been modified slightly from Augustin's original commit to move the
  bail-out slightly earlier since the ic wouldn't have been added to the
  ic list in the first place, and a comment has been added describing when
  this might be an issue.
  
  Submitted by: Augustin Cavalier 
  Obtained from:Haiku (e6f6c1b4633532a8ad37c803dc7c65601e5b24ba)

Modified:
  head/sys/net80211/ieee80211.c

Modified: head/sys/net80211/ieee80211.c
==
--- head/sys/net80211/ieee80211.c   Tue Jul 10 22:53:07 2018
(r336183)
+++ head/sys/net80211/ieee80211.c   Tue Jul 10 23:30:19 2018
(r336184)
@@ -276,14 +276,14 @@ null_update_chw(struct ieee80211com *ic)
 
 int
 ic_printf(struct ieee80211com *ic, const char * fmt, ...)
-{ 
+{
va_list ap;
int retval;
 
retval = printf("%s: ", ic->ic_name);
va_start(ap, fmt);
retval += vprintf(fmt, ap);
-   va_end(ap);  
+   va_end(ap);
return (retval);
 }
 
@@ -386,6 +386,15 @@ ieee80211_ifdetach(struct ieee80211com *ic)
 {
struct ieee80211vap *vap;
 
+   /*
+* We use this as an indicator that ifattach never had a chance to be
+* called, e.g. early driver attach failed and ifdetach was called
+* during subsequent detach.  Never fear, for we have nothing to do
+* here.
+*/
+   if (ic->ic_tq == NULL)
+   return;
+
mtx_lock(_list_mtx);
LIST_REMOVE(ic, ic_next);
mtx_unlock(_list_mtx);
@@ -702,7 +711,7 @@ ieee80211_vap_attach(struct ieee80211vap *vap, ifm_cha
return 1;
 }
 
-/* 
+/*
  * Tear down vap state and reclaim the ifnet.
  * The driver is assumed to have prepared for
  * this; e.g. by turning off interrupts for the
@@ -1760,7 +1769,7 @@ addmedia(struct ifmedia *media, int caps, int addsta, 
 #defineADD(_ic, _s, _o) \
ifmedia_add(media, \
IFM_MAKEWORD(IFM_IEEE80211, (_s), (_o), 0), 0, NULL)
-   static const u_int mopts[IEEE80211_MODE_MAX] = { 
+   static const u_int mopts[IEEE80211_MODE_MAX] = {
[IEEE80211_MODE_AUTO]   = IFM_AUTO,
[IEEE80211_MODE_11A]= IFM_IEEE80211_11A,
[IEEE80211_MODE_11B]= IFM_IEEE80211_11B,
@@ -2386,13 +2395,13 @@ ieee80211_rate2media(struct ieee80211com *ic, int rate
case IEEE80211_MODE_11NA:
case IEEE80211_MODE_TURBO_A:
case IEEE80211_MODE_STURBO_A:
-   return findmedia(rates, nitems(rates), 
+   return findmedia(rates, nitems(rates),
rate | IFM_IEEE80211_11A);
case IEEE80211_MODE_11B:
-   return findmedia(rates, nitems(rates), 
+   return findmedia(rates, nitems(rates),
rate | IFM_IEEE80211_11B);
case IEEE80211_MODE_FH:
-   return findmedia(rates, nitems(rates), 
+   return findmedia(rates, nitems(rates),
rate | IFM_IEEE80211_FH);
case IEEE80211_MODE_AUTO:
/* NB: ic may be NULL for some drivers */
___
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: r336183 - head/usr.sbin/nfsd

2018-07-10 Thread Rick Macklem
Author: rmacklem
Date: Tue Jul 10 22:53:07 2018
New Revision: 336183
URL: https://svnweb.freebsd.org/changeset/base/336183

Log:
  Update the pnfs(4) man page.
  
  This is a content change.

Modified:
  head/usr.sbin/nfsd/pnfs.4

Modified: head/usr.sbin/nfsd/pnfs.4
==
--- head/usr.sbin/nfsd/pnfs.4   Tue Jul 10 22:00:20 2018(r336182)
+++ head/usr.sbin/nfsd/pnfs.4   Tue Jul 10 22:53:07 2018(r336183)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 26, 2018
+.Dd July 10, 2018
 .Dt PNFS 4
 .Os
 .Sh NAME
@@ -67,7 +67,8 @@ It is for a byte range of a file and is either Read or
 For the FreeBSD server, a layout covers all bytes of a file.
 A layout may be recalled by the MDS using a LayoutRecall callback.
 When a client returns a layout via the LayoutReturn operation it can
-indicate that error(s) were encountered while doing I/O on the DS.
+indicate that error(s) were encountered while doing I/O on the DS,
+at least for certain layout types such as the Flexible File Layout.
 .Pp
 The FreeBSD client and server supports two layout types.
 .Pp
@@ -94,7 +95,9 @@ For a non-mirrored configuration, the FreeBSD server w
 layouts by default.
 However that default can be set to the Flexible File Layout by setting the
 .Xr sysctl 1
-sysctl ``vfs.nfsd.default_flexfile'' to one.
+sysctl
+.Dq vfs.nfsd.default_flexfile
+to one.
 Mirrored server configurations will only issue Flexible File Layouts.
 .Tn pNFS
 clients mount the MDS as they would a single NFS server.
@@ -115,14 +118,14 @@ Each of these files will also have two extended attrib
 attribute name space:
 .Bd -literal -offset indent
 pnfsd.dsfile - This extended attrbute stores the information that the
-MDS needs to find the data file on a DS for this file.
+MDS needs to find the data file on a DS(s) for this file.
 pnfsd.dsattr - This extended attribute stores the Size, AccessTime,
 ModifyTime and Change attributes for the file.
 .Ed
 .Pp
 For each regular (VREG) file, the MDS creates a data file on one
 (or on N of them for the mirrored case, where N is the mirror_level)
-of the DSs where the file's data will be stored.
+of the DS(s) where the file's data will be stored.
 The name of this file is
 the file handle of the file on the MDS in hexadecimal at time of file creation.
 The data file will have the same file ownership, mode and NFSv4 ACL
@@ -143,6 +146,17 @@ For the non-pNFS aware client, the MDS will perform I/
 a proxy for the non-pNFS aware client.
 This is also true for NFSv3 and NFSv4.0 mounts, since these are always non-pNFS
 aware.
+.Pp
+It is possible to assign a DS to an MDS exported file system so that it will
+store data for files on the MDS exported file system.
+If a DS is not assigned to an MDS exported file system, it will store data
+for files on all exported file systems on the MDS.
+.Pp
+If mirroring is enabled, the pNFS service will continue to function when
+DS(s) have failed, so long is there is at least one DS still operational
+that stores data for files on all of the MDS exported file systems.
+After a disabled mirrored DS is repaired, it is possible to recover the DS
+as a mirror while the pNFS service continues to function.
 .Pp
 See
 .Bd -literal -offset indent
___
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: r336182 - in head: . lib/libc/sys share/man/man4 sys/sys usr.bin usr.bin/numactl

2018-07-10 Thread Konstantin Belousov
Author: kib
Date: Tue Jul 10 22:00:20 2018
New Revision: 336182
URL: https://svnweb.freebsd.org/changeset/base/336182

Log:
  Remove bits of the old NUMA.
  
  Remove numactl(1), edit numa(4) to bring it some closer to reality,
  provide libc ABI shims for old NUMA syscalls.
  
  Noted and reviewed by:brooks (previous version)
  Sponsored by: The FreeBSD Foundation
  Differential revision:https://reviews.freebsd.org/D16142

Deleted:
  head/lib/libc/sys/numa_getaffinity.2
  head/sys/sys/numa.h
  head/usr.bin/numactl/
Modified:
  head/ObsoleteFiles.inc
  head/lib/libc/sys/Makefile.inc
  head/lib/libc/sys/compat-stub.c
  head/share/man/man4/numa.4
  head/usr.bin/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Jul 10 21:20:49 2018(r336181)
+++ head/ObsoleteFiles.inc  Tue Jul 10 22:00:20 2018(r336182)
@@ -38,6 +38,12 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20180710: old numa cleanup
+OLD_FILES+=usr/include/sys/numa.h
+OLD_FILES+=usr/share/man/man2/numa_getaffinity.2.gz
+OLD_FILES+=usr/share/man/man2/numa_setaffinity.2.gz
+OLD_FILES+=usr/share/man/man1/numactl.1.gz
+OLD_FILES+=usr/bin/numactl
 # 20180630: new clang import which bumps version from 6.0.0 to 6.0.1.
 OLD_FILES+=usr/lib/clang/6.0.0/include/sanitizer/allocator_interface.h
 OLD_FILES+=usr/lib/clang/6.0.0/include/sanitizer/asan_interface.h

Modified: head/lib/libc/sys/Makefile.inc
==
--- head/lib/libc/sys/Makefile.inc  Tue Jul 10 21:20:49 2018
(r336181)
+++ head/lib/libc/sys/Makefile.inc  Tue Jul 10 22:00:20 2018
(r336182)
@@ -258,7 +258,6 @@ MAN+=   abort2.2 \
nanosleep.2 \
nfssvc.2 \
ntp_adjtime.2 \
-   numa_getaffinity.2 \
open.2 \
pathconf.2 \
pdfork.2 \
@@ -430,7 +429,6 @@ MLINKS+=mount.2 nmount.2 \
 MLINKS+=mq_receive.2 mq_timedreceive.2
 MLINKS+=mq_send.2 mq_timedsend.2
 MLINKS+=ntp_adjtime.2 ntp_gettime.2
-MLINKS+=numa_getaffinity.2 numa_setaffinity.2
 MLINKS+=open.2 openat.2
 MLINKS+=pathconf.2 fpathconf.2
 MLINKS+=pathconf.2 lpathconf.2

Modified: head/lib/libc/sys/compat-stub.c
==
--- head/lib/libc/sys/compat-stub.c Tue Jul 10 21:20:49 2018
(r336181)
+++ head/lib/libc/sys/compat-stub.c Tue Jul 10 22:00:20 2018
(r336182)
@@ -54,3 +54,5 @@ __sym_compat(symbol, __compat_enosys ## symbol, versio
 
 __compat_nosys(netbsd_lchown, FBSD_1.0);
 __compat_nosys(netbsd_msync, FBSD_1.0);
+__compat_nosys(numa_getaffinity, FBSD_1.4);
+__compat_nosys(numa_setaffinity, FBSD_1.4);

Modified: head/share/man/man4/numa.4
==
--- head/share/man/man4/numa.4  Tue Jul 10 21:20:49 2018(r336181)
+++ head/share/man/man4/numa.4  Tue Jul 10 22:00:20 2018(r336182)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 10, 2015
+.Dd July 10, 2018
 .Dt NUMA 4
 .Os
 .Sh NAME
@@ -34,7 +34,6 @@
 .Cd options SMP
 .Cd options MAXMEMDOM=16
 .Pp
-.In sys/numa.h
 .In sys/cpuset.h
 .In sys/bus.h
 .Sh DESCRIPTION
@@ -51,20 +50,21 @@ that is connected to one of the other processors.
 .Pp
 .Nm
 is enabled when the
-.Cd MAXMEMDOM
+.Cd NUMA
 option is used in a kernel configuration
-file and is set to a value greater than 1.
+file and the
+.Cd MAXMEMDOM
+option is set to a value greater than 1.
 .Pp
 Thread and process
 .Nm
 policies are controlled with the
-.Xr numa_setaffinity 2
+.Xr cpuset_getdomain 2
 and
-.Xr numa_getaffinity 2
+.Xr cpuset_setdomain 2
 syscalls.
-.Pp
 The
-.Xr numactl 1
+.Xr cpuset 1
 tool is available for starting processes with a non-default
 policy, or to change the policy of an existing thread or process.
 .Pp
@@ -83,15 +83,6 @@ MIB variables:
 .It Va vm.ndomains
 The number of VM domains which have been detected.
 .Pp
-.It Va vm.default_policy
-The default VM domain allocation policy.
-Defaults to "first-touch-rr".
-The valid values are "first-touch", "first-touch-rr",
-"rr", where "rr" is a short-hand for "round-robin."
-See
-.Xr numa_setaffinity 2
-for more information about the available policies.
-.Pp
 .It Va vm.phys_locality
 A table indicating the relative cost of each VM domain to each other.
 A value of 10 indicates equal cost.
@@ -111,36 +102,11 @@ domains are mapped into a contiguous, non-sparse
 VM domain space, starting from 0.
 Thus, VM domain information (for example, the domain identifier) is not
 necessarily the same as is found in the hardware specific information.
-.Pp
-The
-.Nm
-allocation policies are implemented as a policy and iterator in
-.Pa sys/vm/vm_domain.c
-and
-.Pa sys/vm/vm_domain.h .
 Policy information is available in both struct thread and struct proc.
-Processes 

svn commit: r336181 - head

2018-07-10 Thread Bryan Drewery
Author: bdrewery
Date: Tue Jul 10 21:20:49 2018
New Revision: 336181
URL: https://svnweb.freebsd.org/changeset/base/336181

Log:
  Fix parsing of create-kernel-packages
  
  MFC after:3 days
  Reported by:  rene

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Jul 10 20:11:32 2018(r336180)
+++ head/Makefile.inc1  Tue Jul 10 21:20:49 2018(r336181)
@@ -1798,12 +1798,12 @@ create-world-package-${pkgname}: .PHONY
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh 
config ABI)/${PKG_VERSION}
 .endfor
 
-create-kernel-packages:.PHONY
 _default_flavor=   -default
 .if make(*package*) && exists(${KSTAGEDIR}/kernel.meta)
 . if ${MK_DEBUG_FILES} != "no"
 _debug=-debug
 . endif
+create-kernel-packages:.PHONY
 . for flavor in "" ${_debug}
 create-kernel-packages: 
create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}
 create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: 
_pkgbootstrap .PHONY
___
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: r336180 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-07-10 Thread Sean Eric Fagan
Author: sef
Date: Tue Jul 10 20:11:32 2018
New Revision: 336180
URL: https://svnweb.freebsd.org/changeset/base/336180

Log:
  Fix up some missed and mis-merges from the sequential scan code
  (r334844). Most of the changes involve moving some code around to
  reduce conflicts with future merges.  One of the missing changes
  included a notification on scrub cancellation.
  
  Approved by:  mav
  Sponsored by: iXsystems Inc

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Tue Jul 
10 19:37:52 2018(r336179)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Tue Jul 
10 20:11:32 2018(r336180)
@@ -739,14 +739,15 @@ dsl_scan(dsl_pool_t *dp, pool_scan_func_t func)
/* got scrub start cmd, resume paused scrub */
int err = dsl_scrub_set_pause_resume(scn->scn_dp,
POOL_SCRUB_NORMAL);
-   if (err == 0)
+   if (err == 0) {
+   spa_event_notify(spa, NULL, NULL, ESC_ZFS_SCRUB_RESUME);
return (ECANCELED);
-
+   }
return (SET_ERROR(err));
}
 
return (dsl_sync_task(spa_name(spa), dsl_scan_setup_check,
-   dsl_scan_setup_sync, , 0, ZFS_SPACE_CHECK_NONE));
+   dsl_scan_setup_sync, , 0, ZFS_SPACE_CHECK_EXTRA_RESERVED));
 }
 
 /* ARGSUSED */
@@ -2110,7 +2111,6 @@ dsl_scan_visitds(dsl_scan_t *scn, uint64_t dsobj, dmu_
 {
dsl_pool_t *dp = scn->scn_dp;
dsl_dataset_t *ds;
-   objset_t *os;
 
VERIFY3U(0, ==, dsl_dataset_hold_obj(dp, dsobj, FTAG, ));
 
@@ -2154,9 +2154,6 @@ dsl_scan_visitds(dsl_scan_t *scn, uint64_t dsobj, dmu_
goto out;
}
 
-   if (dmu_objset_from_ds(ds, ))
-   goto out;
-
/*
 * Only the ZIL in the head (non-snapshot) is valid. Even though
 * snapshots can have ZIL block pointers (which may be the same
@@ -2166,8 +2163,14 @@ dsl_scan_visitds(dsl_scan_t *scn, uint64_t dsobj, dmu_
 * rather than in scan_recurse(), because the regular snapshot
 * block-sharing rules don't apply to it.
 */
-   if (!ds->ds_is_snapshot)
+   if (DSL_SCAN_IS_SCRUB_RESILVER(scn) && !dsl_dataset_is_snapshot(ds) &&
+   ds->ds_dir != dp->dp_origin_snap->ds_dir) {
+   objset_t *os;
+   if (dmu_objset_from_ds(ds, ) != 0) {
+   goto out;
+   }
dsl_scan_zil(dp, >os_zil_header);
+   }
 
/*
 * Iterate over the bps in this ds.
@@ -2878,22 +2881,6 @@ dsl_scan_free_block_cb(void *arg, const blkptr_t *bp, 
return (0);
 }
 
-static int
-dsl_scan_obsolete_block_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx)
-{
-   dsl_scan_t *scn = arg;
-   const dva_t *dva = >blk_dva[0];
-
-   if (dsl_scan_async_block_should_pause(scn))
-   return (SET_ERROR(ERESTART));
-
-   spa_vdev_indirect_mark_obsolete(scn->scn_dp->dp_spa,
-   DVA_GET_VDEV(dva), DVA_GET_OFFSET(dva),
-   DVA_GET_ASIZE(dva), tx);
-   scn->scn_visited_this_txg++;
-   return (0);
-}
-
 static void
 dsl_scan_update_stats(dsl_scan_t *scn)
 {
@@ -2929,6 +2916,22 @@ dsl_scan_update_stats(dsl_scan_t *scn)
scn->scn_zios_this_txg = zio_count_total;
 }
 
+static int
+dsl_scan_obsolete_block_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx)
+{
+   dsl_scan_t *scn = arg;
+   const dva_t *dva = >blk_dva[0];
+
+   if (dsl_scan_async_block_should_pause(scn))
+   return (SET_ERROR(ERESTART));
+
+   spa_vdev_indirect_mark_obsolete(scn->scn_dp->dp_spa,
+   DVA_GET_VDEV(dva), DVA_GET_OFFSET(dva),
+   DVA_GET_ASIZE(dva), tx);
+   scn->scn_visited_this_txg++;
+   return (0);
+}
+
 boolean_t
 dsl_scan_active(dsl_scan_t *scn)
 {
@@ -2950,12 +2953,51 @@ dsl_scan_active(dsl_scan_t *scn)
return (used != 0);
 }
 
+static boolean_t
+dsl_scan_need_resilver(spa_t *spa, const dva_t *dva, size_t psize,
+uint64_t phys_birth)
+{
+   vdev_t *vd;
+
+   if (DVA_GET_GANG(dva)) {
+   /*
+* Gang members may be spread across multiple
+* vdevs, so the best estimate we have is the
+* scrub range, which has already been checked.
+* XXX -- it would be better to change our
+* allocation policy to ensure that all
+* gang members reside on the same vdev.
+*/
+   return (B_TRUE);
+   }
+
+   vd = vdev_lookup_top(spa, DVA_GET_VDEV(dva));
+
+   /*
+* Check if the txg falls within the range which must be
+* resilvered.  DVAs outside this range can always be skipped.
+

svn commit: r336179 - in stable/10/sys/fs: nfs nfsserver

2018-07-10 Thread Rick Macklem
Author: rmacklem
Date: Tue Jul 10 19:37:52 2018
New Revision: 336179
URL: https://svnweb.freebsd.org/changeset/base/336179

Log:
  MFC: r333508
  Add support for the TestStateID operation to the NFSv4.1 server.
  
  The Linux client now uses the TestStateID operation, so this patch adds
  support for it to the NFSv4.1 server. The FreeBSD client never uses this
  operation, so it should not be affected.

Modified:
  stable/10/sys/fs/nfs/nfs_var.h
  stable/10/sys/fs/nfsserver/nfs_nfsdserv.c
  stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c
  stable/10/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfs/nfs_var.h
==
--- stable/10/sys/fs/nfs/nfs_var.h  Tue Jul 10 19:28:16 2018
(r336178)
+++ stable/10/sys/fs/nfs/nfs_var.h  Tue Jul 10 19:37:52 2018
(r336179)
@@ -96,6 +96,7 @@ int nfsrv_getclient(nfsquad_t, int, struct nfsclient *
 int nfsrv_destroyclient(nfsquad_t, NFSPROC_T *);
 int nfsrv_destroysession(struct nfsrv_descript *, uint8_t *);
 int nfsrv_freestateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *);
+int nfsrv_teststateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *);
 int nfsrv_adminrevoke(struct nfsd_clid *, NFSPROC_T *);
 void nfsrv_dumpclients(struct nfsd_dumpclients *, int);
 void nfsrv_dumplocks(vnode_t, struct nfsd_dumplocks *, int, NFSPROC_T *);
@@ -233,6 +234,8 @@ int nfsrvd_destroyclientid(struct nfsrv_descript *, in
 int nfsrvd_destroysession(struct nfsrv_descript *, int,
 vnode_t, NFSPROC_T *, struct nfsexstuff *);
 int nfsrvd_freestateid(struct nfsrv_descript *, int,
+vnode_t, NFSPROC_T *, struct nfsexstuff *);
+int nfsrvd_teststateid(struct nfsrv_descript *, int,
 vnode_t, NFSPROC_T *, struct nfsexstuff *);
 int nfsrvd_notsupp(struct nfsrv_descript *, int,
 vnode_t, NFSPROC_T *, struct nfsexstuff *);

Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c
==
--- stable/10/sys/fs/nfsserver/nfs_nfsdserv.c   Tue Jul 10 19:28:16 2018
(r336178)
+++ stable/10/sys/fs/nfsserver/nfs_nfsdserv.c   Tue Jul 10 19:37:52 2018
(r336179)
@@ -4066,6 +4066,50 @@ nfsmout:
 }
 
 /*
+ * nfsv4 test stateid service
+ */
+APPLESTATIC int
+nfsrvd_teststateid(struct nfsrv_descript *nd, __unused int isdgram,
+__unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp)
+{
+   uint32_t *tl;
+   nfsv4stateid_t *stateidp = NULL, *tstateidp;
+   int cnt, error = 0, i, ret;
+
+   if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) {
+   nd->nd_repstat = NFSERR_WRONGSEC;
+   goto nfsmout;
+   }
+   NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED);
+   cnt = fxdr_unsigned(int, *tl);
+   if (cnt <= 0 || cnt > 1024) {
+   nd->nd_repstat = NFSERR_BADXDR;
+   goto nfsmout;
+   }
+   stateidp = mallocarray(cnt, sizeof(nfsv4stateid_t), M_TEMP, M_WAITOK);
+   tstateidp = stateidp;
+   for (i = 0; i < cnt; i++) {
+   NFSM_DISSECT(tl, uint32_t *, NFSX_STATEID);
+   tstateidp->seqid = fxdr_unsigned(uint32_t, *tl++);
+   NFSBCOPY(tl, tstateidp->other, NFSX_STATEIDOTHER);
+   tstateidp++;
+   }
+   NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED);
+   *tl = txdr_unsigned(cnt);
+   tstateidp = stateidp;
+   for (i = 0; i < cnt; i++) {
+   ret = nfsrv_teststateid(nd, tstateidp, p);
+   NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED);
+   *tl = txdr_unsigned(ret);
+   tstateidp++;
+   }
+nfsmout:
+   free(stateidp, M_TEMP);
+   NFSEXITCODE2(error, nd);
+   return (error);
+}
+
+/*
  * nfsv4 service not supported
  */
 APPLESTATIC int

Modified: stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c
==
--- stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Tue Jul 10 19:28:16 2018
(r336178)
+++ stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c Tue Jul 10 19:37:52 2018
(r336179)
@@ -190,7 +190,7 @@ int (*nfsrv4_ops0[NFSV41_NOPS])(struct nfsrv_descript 
nfsrvd_notsupp,
nfsrvd_sequence,
nfsrvd_notsupp,
-   nfsrvd_notsupp,
+   nfsrvd_teststateid,
nfsrvd_notsupp,
nfsrvd_destroyclientid,
nfsrvd_reclaimcomplete,

Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c  Tue Jul 10 19:28:16 2018
(r336178)
+++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c  Tue Jul 10 19:37:52 2018
(r336179)
@@ -6070,6 +6070,32 @@ nfsrv_freestateid(struct nfsrv_descript *nd, nfsv4stat
 }
 
 /*
+ * Test a stateid.
+ */
+int
+nfsrv_teststateid(struct nfsrv_descript *nd, nfsv4stateid_t *stateidp,
+NFSPROC_T 

svn commit: r336178 - in stable/11/sys/fs: nfs nfsserver

2018-07-10 Thread Rick Macklem
Author: rmacklem
Date: Tue Jul 10 19:28:16 2018
New Revision: 336178
URL: https://svnweb.freebsd.org/changeset/base/336178

Log:
  MFC: r333508
  Add support for the TestStateID operation to the NFSv4.1 server.
  
  The Linux client now uses the TestStateID operation, so this patch adds
  support for it to the NFSv4.1 server. The FreeBSD client never uses this
  operation, so it should not be affected.

Modified:
  stable/11/sys/fs/nfs/nfs_var.h
  stable/11/sys/fs/nfsserver/nfs_nfsdserv.c
  stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c
  stable/11/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nfs/nfs_var.h
==
--- stable/11/sys/fs/nfs/nfs_var.h  Tue Jul 10 18:44:44 2018
(r336177)
+++ stable/11/sys/fs/nfs/nfs_var.h  Tue Jul 10 19:28:16 2018
(r336178)
@@ -96,6 +96,7 @@ int nfsrv_getclient(nfsquad_t, int, struct nfsclient *
 int nfsrv_destroyclient(nfsquad_t, NFSPROC_T *);
 int nfsrv_destroysession(struct nfsrv_descript *, uint8_t *);
 int nfsrv_freestateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *);
+int nfsrv_teststateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *);
 int nfsrv_adminrevoke(struct nfsd_clid *, NFSPROC_T *);
 void nfsrv_dumpclients(struct nfsd_dumpclients *, int);
 void nfsrv_dumplocks(vnode_t, struct nfsd_dumplocks *, int, NFSPROC_T *);
@@ -233,6 +234,8 @@ int nfsrvd_destroyclientid(struct nfsrv_descript *, in
 int nfsrvd_destroysession(struct nfsrv_descript *, int,
 vnode_t, NFSPROC_T *, struct nfsexstuff *);
 int nfsrvd_freestateid(struct nfsrv_descript *, int,
+vnode_t, NFSPROC_T *, struct nfsexstuff *);
+int nfsrvd_teststateid(struct nfsrv_descript *, int,
 vnode_t, NFSPROC_T *, struct nfsexstuff *);
 int nfsrvd_notsupp(struct nfsrv_descript *, int,
 vnode_t, NFSPROC_T *, struct nfsexstuff *);

Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c
==
--- stable/11/sys/fs/nfsserver/nfs_nfsdserv.c   Tue Jul 10 18:44:44 2018
(r336177)
+++ stable/11/sys/fs/nfsserver/nfs_nfsdserv.c   Tue Jul 10 19:28:16 2018
(r336178)
@@ -4097,6 +4097,50 @@ nfsmout:
 }
 
 /*
+ * nfsv4 test stateid service
+ */
+APPLESTATIC int
+nfsrvd_teststateid(struct nfsrv_descript *nd, __unused int isdgram,
+__unused vnode_t vp, NFSPROC_T *p, __unused struct nfsexstuff *exp)
+{
+   uint32_t *tl;
+   nfsv4stateid_t *stateidp = NULL, *tstateidp;
+   int cnt, error = 0, i, ret;
+
+   if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) {
+   nd->nd_repstat = NFSERR_WRONGSEC;
+   goto nfsmout;
+   }
+   NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED);
+   cnt = fxdr_unsigned(int, *tl);
+   if (cnt <= 0 || cnt > 1024) {
+   nd->nd_repstat = NFSERR_BADXDR;
+   goto nfsmout;
+   }
+   stateidp = mallocarray(cnt, sizeof(nfsv4stateid_t), M_TEMP, M_WAITOK);
+   tstateidp = stateidp;
+   for (i = 0; i < cnt; i++) {
+   NFSM_DISSECT(tl, uint32_t *, NFSX_STATEID);
+   tstateidp->seqid = fxdr_unsigned(uint32_t, *tl++);
+   NFSBCOPY(tl, tstateidp->other, NFSX_STATEIDOTHER);
+   tstateidp++;
+   }
+   NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED);
+   *tl = txdr_unsigned(cnt);
+   tstateidp = stateidp;
+   for (i = 0; i < cnt; i++) {
+   ret = nfsrv_teststateid(nd, tstateidp, p);
+   NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED);
+   *tl = txdr_unsigned(ret);
+   tstateidp++;
+   }
+nfsmout:
+   free(stateidp, M_TEMP);
+   NFSEXITCODE2(error, nd);
+   return (error);
+}
+
+/*
  * nfsv4 service not supported
  */
 APPLESTATIC int

Modified: stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c
==
--- stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c Tue Jul 10 18:44:44 2018
(r336177)
+++ stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c Tue Jul 10 19:28:16 2018
(r336178)
@@ -190,7 +190,7 @@ int (*nfsrv4_ops0[NFSV41_NOPS])(struct nfsrv_descript 
nfsrvd_notsupp,
nfsrvd_sequence,
nfsrvd_notsupp,
-   nfsrvd_notsupp,
+   nfsrvd_teststateid,
nfsrvd_notsupp,
nfsrvd_destroyclientid,
nfsrvd_reclaimcomplete,

Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c  Tue Jul 10 18:44:44 2018
(r336177)
+++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c  Tue Jul 10 19:28:16 2018
(r336178)
@@ -6078,6 +6078,32 @@ nfsrv_freestateid(struct nfsrv_descript *nd, nfsv4stat
 }
 
 /*
+ * Test a stateid.
+ */
+int
+nfsrv_teststateid(struct nfsrv_descript *nd, nfsv4stateid_t *stateidp,
+NFSPROC_T 

svn commit: r336177 - head/usr.sbin/pnfsdskill

2018-07-10 Thread Rick Macklem
Author: rmacklem
Date: Tue Jul 10 18:44:44 2018
New Revision: 336177
URL: https://svnweb.freebsd.org/changeset/base/336177

Log:
  Document the "-f" option added to pnfsdskill(8) by r336176.
  
  This is a content change.

Modified:
  head/usr.sbin/pnfsdskill/pnfsdskill.8

Modified: head/usr.sbin/pnfsdskill/pnfsdskill.8
==
--- head/usr.sbin/pnfsdskill/pnfsdskill.8   Tue Jul 10 18:41:16 2018
(r336176)
+++ head/usr.sbin/pnfsdskill/pnfsdskill.8   Tue Jul 10 18:44:44 2018
(r336177)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 9, 2018
+.Dd July 9, 2018
 .Dt PNFSDSKILL 8
 .Os
 .Sh NAME
@@ -32,6 +32,7 @@
 disables a pNFS data storage server (DS)
 .Sh SYNOPSIS
 .Nm
+.Op Fl f
 .Ar mounted-on-DS-dir
 .Sh DESCRIPTION
 The
@@ -42,6 +43,18 @@ may use this command on the metadata server (MDS) to d
 This command must be used on the MDS and the
 .Ar mounted-on-DS-dir
 must be the exact pathname used when mounting the DS on the MDS.
+Normally this command will fail if there is no valid mirror for the DS
+available.
+.Pp
+The following option is available:
+.Bl -tag -width Ds
+.It Fl f
+This option forces the DS to be disabled even if there is no valid mirror
+for the DS available.
+It should only be used to allow the
+.Xr nfsd 8
+threads to be terminated.
+.El
 .Pp
 If this command fails with
 .Dq Device not configured
___
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: r336176 - head/usr.sbin/pnfsdskill

2018-07-10 Thread Rick Macklem
Author: rmacklem
Date: Tue Jul 10 18:41:16 2018
New Revision: 336176
URL: https://svnweb.freebsd.org/changeset/base/336176

Log:
  Add a "-f" option to pnfsdskill(8) to force disabling of a DS.
  
  The pnfsdskill(8) command will normally fail if there is no valid mirror
  for the DS to be disabled. However, a system administrator may need to
  disable a DS which does not have a valid mirror so that the nfsd threads
  can be terminated. This patch adds a "-f" option to pnfsdskill(8) that
  uses the kernel changes made by r336141 to implement this "forced" case
  of disabling a DS.
  This patch only affects the pNFS server.

Modified:
  head/usr.sbin/pnfsdskill/pnfsdskill.c

Modified: head/usr.sbin/pnfsdskill/pnfsdskill.c
==
--- head/usr.sbin/pnfsdskill/pnfsdskill.c   Tue Jul 10 18:00:55 2018
(r336175)
+++ head/usr.sbin/pnfsdskill/pnfsdskill.c   Tue Jul 10 18:41:16 2018
(r336176)
@@ -30,6 +30,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -44,6 +45,11 @@ __FBSDID("$FreeBSD$");
 
 static void usage(void);
 
+static struct option longopts[] = {
+   { "force",  no_argument,NULL,   'f' },
+   { NULL, 0,  NULL,   0   }
+};
+
 /*
  * This program disables use of a DS mirror.  The "dspath" command line
  * argument must be an exact match for the mounted-on path of the DS.
@@ -54,23 +60,39 @@ int
 main(int argc, char *argv[])
 {
struct nfsd_pnfsd_args pnfsdarg;
+   int ch, force;
 
-   if (argc != 2)
-   usage();
if (geteuid() != 0)
errx(1, "Must be run as root/su");
+   force = 0;
+   while ((ch = getopt_long(argc, argv, "f", longopts, NULL)) != -1) {
+   switch (ch) {
+   case 'f':
+   force = 1;
+   break;
+   default:
+   usage();
+   }
+   }
+   argc -= optind;
+   argv += optind;
+   if (argc != 1)
+   usage();
 
-   pnfsdarg.op = PNFSDOP_DELDSSERVER;
-   pnfsdarg.dspath = argv[1];
+   if (force != 0)
+   pnfsdarg.op = PNFSDOP_FORCEDELDS;
+   else
+   pnfsdarg.op = PNFSDOP_DELDSSERVER;
+   pnfsdarg.dspath = *argv;
if (nfssvc(NFSSVC_PNFSDS, ) < 0)
-   err(1, "Can't kill %s", argv[1]);
+   err(1, "Can't kill %s", *argv);
 }
 
 static void
 usage(void)
 {
 
-   fprintf(stderr, "pnfsdsfile [filepath]\n");
+   fprintf(stderr, "pnfsdsfile [-f] mounted-on-DS-dir\n");
exit(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: r336175 - head/sys/i386/i386

2018-07-10 Thread Alan Cox
Author: alc
Date: Tue Jul 10 18:00:55 2018
New Revision: 336175
URL: https://svnweb.freebsd.org/changeset/base/336175

Log:
  Eliminate unnecessary differences between i386's pmap_enter() and amd64's.
  For example, fully construct the new PTE before entering the critical
  section.  This change is a stepping stone to psind == 1 support on i386.
  
  Reviewed by:  kib, markj
  Tested by:pho
  Differential Revision:https://reviews.freebsd.org/D16188

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Tue Jul 10 17:20:27 2018(r336174)
+++ head/sys/i386/i386/pmap.c   Tue Jul 10 18:00:55 2018(r336175)
@@ -3575,20 +3575,41 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
pv_entry_t pv;
vm_paddr_t opa, pa;
vm_page_t mpte, om;
-   boolean_t invlva, wired;
+   int rv;
 
va = trunc_page(va);
-   mpte = NULL;
-   wired = (flags & PMAP_ENTER_WIRED) != 0;
-
KASSERT((pmap == kernel_pmap && va < VM_MAX_KERNEL_ADDRESS) ||
(pmap != kernel_pmap && va < VM_MAXUSER_ADDRESS),
("pmap_enter: toobig k%d %#x", pmap == kernel_pmap, va));
KASSERT(va < PMAP_TRM_MIN_ADDRESS,
("pmap_enter: invalid to pmap_enter into trampoline (va: 0x%x)",
va));
+   KASSERT(pmap != kernel_pmap || (m->oflags & VPO_UNMANAGED) != 0 ||
+   va < kmi.clean_sva || va >= kmi.clean_eva,
+   ("pmap_enter: managed mapping within the clean submap"));
if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m))
VM_OBJECT_ASSERT_LOCKED(m->object);
+   KASSERT((flags & PMAP_ENTER_RESERVED) == 0,
+   ("pmap_enter: flags %u has reserved bits set", flags));
+   pa = VM_PAGE_TO_PHYS(m);
+   newpte = (pt_entry_t)(pa | PG_A | PG_V);
+   if ((flags & VM_PROT_WRITE) != 0)
+   newpte |= PG_M;
+   if ((prot & VM_PROT_WRITE) != 0)
+   newpte |= PG_RW;
+   KASSERT((newpte & (PG_M | PG_RW)) != PG_M,
+   ("pmap_enter: flags includes VM_PROT_WRITE but prot doesn't"));
+#if defined(PAE) || defined(PAE_TABLES)
+   if ((prot & VM_PROT_EXECUTE) == 0)
+   newpte |= pg_nx;
+#endif
+   if ((flags & PMAP_ENTER_WIRED) != 0)
+   newpte |= PG_W;
+   if (pmap != kernel_pmap)
+   newpte |= PG_U;
+   newpte |= pmap_cache_bits(m->md.pat_mode, psind > 0);
+   if ((m->oflags & VPO_UNMANAGED) == 0)
+   newpte |= PG_MANAGED;
 
rw_wlock(_global_lock);
PMAP_LOCK(pmap);
@@ -3606,10 +3627,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
if (mpte == NULL) {
KASSERT((flags & PMAP_ENTER_NOSLEEP) != 0,
("pmap_allocpte failed with sleep allowed"));
-   sched_unpin();
-   rw_wunlock(_global_lock);
-   PMAP_UNLOCK(pmap);
-   return (KERN_RESOURCE_SHORTAGE);
+   rv = KERN_RESOURCE_SHORTAGE;
+   goto out;
}
} else {
/*
@@ -3617,6 +3636,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
 * to install a page table page.  PG_V is also
 * asserted by pmap_demote_pde().
 */
+   mpte = NULL;
KASSERT(pde != NULL && (*pde & PG_V) != 0,
("KVA %#x invalid pde pdir %#jx", va,
(uintmax_t)pmap->pm_pdir[PTDPTDI]));
@@ -3635,55 +3655,64 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
(uintmax_t)pmap->pm_pdir[PTDPTDI], va);
}
 
-   pa = VM_PAGE_TO_PHYS(m);
origpte = *pte;
-   opa = origpte & PG_FRAME;
+   pv = NULL;
 
/*
-* Mapping has not changed, must be protection or wiring change.
+* Is the specified virtual address already mapped?
 */
-   if (origpte && (opa == pa)) {
+   if ((origpte & PG_V) != 0) {
/*
 * Wiring change, just update stats. We don't worry about
 * wiring PT pages as they remain resident as long as there
 * are valid mappings in them. Hence, if a user page is wired,
 * the PT page will be also.
 */
-   if (wired && ((origpte & PG_W) == 0))
+   if ((newpte & PG_W) != 0 && (origpte & PG_W) == 0)
pmap->pm_stats.wired_count++;
-   else if (!wired && (origpte & PG_W))
+   else if ((newpte & PG_W) == 0 && (origpte & PG_W) != 0)
pmap->pm_stats.wired_count--;
 
/*
-* Remove extra pte reference
+* Remove the extra PT page reference.
 */
-

svn commit: r336174 - head/usr.bin/top

2018-07-10 Thread Mark Johnston
Author: markj
Date: Tue Jul 10 17:20:27 2018
New Revision: 336174
URL: https://svnweb.freebsd.org/changeset/base/336174

Log:
  Fix thread state summary line display after r334918.

Modified:
  head/usr.bin/top/display.c

Modified: head/usr.bin/top/display.c
==
--- head/usr.bin/top/display.c  Tue Jul 10 17:01:19 2018(r336173)
+++ head/usr.bin/top/display.c  Tue Jul 10 17:20:27 2018(r336174)
@@ -347,12 +347,12 @@ i_procstates(int total, int *brkdn)
 procstates_buffer = setup_buffer(procstates_buffer, 0);
 
 /* write current number of processes and remember the value */
-printf("%d %s:", total, (ps.thread) ? "threads" :"processes");
+printf("%d %s:", total, ps.thread ? "threads" : "processes");
 ltotal = total;
 
 /* put out enough spaces to get to column 15 */
 i = digits(total);
-while (i++ < 4)
+while (i++ < (ps.thread ? 6 : 4))
 {
putchar(' ');
 }
@@ -389,10 +389,10 @@ else {
/* if number of digits differs, rewrite the label */
if (digits(total) != digits(ltotal))
{
-   fputs(" processes:", stdout);
+   printf(" %s:", ps.thread ? "threads" : "processes");
/* put out enough spaces to get to column 15 */
i = digits(total);
-   while (i++ < 4)
+   while (i++ < (ps.thread ? 6 : 4))
{
putchar(' ');
}
___
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: r336173 - head/sys/contrib/octeon-sdk

2018-07-10 Thread Justin Hibbits
Author: jhibbits
Date: Tue Jul 10 17:01:19 2018
New Revision: 336173
URL: https://svnweb.freebsd.org/changeset/base/336173

Log:
  Correct the identifier for the Unifi Security Gateway
  
  The USG is really E120, not E110.

Modified:
  head/sys/contrib/octeon-sdk/cvmx-app-init.h
  head/sys/contrib/octeon-sdk/cvmx-helper-board.c

Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h
==
--- head/sys/contrib/octeon-sdk/cvmx-app-init.h Tue Jul 10 14:04:52 2018
(r336172)
+++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Tue Jul 10 17:01:19 2018
(r336173)
@@ -311,7 +311,7 @@ enum cvmx_board_types_enum {
 #endif
 #if defined(OCTEON_VENDOR_UBIQUITI)
 CVMX_BOARD_TYPE_CUST_UBIQUITI_E100=20002,
-CVMX_BOARD_TYPE_CUST_UBIQUITI_E110= 20004,
+CVMX_BOARD_TYPE_CUST_UBIQUITI_E120= 20004,
 #endif
 #if defined(OCTEON_VENDOR_RADISYS)
 CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE=20002,
@@ -458,7 +458,7 @@ static inline const char *cvmx_board_type_to_string(en
 #endif
 #if defined(OCTEON_VENDOR_UBIQUITI)
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_UBIQUITI_E100)
-   ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_UBIQUITI_E110)
+   ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_UBIQUITI_E120)
 #endif
 #if defined(OCTEON_VENDOR_RADISYS)
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE)

Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c
==
--- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Tue Jul 10 14:04:52 
2018(r336172)
+++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Tue Jul 10 17:01:19 
2018(r336173)
@@ -598,7 +598,7 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
 #endif
 #if defined(OCTEON_VENDOR_UBIQUITI)
case CVMX_BOARD_TYPE_CUST_UBIQUITI_E100:
-   case CVMX_BOARD_TYPE_CUST_UBIQUITI_E110:
+   case CVMX_BOARD_TYPE_CUST_UBIQUITI_E120:
if (ipd_port > 2)
return -1;
return (7 - ipd_port);
@@ -1501,7 +1501,7 @@ int __cvmx_helper_board_hardware_enable(int interface)
 }
 #if defined(OCTEON_VENDOR_UBIQUITI)
 else if (cvmx_sysinfo_get()->board_type == 
CVMX_BOARD_TYPE_CUST_UBIQUITI_E100 ||
-cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_UBIQUITI_E110)
+cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_UBIQUITI_E120)
 {
/* Configure ASX cloks for all ports on interface 0.  */
if (interface == 0)
@@ -1592,7 +1592,7 @@ cvmx_helper_board_usb_clock_types_t __cvmx_helper_boar
 #endif
 #if defined(OCTEON_VENDOR_UBIQUITI)
 case CVMX_BOARD_TYPE_CUST_UBIQUITI_E100:
-case CVMX_BOARD_TYPE_CUST_UBIQUITI_E110:
+case CVMX_BOARD_TYPE_CUST_UBIQUITI_E120:
 #endif
 #if defined(OCTEON_BOARD_CAPK_0100ND)
case CVMX_BOARD_TYPE_CN3010_EVB_HS5:
___
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: r336172 - in head/sys: compat/freebsd32 kern sys

2018-07-10 Thread Brooks Davis
Author: brooks
Date: Tue Jul 10 14:04:52 2018
New Revision: 336172
URL: https://svnweb.freebsd.org/changeset/base/336172

Log:
  Regen after r336171.

Modified:
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Tue Jul 10 13:32:04 
2018(r336171)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Tue Jul 10 14:04:52 
2018(r336172)
@@ -226,9 +226,9 @@
 #defineFREEBSD32_SYS_freebsd32_lio_listio  257
 #defineFREEBSD32_SYS_freebsd11_freebsd32_getdents  272
 #defineFREEBSD32_SYS_lchmod274
-#defineFREEBSD32_SYS_netbsd_lchown 275
+   /* 275 is obsolete netbsd_lchown */
 #defineFREEBSD32_SYS_freebsd32_lutimes 276
-#defineFREEBSD32_SYS_netbsd_msync  277
+   /* 277 is obsolete netbsd_msync */
 #defineFREEBSD32_SYS_freebsd11_nstat   278
 #defineFREEBSD32_SYS_freebsd11_nfstat  279
 #defineFREEBSD32_SYS_freebsd11_nlstat  280

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- head/sys/compat/freebsd32/freebsd32_syscalls.c  Tue Jul 10 13:32:04 
2018(r336171)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c  Tue Jul 10 14:04:52 
2018(r336172)
@@ -284,9 +284,9 @@ const char *freebsd32_syscallnames[] = {
"compat11.freebsd32_getdents",  /* 272 = freebsd11 
freebsd32_getdents */
"#273", /* 273 = nosys */
"lchmod",   /* 274 = lchmod */
-   "netbsd_lchown",/* 275 = netbsd_lchown */
+   "obs_netbsd_lchown",/* 275 = obsolete netbsd_lchown 
*/
"freebsd32_lutimes",/* 276 = freebsd32_lutimes */
-   "netbsd_msync", /* 277 = netbsd_msync */
+   "obs_netbsd_msync", /* 277 = obsolete netbsd_msync 
*/
"compat11.nstat",   /* 278 = freebsd11 nstat */
"compat11.nfstat",  /* 279 = freebsd11 nfstat */
"compat11.nlstat",  /* 280 = freebsd11 nlstat */

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==
--- head/sys/compat/freebsd32/freebsd32_sysent.cTue Jul 10 13:32:04 
2018(r336171)
+++ head/sys/compat/freebsd32/freebsd32_sysent.cTue Jul 10 14:04:52 
2018(r336172)
@@ -331,9 +331,9 @@ struct sysent freebsd32_sysent[] = {
{ compat11(AS(freebsd11_freebsd32_getdents_args),freebsd32_getdents), 
AUE_O_GETDENTS, NULL, 0, 0, 0, SY_THR_STATIC },   /* 272 = freebsd11 
freebsd32_getdents */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },  
/* 273 = nosys */
{ AS(lchmod_args), (sy_call_t *)sys_lchmod, AUE_LCHMOD, NULL, 0, 0, 0, 
SY_THR_STATIC }, /* 274 = lchmod */
-   { AS(lchown_args), (sy_call_t *)sys_lchown, AUE_LCHOWN, NULL, 0, 0, 0, 
SY_THR_STATIC }, /* 275 = netbsd_lchown */
+   { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },  
/* 275 = obsolete netbsd_lchown */
{ AS(freebsd32_lutimes_args), (sy_call_t *)freebsd32_lutimes, 
AUE_LUTIMES, NULL, 0, 0, 0, SY_THR_STATIC },  /* 276 = freebsd32_lutimes */
-   { AS(msync_args), (sy_call_t *)sys_msync, AUE_MSYNC, NULL, 0, 0, 
SYF_CAPENABLED, SY_THR_STATIC },   /* 277 = netbsd_msync */
+   { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },  
/* 277 = obsolete netbsd_msync */
{ compat11(AS(freebsd11_nstat_args),nstat), AUE_STAT, NULL, 0, 0, 0, 
SY_THR_STATIC },   /* 278 = freebsd11 nstat */
{ compat11(AS(freebsd11_nfstat_args),nfstat), AUE_FSTAT, NULL, 0, 0, 0, 
SY_THR_STATIC },/* 279 = freebsd11 nfstat */
{ compat11(AS(freebsd11_nlstat_args),nlstat), AUE_LSTAT, NULL, 0, 0, 0, 
SY_THR_STATIC },/* 280 = freebsd11 nlstat */

Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c
==
--- head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Jul 10 13:32:04 
2018(r336171)
+++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Jul 10 14:04:52 
2018(r336172)
@@ -1292,15 +1292,6 @@ systrace_args(int sysnum, void *params, uint64_t *uarg
*n_args = 2;
break;
}
- 

svn commit: r336171 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern

2018-07-10 Thread Brooks Davis
Author: brooks
Date: Tue Jul 10 13:32:04 2018
New Revision: 336171
URL: https://svnweb.freebsd.org/changeset/base/336171

Log:
  Get rid of netbsd_lchown and netbsd_msync syscall entries.
  
  No valid FreeBSD binary very called them (they would call lchown and
  msync directly) and we haven't supported NetBSD binaries in ages.
  
  This is a respin of r335983 with a workaround for the ancient BFD linker
  in the libc stubs.
  
  Reviewed by:  kib
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D16193

Added:
  head/lib/libc/sys/compat-stub.c   (contents, props changed)
Modified:
  head/lib/libc/sys/Makefile.inc
  head/lib/libc/sys/Symbol.map
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/syscalls.master

Modified: head/lib/libc/sys/Makefile.inc
==
--- head/lib/libc/sys/Makefile.inc  Tue Jul 10 13:03:06 2018
(r336170)
+++ head/lib/libc/sys/Makefile.inc  Tue Jul 10 13:32:04 2018
(r336171)
@@ -48,6 +48,8 @@ SRCS+= brk.c
 SRCS+= pipe.c
 SRCS+= vadvise.c
 
+SRCS+= compat-stub.c
+
 INTERPOSED = \
accept \
accept4 \

Modified: head/lib/libc/sys/Symbol.map
==
--- head/lib/libc/sys/Symbol.mapTue Jul 10 13:03:06 2018
(r336170)
+++ head/lib/libc/sys/Symbol.mapTue Jul 10 13:32:04 2018
(r336171)
@@ -179,8 +179,6 @@ FBSD_1.0 {
munlockall;
munmap;
nanosleep;
-   netbsd_lchown;
-   netbsd_msync;
nfssvc;
nmount;
ntp_adjtime;
@@ -777,10 +775,6 @@ FBSDprivate_1.0 {
__sys_munmap;
_nanosleep;
__sys_nanosleep;
-   _netbsd_lchown;
-   __sys_netbsd_lchown;
-   _netbsd_msync;
-   __sys_netbsd_msync;
_nfssvc;
__sys_nfssvc;
_nmount;

Added: head/lib/libc/sys/compat-stub.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/sys/compat-stub.c Tue Jul 10 13:32:04 2018
(r336171)
@@ -0,0 +1,56 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2018 SRI International
+ * All rights reserved.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory (Department of Computer Science and
+ * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
+ * DARPA SSITH research programme.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+#include 
+#include 
+
+/*
+ * XXX: Ideally we'd use a common function rather than generating one
+ * for each compat symbol, but the bfd linker in base rejects that.
+ * This should be revisited once we're using only modern linkers.
+ */
+#define __compat_nosys(symbol, version)\
+int __compat_enosys ## symbol(void);   \
+int\
+__compat_enosys ## symbol(void)\
+{  \
+   \
+   return (ENOSYS);\
+}  \
+__sym_compat(symbol, __compat_enosys ## symbol, version)
+
+__compat_nosys(netbsd_lchown, FBSD_1.0);
+__compat_nosys(netbsd_msync, FBSD_1.0);

Modified: head/sys/compat/freebsd32/syscalls.master

svn commit: r336170 - in head: sys/kern sys/netinet usr.bin/netstat usr.sbin/tcpdrop

2018-07-10 Thread Brooks Davis
Author: brooks
Date: Tue Jul 10 13:03:06 2018
New Revision: 336170
URL: https://svnweb.freebsd.org/changeset/base/336170

Log:
  Use uintptr_t alone when assigning to kvaddr_t variables.
  
  Suggested by: jhb

Modified:
  head/sys/kern/kern_descrip.c
  head/sys/kern/uipc_socket.c
  head/sys/kern/uipc_usrreq.c
  head/sys/netinet/in_pcb.c
  head/sys/netinet/sctp_sysctl.c
  head/usr.bin/netstat/inet.c
  head/usr.bin/netstat/unix.c
  head/usr.sbin/tcpdrop/tcpdrop.c

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cTue Jul 10 11:33:37 2018
(r336169)
+++ head/sys/kern/kern_descrip.cTue Jul 10 13:03:06 2018
(r336170)
@@ -3362,10 +3362,10 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS)
if ((fp = fdp->fd_ofiles[n].fde_file) == NULL)
continue;
xf.xf_fd = n;
-   xf.xf_file = (kvaddr_t)(uintptr_t)fp;
-   xf.xf_data = (kvaddr_t)(uintptr_t)fp->f_data;
-   xf.xf_vnode = (kvaddr_t)(uintptr_t)fp->f_vnode;
-   xf.xf_type = (kvaddr_t)(uintptr_t)fp->f_type;
+   xf.xf_file = (uintptr_t)fp;
+   xf.xf_data = (uintptr_t)fp->f_data;
+   xf.xf_vnode = (uintptr_t)fp->f_vnode;
+   xf.xf_type = (uintptr_t)fp->f_type;
xf.xf_count = fp->f_count;
xf.xf_msgcount = 0;
xf.xf_offset = foffset_get(fp);

Modified: head/sys/kern/uipc_socket.c
==
--- head/sys/kern/uipc_socket.c Tue Jul 10 11:33:37 2018(r336169)
+++ head/sys/kern/uipc_socket.c Tue Jul 10 13:03:06 2018(r336170)
@@ -3985,12 +3985,12 @@ sotoxsocket(struct socket *so, struct xsocket *xso)
 {
 
xso->xso_len = sizeof *xso;
-   xso->xso_so = (kvaddr_t)(uintptr_t)so;
+   xso->xso_so = (uintptr_t)so;
xso->so_type = so->so_type;
xso->so_options = so->so_options;
xso->so_linger = so->so_linger;
xso->so_state = so->so_state;
-   xso->so_pcb = (kvaddr_t)(uintptr_t)so->so_pcb;
+   xso->so_pcb = (uintptr_t)so->so_pcb;
xso->xso_protocol = so->so_proto->pr_protocol;
xso->xso_family = so->so_proto->pr_domain->dom_family;
xso->so_timeo = so->so_timeo;

Modified: head/sys/kern/uipc_usrreq.c
==
--- head/sys/kern/uipc_usrreq.c Tue Jul 10 11:33:37 2018(r336169)
+++ head/sys/kern/uipc_usrreq.c Tue Jul 10 13:03:06 2018(r336170)
@@ -1853,7 +1853,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS)
 
if (freeunp == 0 && unp->unp_gencnt <= gencnt) {
xu->xu_len = sizeof *xu;
-   xu->xu_unpp = (kvaddr_t)(uintptr_t)unp;
+   xu->xu_unpp = (uintptr_t)unp;
/*
 * XXX - need more locking here to protect against
 * connect/disconnect races for SMP.
@@ -1870,12 +1870,10 @@ unp_pcblist(SYSCTL_HANDLER_ARGS)
  unp->unp_conn->unp_addr->sun_len);
else
bzero(>xu_caddr, sizeof(xu->xu_caddr));
-   xu->unp_vnode = (kvaddr_t)(uintptr_t)unp->unp_vnode;
-   xu->unp_conn = (kvaddr_t)(uintptr_t)unp->unp_conn;
-   xu->xu_firstref =
-   (kvaddr_t)(uintptr_t)LIST_FIRST(>unp_refs);
-   xu->xu_nextref =
-   (kvaddr_t)(uintptr_t)LIST_NEXT(unp, unp_reflink);
+   xu->unp_vnode = (uintptr_t)unp->unp_vnode;
+   xu->unp_conn = (uintptr_t)unp->unp_conn;
+   xu->xu_firstref = (uintptr_t)LIST_FIRST(>unp_refs);
+   xu->xu_nextref = (uintptr_t)LIST_NEXT(unp, unp_reflink);
xu->unp_gencnt = unp->unp_gencnt;
sotoxsocket(unp->unp_socket, >xu_socket);
UNP_PCB_UNLOCK(unp);

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Tue Jul 10 11:33:37 2018(r336169)
+++ head/sys/netinet/in_pcb.c   Tue Jul 10 13:03:06 2018(r336170)
@@ -2906,7 +2906,7 @@ in_pcbtoxinpcb(const struct inpcb *inp, struct xinpcb 
bzero(>xi_socket, sizeof(struct xsocket));
bcopy(>inp_inc, >inp_inc, sizeof(struct in_conninfo));
xi->inp_gencnt = inp->inp_gencnt;
-   xi->inp_ppcb = (kvaddr_t)(uintptr_t)inp->inp_ppcb;
+   xi->inp_ppcb = (uintptr_t)inp->inp_ppcb;
xi->inp_flow = inp->inp_flow;
xi->inp_flowid = inp->inp_flowid;

svn commit: r336169 - head/share/mk

2018-07-10 Thread Renato Botelho
Author: garga (ports committer)
Date: Tue Jul 10 11:33:37 2018
New Revision: 336169
URL: https://svnweb.freebsd.org/changeset/base/336169

Log:
  A direct call to echo was intruduced in r333407, which made messages
  to be displayed when make is called with -s.  Replace it by ${ECHO}.
  
  Reviewed by:  brd, bdrewery
  Approved by:  brd, bdrewery
  Sponsored by: Rubicon Communications, LLC (Netgate)
  Differential Revision:https://reviews.freebsd.org/D16195

Modified:
  head/share/mk/bsd.files.mk

Modified: head/share/mk/bsd.files.mk
==
--- head/share/mk/bsd.files.mk  Tue Jul 10 10:50:43 2018(r336168)
+++ head/share/mk/bsd.files.mk  Tue Jul 10 11:33:37 2018(r336169)
@@ -80,7 +80,7 @@ _${group}FILES+= ${file}
 
 
 installdirs-${group}:
-   @echo installing dirs ${group}DIR ${${group}DIR}
+   @${ECHO} installing dirs ${group}DIR ${${group}DIR}
 .for dir in ${${group}DIR}
 .if defined(NO_ROOT)
${INSTALL} ${${group}TAG_ARGS} -d ${DESTDIR}${dir}
___
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: r336168 - head/sys/netinet

2018-07-10 Thread Michael Tuexen
Author: tuexen
Date: Tue Jul 10 10:50:43 2018
New Revision: 336168
URL: https://svnweb.freebsd.org/changeset/base/336168

Log:
  Add support for printing the TCP FO client-side cookie cache via the
  sysctl interface. This is similar to the TCP host cache.
  
  Reviewed by:  pkelsey@, kbowling@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D14554

Modified:
  head/sys/netinet/tcp_fastopen.c

Modified: head/sys/netinet/tcp_fastopen.c
==
--- head/sys/netinet/tcp_fastopen.c Tue Jul 10 10:42:48 2018
(r336167)
+++ head/sys/netinet/tcp_fastopen.c Tue Jul 10 10:50:43 2018
(r336168)
@@ -81,6 +81,9 @@
  *  (RDTUN, default 
TCP_FASTOPEN_CCACHE_BUCKETS_DEFAULT)
  * The number of client cookie cache buckets.
  *
+ * net.inet.tcp.fastopen.ccache_list (RO)
+ * Print the client cookie cache.
+ *
  * net.inet.tcp.fastopen.client_enable (RW, default 0)
  * When zero, no new active (i.e., client) TFO connections can be
  * created.  On the transition from enabled to disabled, the client
@@ -166,11 +169,14 @@ __FBSDID("$FreeBSD$");
 #include "opt_inet.h"
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -343,6 +349,12 @@ SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, setpsk,
 _net_inet_tcp_fastopen_setpsk, "",
 "Install a new pre-shared key");
 
+static int sysctl_net_inet_tcp_fastopen_ccache_list(SYSCTL_HANDLER_ARGS);
+SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, ccache_list,
+CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP, NULL, 0,
+sysctl_net_inet_tcp_fastopen_ccache_list, "A",
+"List of all client cookie cache entries");
+
 static VNET_DEFINE(struct rmlock, tcp_fastopen_keylock);
 #defineV_tcp_fastopen_keylock  VNET(tcp_fastopen_keylock)
 
@@ -1133,5 +1145,81 @@ tcp_fastopen_ccache_entry_drop(struct tcp_fastopen_cca
TAILQ_REMOVE(>ccb_entries, cce, cce_link);
ccb->ccb_num_entries--;
uma_zfree(V_tcp_fastopen_ccache.zone, cce);
+}
+
+static int
+sysctl_net_inet_tcp_fastopen_ccache_list(SYSCTL_HANDLER_ARGS)
+{
+   struct sbuf sb;
+   struct tcp_fastopen_ccache_bucket *ccb;
+   struct tcp_fastopen_ccache_entry *cce;
+   sbintime_t now, duration, limit;
+   const int linesize = 128;
+   int i, error, num_entries;
+   unsigned int j;
+#ifdef INET6
+   char clt_buf[INET6_ADDRSTRLEN], srv_buf[INET6_ADDRSTRLEN];
+#else
+   char clt_buf[INET_ADDRSTRLEN], srv_buf[INET_ADDRSTRLEN];
+#endif
+
+   if (jailed_without_vnet(curthread->td_ucred) != 0)
+   return (EPERM);
+
+   /* Only allow root to read the client cookie cache */
+   if (curthread->td_ucred->cr_uid != 0)
+   return (EPERM);
+
+   num_entries = 0;
+   for (i = 0; i < V_tcp_fastopen_ccache.buckets; i++) {
+   ccb = _tcp_fastopen_ccache.base[i];
+   CCB_LOCK(ccb);
+   if (ccb->ccb_num_entries > 0)
+   num_entries += ccb->ccb_num_entries;
+   CCB_UNLOCK(ccb);
+   }
+   sbuf_new(, NULL, linesize * (num_entries + 1), SBUF_INCLUDENUL);
+
+   sbuf_printf(,
+   "\nLocal IP address Remote IP address Port   MSS"
+   " Disabled Cookie\n");
+
+   now = getsbinuptime();
+   limit = (sbintime_t)V_tcp_fastopen_path_disable_time << 32;
+   for (i = 0; i < V_tcp_fastopen_ccache.buckets; i++) {
+   ccb = _tcp_fastopen_ccache.base[i];
+   CCB_LOCK(ccb);
+   TAILQ_FOREACH(cce, >ccb_entries, cce_link) {
+   if (cce->disable_time != 0) {
+   duration = now - cce->disable_time;
+   if (limit >= duration)
+   duration = limit - duration;
+   else
+   duration = 0;
+   } else
+   duration = 0;
+   sbuf_printf(,
+   "%-20s %-20s %5u %5u ",
+   inet_ntop(cce->af, >cce_client_ip,
+   clt_buf, sizeof(clt_buf)),
+   inet_ntop(cce->af, >cce_server_ip,
+   srv_buf, sizeof(srv_buf)),
+   ntohs(cce->server_port),
+   cce->server_mss);
+   if (duration > 0)
+   sbuf_printf(, "%7ds ", 
sbintime_getsec(duration));
+   else
+   sbuf_printf(, "%8s ", "No");
+   for (j = 0; j < cce->cookie_len; j++)
+   sbuf_printf(, 

svn commit: r336167 - in head/sys/netinet: . tcp_stacks

2018-07-10 Thread Michael Tuexen
Author: tuexen
Date: Tue Jul 10 10:42:48 2018
New Revision: 336167
URL: https://svnweb.freebsd.org/changeset/base/336167

Log:
  Use appropriate MSS value when populating the TCP FO client cookie cache
  
  When a client receives a SYN-ACK segment with a TFP fast open cookie,
  but without an MSS option, an MSS value from uninitialised stack memory is 
used.
  This patch ensures that in case no MSS option is included in the SYN-ACK,
  the appropriate value as given in RFC 7413 is used.
  
  Reviewed by:  kbowling@
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D16175

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_stacks/fastpath.c
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cTue Jul 10 09:49:27 2018
(r336166)
+++ head/sys/netinet/tcp_input.cTue Jul 10 10:42:48 2018
(r336167)
@@ -1674,10 +1674,19 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
(to.to_flags & TOF_SACKPERM) == 0)
tp->t_flags &= ~TF_SACK_PERMIT;
if (IS_FASTOPEN(tp->t_flags)) {
-   if (to.to_flags & TOF_FASTOPEN)
-   tcp_fastopen_update_cache(tp, to.to_mss,
+   if (to.to_flags & TOF_FASTOPEN) {
+   uint16_t mss;
+
+   if (to.to_flags & TOF_MSS)
+   mss = to.to_mss;
+   else
+   if ((tp->t_inpcb->inp_vflag & INP_IPV6) 
!= 0)
+   mss = TCP6_MSS;
+   else
+   mss = TCP_MSS;
+   tcp_fastopen_update_cache(tp, mss,
to.to_tfo_len, to.to_tfo_cookie);
-   else
+   } else
tcp_fastopen_disable_path(tp);
}
}

Modified: head/sys/netinet/tcp_stacks/fastpath.c
==
--- head/sys/netinet/tcp_stacks/fastpath.c  Tue Jul 10 09:49:27 2018
(r336166)
+++ head/sys/netinet/tcp_stacks/fastpath.c  Tue Jul 10 10:42:48 2018
(r336167)
@@ -1763,10 +1763,19 @@ tcp_do_segment_fastslow(struct mbuf *m, struct tcphdr 
(to.to_flags & TOF_SACKPERM) == 0)
tp->t_flags &= ~TF_SACK_PERMIT;
if (IS_FASTOPEN(tp->t_flags)) {
-   if (to.to_flags & TOF_FASTOPEN)
-   tcp_fastopen_update_cache(tp, to.to_mss,
+   if (to.to_flags & TOF_FASTOPEN) {
+   uint16_t mss;
+
+   if (to.to_flags & TOF_MSS)
+   mss = to.to_mss;
+   else
+   if ((tp->t_inpcb->inp_vflag & INP_IPV6) 
!= 0)
+   mss = TCP6_MSS;
+   else
+   mss = TCP_MSS;
+   tcp_fastopen_update_cache(tp, mss,
to.to_tfo_len, to.to_tfo_cookie);
-   else
+   } else
tcp_fastopen_disable_path(tp);
}
}
@@ -2220,10 +2229,19 @@ tcp_do_segment_fastack(struct mbuf *m, struct tcphdr *
(to.to_flags & TOF_SACKPERM) == 0)
tp->t_flags &= ~TF_SACK_PERMIT;
if (IS_FASTOPEN(tp->t_flags)) {
-   if (to.to_flags & TOF_FASTOPEN)
-   tcp_fastopen_update_cache(tp, to.to_mss,
+   if (to.to_flags & TOF_FASTOPEN) {
+   uint16_t mss;
+
+   if (to.to_flags & TOF_MSS)
+   mss = to.to_mss;
+   else
+   if ((tp->t_inpcb->inp_vflag & INP_IPV6) 
!= 0)
+   mss = TCP6_MSS;
+   else
+   mss = TCP_MSS;
+   tcp_fastopen_update_cache(tp, mss,
to.to_tfo_len, to.to_tfo_cookie);
-   else
+   } else
tcp_fastopen_disable_path(tp);
}
}

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- 

svn commit: r336166 - head/sys/dev/pci

2018-07-10 Thread Wojciech Macek
Author: wma
Date: Tue Jul 10 09:49:27 2018
New Revision: 336166
URL: https://svnweb.freebsd.org/changeset/base/336166

Log:
  Fix build broken by r336130
  
  Add ifdef's to compile parts of pci_host_generic only on armv8

Modified:
  head/sys/dev/pci/pci_host_generic.c

Modified: head/sys/dev/pci/pci_host_generic.c
==
--- head/sys/dev/pci/pci_host_generic.c Tue Jul 10 08:05:32 2018
(r336165)
+++ head/sys/dev/pci/pci_host_generic.c Tue Jul 10 09:49:27 2018
(r336166)
@@ -99,6 +99,8 @@ static int generic_pcie_read_ivar(device_t dev, device
 uintptr_t *result);
 static int generic_pcie_write_ivar(device_t dev, device_t child, int index,
 uintptr_t value);
+
+#if defined(__aarch64__)
 static void pci_host_generic_apply_quirks(device_t);
 static void thunderx2_ahci_bar_quirk(device_t);
 
@@ -114,6 +116,7 @@ struct pci_host_generic_block_entry pci_host_generic_b
{CPU_IMPL_CAVIUM, CPU_PART_THUNDERX2, 0, 0, 0x80, 0x10},
{0, 0, 0, 0, 0, 0}
 };
+#endif
 
 int
 pci_host_generic_core_attach(device_t dev)
@@ -168,11 +171,14 @@ pci_host_generic_core_attach(device_t dev)
return (error);
}
 
+#if defined(__aarch64__)
pci_host_generic_apply_quirks(dev);
+#endif
 
return (0);
 }
 
+#if defined(__aarch64__)
 static void
 pci_host_generic_apply_quirks(device_t dev)
 {
@@ -191,6 +197,7 @@ pci_host_generic_apply_quirks(device_t dev)
quirk++;
}
 }
+#endif
 
 static uint32_t
 generic_pcie_read_config(device_t dev, u_int bus, u_int slot,
@@ -201,12 +208,15 @@ generic_pcie_read_config(device_t dev, u_int bus, u_in
bus_space_tag_t t;
uint64_t offset;
uint32_t data;
+#if defined(__aarch64__)
struct pci_host_generic_block_entry *block;
+#endif
 
if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) ||
(func > PCI_FUNCMAX) || (reg > PCIE_REGMAX))
return (~0U);
 
+#if defined(__aarch64__)
block = pci_host_generic_blocked;
while (1) {
if (block->impl == 0)
@@ -219,6 +229,7 @@ generic_pcie_read_config(device_t dev, u_int bus, u_in
 
block++;
}
+#endif
 
sc = device_get_softc(dev);
 
@@ -462,6 +473,7 @@ static device_method_t generic_pcie_methods[] = {
 DEFINE_CLASS_0(pcib, generic_pcie_core_driver,
 generic_pcie_methods, sizeof(struct generic_pcie_core_softc));
 
+#if defined(__aarch64__)
 static void thunderx2_ahci_bar_quirk(device_t dev)
 {
 
@@ -478,3 +490,4 @@ static void thunderx2_ahci_bar_quirk(device_t dev)
PCIB_WRITE_CONFIG(dev, 0, 16, 1, 0x1c, 0x40, 4);
}
 }
+#endif
___
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: r336165 - head/sys/netinet

2018-07-10 Thread Steven Hartland
Author: smh
Date: Tue Jul 10 08:05:32 2018
New Revision: 336165
URL: https://svnweb.freebsd.org/changeset/base/336165

Log:
  Removed pointless NULL check
  
  Removed pointless NULL check after malloc with M_WAITOK which can never
  return NULL.
  
  Sponsored by: Multiplay

Modified:
  head/sys/netinet/raw_ip.c

Modified: head/sys/netinet/raw_ip.c
==
--- head/sys/netinet/raw_ip.c   Tue Jul 10 07:29:51 2018(r336164)
+++ head/sys/netinet/raw_ip.c   Tue Jul 10 08:05:32 2018(r336165)
@@ -1069,8 +1069,6 @@ rip_pcblist(SYSCTL_HANDLER_ARGS)
return (error);
 
inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK);
-   if (inp_list == NULL)
-   return (ENOMEM);
 
INP_INFO_RLOCK_ET(_ripcbinfo, et);
for (inp = CK_LIST_FIRST(V_ripcbinfo.ipi_listhead), i = 0; inp && i < n;
___
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: r335856 - in head/sys: netinet sys

2018-07-10 Thread Steven Hartland
Sorry guys I didn't spot it was just a revert as it was tagged on to the 
end of the description, I would have expected that to be in the subject.


What do others think, is there an recommend style for revert commit 
messages?


    Regards
    Steve

On 02/07/2018 17:30, Rodney W. Grimes wrote:

[ Charset UTF-8 unsupported, converting... ]

On Mon, Jul 2, 2018 at 10:44 AM Steven Hartland <
steven.hartl...@multiplay.co.uk> wrote:

You have M_WAITOK and a null check in this change

And, that's the same as the way it was before his commits. So, he did
exactly what he said he was doing and reverted his commits. I don't think
it is good practice to mix reverts with other changes.

It is a very bad practive to mix a revert with anything.


Since you've noticed this, I think you should feel free to make the change.
Jonathan


___
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: r336164 - stable/11/sbin/pfctl

2018-07-10 Thread Kristof Provost
Author: kp
Date: Tue Jul 10 07:29:51 2018
New Revision: 336164
URL: https://svnweb.freebsd.org/changeset/base/336164

Log:
  MFC r335886:
  
  pfctl: Don't retrieve interface list if '-n' is set
  
  If '-n' is set we don't use the list of skip interfaces, so don't retrieve it.
  This fixes issues if 'pfctl -n' is used before the pf module is loaded. This
  was broken by r333181.
  
  Reported by:  Jakub Chromy 

Modified:
  stable/11/sbin/pfctl/pfctl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/pfctl/pfctl.c
==
--- stable/11/sbin/pfctl/pfctl.cTue Jul 10 06:09:25 2018
(r336163)
+++ stable/11/sbin/pfctl/pfctl.cTue Jul 10 07:29:51 2018
(r336164)
@@ -2407,7 +2407,7 @@ main(int argc, char *argv[])
}
 
if ((rulesopt != NULL) && (loadopt & PFCTL_FLAG_OPTION) &&
-   !anchorname[0])
+   !anchorname[0] && !(opts & PF_OPT_NOACTION))
if (pfctl_get_skip_ifaces())
error = 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: r336163 - head/sys/dev/cxgbe

2018-07-10 Thread Navdeep Parhar
Author: np
Date: Tue Jul 10 06:09:25 2018
New Revision: 336163
URL: https://svnweb.freebsd.org/changeset/base/336163

Log:
  Fix vertical whitespace nit in cxgbe.

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

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cTue Jul 10 05:36:32 2018
(r336162)
+++ head/sys/dev/cxgbe/t4_main.cTue Jul 10 06:09:25 2018
(r336163)
@@ -8692,7 +8692,6 @@ sysctl_cpus(SYSCTL_HANDLER_ARGS)
sbuf_delete(sb);
 
return (rc);
-
 }
 
 #ifdef TCP_OFFLOAD
___
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"