svn commit: r323082 - head/sys/dev/cxgbe/iw_cxgbe

2017-08-31 Thread Navdeep Parhar
Author: np
Date: Fri Sep  1 01:34:12 2017
New Revision: 323082
URL: https://svnweb.freebsd.org/changeset/base/323082

Log:
  cxgbe/iw_cxgbe: Set TCP_NODELAY before initiating connection so that
  t4_tom picks it up right away.  This is less work than waiting for
  the connection to be established before applying the setting.
  
  MFC after:2 weeks
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/iw_cxgbe/cm.c

Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c
==
--- head/sys/dev/cxgbe/iw_cxgbe/cm.cFri Sep  1 00:16:03 2017
(r323081)
+++ head/sys/dev/cxgbe/iw_cxgbe/cm.cFri Sep  1 01:34:12 2017
(r323082)
@@ -108,6 +108,7 @@ static void process_peer_close(struct c4iw_ep *ep);
 static void process_conn_error(struct c4iw_ep *ep);
 static void process_close_complete(struct c4iw_ep *ep);
 static void ep_timeout(unsigned long arg);
+static void setiwsockopt(struct socket *so);
 static void init_iwarp_socket(struct socket *so, void *arg);
 static void uninit_iwarp_socket(struct socket *so);
 static void process_data(struct c4iw_ep *ep);
@@ -616,16 +617,12 @@ process_close_complete(struct c4iw_ep *ep)
 }
 
 static void
-init_iwarp_socket(struct socket *so, void *arg)
+setiwsockopt(struct socket *so)
 {
int rc;
struct sockopt sopt;
int on = 1;
 
-   SOCKBUF_LOCK(>so_rcv);
-   soupcall_set(so, SO_RCV, c4iw_so_upcall, arg);
-   so->so_state |= SS_NBIO;
-   SOCKBUF_UNLOCK(>so_rcv);
sopt.sopt_dir = SOPT_SET;
sopt.sopt_level = IPPROTO_TCP;
sopt.sopt_name = TCP_NODELAY;
@@ -640,6 +637,16 @@ init_iwarp_socket(struct socket *so, void *arg)
 }
 
 static void
+init_iwarp_socket(struct socket *so, void *arg)
+{
+
+   SOCKBUF_LOCK(>so_rcv);
+   soupcall_set(so, SO_RCV, c4iw_so_upcall, arg);
+   so->so_state |= SS_NBIO;
+   SOCKBUF_UNLOCK(>so_rcv);
+}
+
+static void
 uninit_iwarp_socket(struct socket *so)
 {
 
@@ -734,6 +741,7 @@ process_newconn(struct iw_cm_id *parent_cm_id, struct 
free(local, M_SONAME);
free(remote, M_SONAME);
 
+   setiwsockopt(child_so);
init_iwarp_socket(child_so, _ep->com);
c4iw_get_ep(_ep->com);
init_timer(_ep->timer);
@@ -2235,6 +2243,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_
}
fib4_free_nh_ext(RT_DEFAULT_FIB, );
 
+   setiwsockopt(cm_id->so);
state_set(>com, CONNECTING);
ep->tos = 0;
ep->com.local_addr = cm_id->local_addr;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323078 - head/sys/dev/cxgbe/tom

2017-08-31 Thread Navdeep Parhar
Author: np
Date: Thu Aug 31 23:34:08 2017
New Revision: 323078
URL: https://svnweb.freebsd.org/changeset/base/323078

Log:
  cxgbe/t4_tom: There may not be a tid to update if the connection isn't
  established.
  
  MFC after:2 weeks
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/tom/t4_tom.c

Modified: head/sys/dev/cxgbe/tom/t4_tom.c
==
--- head/sys/dev/cxgbe/tom/t4_tom.c Thu Aug 31 23:19:18 2017
(r323077)
+++ head/sys/dev/cxgbe/tom/t4_tom.c Thu Aug 31 23:34:08 2017
(r323078)
@@ -384,6 +384,8 @@ t4_ctloutput(struct toedev *tod, struct tcpcb *tp, int
 
switch (name) {
case TCP_NODELAY:
+   if (tp->t_state != TCPS_ESTABLISHED)
+   break;
t4_set_tcb_field(sc, toep->ctrlq, toep->tid, W_TCB_T_FLAGS,
V_TF_NAGLE(1), V_TF_NAGLE(tp->t_flags & TF_NODELAY ? 0 : 1),
0, 0, toep->ofld_rxq->iq.abs_id);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323077 - head/sys/net

2017-08-31 Thread Gleb Smirnoff
Author: glebius
Date: Thu Aug 31 23:19:18 2017
New Revision: 323077
URL: https://svnweb.freebsd.org/changeset/base/323077

Log:
  Do not abuse flag that is clearly marked as unused.
  This creates conflicts with FreeBSD variations that may use it.  The
  usage of the flag M_TOOBIG is limited to iflib queue, thus using
  one of M_PROTO flags is fine.  There is no need to grab global flag.
  
  Silence from: kmacy, sbruno (2 weeks)

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Aug 31 22:47:04 2017(r323076)
+++ head/sys/net/iflib.cThu Aug 31 23:19:18 2017(r323077)
@@ -267,7 +267,7 @@ iflib_get_sctx(if_ctx_t ctx)
 #define RX_SW_DESC_INUSE(1 << 3)
 #define TX_SW_DESC_MAPPED   (1 << 4)
 
-#defineM_TOOBIGM_UNUSED_8
+#defineM_TOOBIGM_PROTO1
 
 typedef struct iflib_sw_rx_desc_array {
bus_dmamap_t*ifsd_map; /* bus_dma maps for packet */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323076 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon...

2017-08-31 Thread Jung-uk Kim
Author: jkim
Date: Thu Aug 31 22:47:04 2017
New Revision: 323076
URL: https://svnweb.freebsd.org/changeset/base/323076

Log:
  Merge ACPICA 20170831.

Added:
  head/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c
 - copied, changed from r323060, 
vendor-sys/acpica/dist/source/components/utilities/utstrsuppt.c
Modified:
  head/sys/conf/files
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/common/dmtbinfo.c
  head/sys/contrib/dev/acpica/compiler/aslcompiler.h
  head/sys/contrib/dev/acpica/compiler/aslcompiler.l
  head/sys/contrib/dev/acpica/compiler/asldebug.c
  head/sys/contrib/dev/acpica/compiler/aslerror.c
  head/sys/contrib/dev/acpica/compiler/aslhelp.c
  head/sys/contrib/dev/acpica/compiler/aslmain.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.h
  head/sys/contrib/dev/acpica/compiler/aslresource.c
  head/sys/contrib/dev/acpica/compiler/aslrules.y
  head/sys/contrib/dev/acpica/compiler/asltree.c
  head/sys/contrib/dev/acpica/compiler/aslutils.c
  head/sys/contrib/dev/acpica/compiler/dtcompile.c
  head/sys/contrib/dev/acpica/compiler/dtcompiler.h
  head/sys/contrib/dev/acpica/compiler/dtfield.c
  head/sys/contrib/dev/acpica/compiler/dtparser.y
  head/sys/contrib/dev/acpica/compiler/dtutils.c
  head/sys/contrib/dev/acpica/compiler/prparser.y
  head/sys/contrib/dev/acpica/components/debugger/dbconvert.c
  head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
  head/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
  head/sys/contrib/dev/acpica/components/events/evgpe.c
  head/sys/contrib/dev/acpica/components/executer/exconcat.c
  head/sys/contrib/dev/acpica/components/executer/exconvrt.c
  head/sys/contrib/dev/acpica/components/executer/exmisc.c
  head/sys/contrib/dev/acpica/components/executer/exresop.c
  head/sys/contrib/dev/acpica/components/hardware/hwgpe.c
  head/sys/contrib/dev/acpica/components/hardware/hwregs.c
  head/sys/contrib/dev/acpica/components/hardware/hwtimer.c
  head/sys/contrib/dev/acpica/components/hardware/hwxface.c
  head/sys/contrib/dev/acpica/components/namespace/nsconvert.c
  head/sys/contrib/dev/acpica/components/tables/tbxface.c
  head/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c
  head/sys/contrib/dev/acpica/include/acexcep.h
  head/sys/contrib/dev/acpica/include/achware.h
  head/sys/contrib/dev/acpica/include/acinterp.h
  head/sys/contrib/dev/acpica/include/acpixf.h
  head/sys/contrib/dev/acpica/include/actbl1.h
  head/sys/contrib/dev/acpica/include/actbl2.h
  head/sys/contrib/dev/acpica/include/acutils.h
  head/sys/dev/acpica/acpi_cpu.c
  head/usr.sbin/acpi/acpidb/Makefile
  head/usr.sbin/acpi/iasl/Makefile
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Aug 31 21:56:17 2017(r323075)
+++ head/sys/conf/files Thu Aug 31 22:47:04 2017(r323076)
@@ -497,6 +497,7 @@ contrib/dev/acpica/components/utilities/utresdecode.c   
 contrib/dev/acpica/components/utilities/utresrc.c  optional acpi
 contrib/dev/acpica/components/utilities/utstate.c  optional acpi
 contrib/dev/acpica/components/utilities/utstring.c optional acpi
+contrib/dev/acpica/components/utilities/utstrsuppt.c   optional acpi
 contrib/dev/acpica/components/utilities/utstrtoul64.c  optional acpi
 contrib/dev/acpica/components/utilities/utuuid.c   optional acpi acpi_debug
 contrib/dev/acpica/components/utilities/utxface.c  optional acpi

Modified: head/sys/contrib/dev/acpica/changes.txt
==
--- head/sys/contrib/dev/acpica/changes.txt Thu Aug 31 21:56:17 2017
(r323075)
+++ head/sys/contrib/dev/acpica/changes.txt Thu Aug 31 22:47:04 2017
(r323076)
@@ -1,4 +1,53 @@
 
+31 August 2017. Summary of changes for version 20170831:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Implemented internal support for full 64-bit addresses that appear in all 
+Generic Address Structure (GAS) structures. Previously, only the lower 32 
+bits were used. Affects the use of GAS structures in the FADT and other 
+tables, as well as the GAS structures passed to the AcpiRead and 
+AcpiWrite public external interfaces that are used by drivers. Lv Zheng.
+
+Added header support for the PDTT ACPI table (Processor Debug Trigger 
+Table). Full support in the iASL Data Table Compiler and disassembler is 
+forthcoming.
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL/Disassembler: Fixed a problem with the PPTT ACPI table (Processor 
+Properties Topology Table) where a flag bit was specified in the wrong 
+bit position ("Line Size Valid", bit 6).
+
+iASL: Implemented support for Octal integer constants as defined by the 
+ASL language grammar, per the ACPI specification. Any intege

svn commit: r323074 - head/sys/dev/ntb

2017-08-31 Thread Alexander Motin
Author: mav
Date: Thu Aug 31 21:37:22 2017
New Revision: 323074
URL: https://svnweb.freebsd.org/changeset/base/323074

Log:
  Clear doorbell bits after masking them before processing.
  
  In theory this allows to avoid one more expensive doorbell register read
  later in some scenarios.  But in practice it also significantly increases
  packet rate on PLX hardware, that I can't explain yet, possibly work-
  arounding some interrupt delays.
  
  MFC after:13 days
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/dev/ntb/ntb_transport.c

Modified: head/sys/dev/ntb/ntb_transport.c
==
--- head/sys/dev/ntb/ntb_transport.cThu Aug 31 21:31:13 2017
(r323073)
+++ head/sys/dev/ntb/ntb_transport.cThu Aug 31 21:37:22 2017
(r323074)
@@ -1012,8 +1012,10 @@ ntb_transport_doorbell_callback(void *data, uint32_t v
vec_mask &= nt->qp_bitmap;
if ((vec_mask & (vec_mask - 1)) != 0)
vec_mask &= ntb_db_read(nt->dev);
-   if (vec_mask != 0)
+   if (vec_mask != 0) {
ntb_db_set_mask(nt->dev, vec_mask);
+   ntb_db_clear(nt->dev, vec_mask);
+   }
while (vec_mask != 0) {
qp_num = ffsll(vec_mask) - 1;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r323068 - in head/sys: amd64/conf arm64/conf i386/conf powerpc/conf riscv/conf sparc64/conf

2017-08-31 Thread Andrey V. Elsukov
On 31.08.2017 23:16, Josh Paetzel wrote:
> Author: jpaetzel
> Date: Thu Aug 31 20:16:28 2017
> New Revision: 323068
> URL: https://svnweb.freebsd.org/changeset/base/323068
> 
> Log:
>   Allow kldload tcpmd5
>   
>   PR: 220170
>   MFC after:  2 weeks
> 
> Modified:
>   head/sys/amd64/conf/GENERIC
>   head/sys/arm64/conf/GENERIC
>   head/sys/i386/conf/GENERIC
>   head/sys/powerpc/conf/GENERIC
>   head/sys/riscv/conf/GENERIC
>   head/sys/sparc64/conf/GENERIC

JFYI, there is related review: https://reviews.freebsd.org/D11806

-- 
WBR, Andrey V. Elsukov



signature.asc
Description: OpenPGP digital signature


svn commit: r323070 - head/sys/arm64/arm64

2017-08-31 Thread Andrew Turner
Author: andrew
Date: Thu Aug 31 20:48:05 2017
New Revision: 323070
URL: https://svnweb.freebsd.org/changeset/base/323070

Log:
  Add support for quirks while enabling secondary CPUs. This uses the fdt
  compatible string to check if the board is compatible with a given quirk.
  It's possible this will be moved later, however as it's currently only used
  by the MP code put it there.
  
  So far the only instance of a quirk is when the list of CPUs may be
  incorrect. This can happen on virtual machines with a hard coded
  devicetree, but where the user may then set the number of CPUs as an
  argument. This is the case on the ARM models so include the model specific
  compat strings for these, including the spelling mistake found in some of
  the OpenplatformPkg dtb files.
  
  Sponsored by: DARPA, AFRL

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

Modified: head/sys/arm64/arm64/mp_machdep.c
==
--- head/sys/arm64/arm64/mp_machdep.c   Thu Aug 31 20:33:22 2017
(r323069)
+++ head/sys/arm64/arm64/mp_machdep.c   Thu Aug 31 20:48:05 2017
(r323070)
@@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$");
 #ifdef FDT
 #include 
 #include 
+#include 
 #include 
 #endif
 
@@ -74,6 +75,23 @@ __FBSDID("$FreeBSD$");
 
 #include "pic_if.h"
 
+#defineMP_QUIRK_CPULIST0x01/* The list of cpus may be 
wrong, */
+   /* don't panic if one fails to start */
+static uint32_t mp_quirks;
+
+#ifdef FDT
+static struct {
+   const char *compat;
+   uint32_t quirks;
+} fdt_quirks[] = {
+   { "arm,foundation-aarch64", MP_QUIRK_CPULIST },
+   { "arm,fvp-base",   MP_QUIRK_CPULIST },
+   /* This is incorrect in some DTS files */
+   { "arm,vfp-base",   MP_QUIRK_CPULIST },
+   { NULL, 0 },
+};
+#endif
+
 typedef void intr_ipi_send_t(void *, cpuset_t, u_int);
 typedef void intr_ipi_handler_t(void *);
 
@@ -465,13 +483,16 @@ start_cpu(u_int id, uint64_t target_cpu)
 * start the requested CPU. If psci_cpu_on returns PSCI_MISSING
 * to indicate we are unable to use it to start the given CPU.
 */
-   KASSERT(err == PSCI_MISSING,
+   KASSERT(err == PSCI_MISSING ||
+   (mp_quirks & MP_QUIRK_CPULIST) == MP_QUIRK_CPULIST,
("Failed to start CPU %u (%lx)\n", id, target_cpu));
 
pcpu_destroy(pcpup);
kmem_free(kernel_arena, (vm_offset_t)dpcpu[cpuid - 1],
DPCPU_SIZE);
dpcpu[cpuid - 1] = NULL;
+   mp_ncpus--;
+
/* Notify the user that the CPU failed to start */
printf("Failed to start CPU %u (%lx)\n", id, target_cpu);
} else
@@ -556,6 +577,10 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size
 void
 cpu_mp_start(void)
 {
+#ifdef FDT
+   phandle_t node;
+   int i;
+#endif
 
mtx_init(_boot_mtx, "ap boot", NULL, MTX_SPIN);
 
@@ -570,6 +595,13 @@ cpu_mp_start(void)
 #endif
 #ifdef FDT
case ARM64_BUS_FDT:
+   node = OF_peer(0);
+   for (i = 0; fdt_quirks[i].compat != NULL; i++) {
+   if (ofw_bus_node_is_compatible(node,
+   fdt_quirks[i].compat) != 0) {
+   mp_quirks = fdt_quirks[i].quirks;
+   }
+   }
KASSERT(cpu0 >= 0, ("Current CPU was not found"));
ofw_cpu_early_foreach(cpu_init_fdt, true);
break;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323069 - in head/sys/dev/cxgbe: . tom

2017-08-31 Thread Navdeep Parhar
Author: np
Date: Thu Aug 31 20:33:22 2017
New Revision: 323069
URL: https://svnweb.freebsd.org/changeset/base/323069

Log:
  cxgbe/t4_tom: Add a knob to select the congestion control algorigthm
  used by the TOE hardware for fully offloaded connections.  The knob
  affects new connections only.
  
  MFC after:2 weeks
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/offload.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/tom/t4_connect.c
  head/sys/dev/cxgbe/tom/t4_listen.c

Modified: head/sys/dev/cxgbe/offload.h
==
--- head/sys/dev/cxgbe/offload.hThu Aug 31 20:16:28 2017
(r323068)
+++ head/sys/dev/cxgbe/offload.hThu Aug 31 20:33:22 2017
(r323069)
@@ -144,6 +144,7 @@ struct uld_info {
 };
 
 struct tom_tunables {
+   int cong_algorithm;
int sndbuf;
int ddp;
int rx_coalesce;

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Aug 31 20:16:28 2017
(r323068)
+++ head/sys/dev/cxgbe/t4_main.cThu Aug 31 20:33:22 2017
(r323069)
@@ -5416,6 +5416,12 @@ t4_sysctls(struct adapter *sc)
NULL, "TOE parameters");
children = SYSCTL_CHILDREN(oid);
 
+   sc->tt.cong_algorithm = -1;
+   SYSCTL_ADD_INT(ctx, children, OID_AUTO, "cong_algorithm",
+   CTLFLAG_RW, >tt.cong_algorithm, 0, "congestion control "
+   "(-1 = default, 0 = reno, 1 = tahoe, 2 = newreno, "
+   "3 = highspeed)");
+
sc->tt.sndbuf = 256 * 1024;
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "sndbuf", CTLFLAG_RW,
>tt.sndbuf, 0, "max hardware send buffer size");

Modified: head/sys/dev/cxgbe/tom/t4_connect.c
==
--- head/sys/dev/cxgbe/tom/t4_connect.c Thu Aug 31 20:16:28 2017
(r323068)
+++ head/sys/dev/cxgbe/tom/t4_connect.c Thu Aug 31 20:33:22 2017
(r323069)
@@ -259,6 +259,9 @@ calc_opt2a(struct socket *so, struct toepcb *toep)
if (sc->tt.rx_coalesce)
opt2 |= V_RX_COALESCE(M_RX_COALESCE);
 
+   if (sc->tt.cong_algorithm != -1)
+   opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL);
+
 #ifdef USE_DDP_RX_FLOW_CONTROL
if (toep->ulp_mode == ULP_MODE_TCPDDP)
opt2 |= F_RX_FC_VALID | F_RX_FC_DDP;

Modified: head/sys/dev/cxgbe/tom/t4_listen.c
==
--- head/sys/dev/cxgbe/tom/t4_listen.c  Thu Aug 31 20:16:28 2017
(r323068)
+++ head/sys/dev/cxgbe/tom/t4_listen.c  Thu Aug 31 20:33:22 2017
(r323069)
@@ -1047,6 +1047,9 @@ calc_opt2p(struct adapter *sc, struct port_info *pi, i
if (sc->tt.rx_coalesce)
opt2 |= V_RX_COALESCE(M_RX_COALESCE);
 
+   if (sc->tt.cong_algorithm != -1)
+   opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL);
+
 #ifdef USE_DDP_RX_FLOW_CONTROL
if (ulp_mode == ULP_MODE_TCPDDP)
opt2 |= F_RX_FC_VALID | F_RX_FC_DDP;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323068 - in head/sys: amd64/conf arm64/conf i386/conf powerpc/conf riscv/conf sparc64/conf

2017-08-31 Thread Josh Paetzel
Author: jpaetzel
Date: Thu Aug 31 20:16:28 2017
New Revision: 323068
URL: https://svnweb.freebsd.org/changeset/base/323068

Log:
  Allow kldload tcpmd5
  
  PR:   220170
  MFC after:2 weeks

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/arm64/conf/GENERIC
  head/sys/i386/conf/GENERIC
  head/sys/powerpc/conf/GENERIC
  head/sys/riscv/conf/GENERIC
  head/sys/sparc64/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Thu Aug 31 18:39:18 2017(r323067)
+++ head/sys/amd64/conf/GENERIC Thu Aug 31 20:16:28 2017(r323068)
@@ -29,6 +29,7 @@ options   PREEMPTION  # Enable kernel thread 
preemption
 optionsINET# InterNETworking
 optionsINET6   # IPv6 communications protocols
 optionsIPSEC   # IP (v4/v6) security
+optionsIPSEC_SUPPORT   # Allow kldload of ipsec and tcpmd5
 optionsTCP_OFFLOAD # TCP offload
 optionsTCP_HHOOK   # hhook(9) framework for TCP
 optionsSCTP# Stream Control Transmission Protocol

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Thu Aug 31 18:39:18 2017(r323067)
+++ head/sys/arm64/conf/GENERIC Thu Aug 31 20:16:28 2017(r323068)
@@ -29,6 +29,7 @@ options   PREEMPTION  # Enable kernel thread 
preemption
 optionsINET# InterNETworking
 optionsINET6   # IPv6 communications protocols
 optionsIPSEC   # IP (v4/v6) security
+optionsIPSEC_SUPPORT   # Allow kldload of ipsec and 
tcpmd5
 optionsTCP_HHOOK   # hhook(9) framework for TCP
 optionsTCP_OFFLOAD # TCP offload
 optionsSCTP# Stream Control Transmission Protocol

Modified: head/sys/i386/conf/GENERIC
==
--- head/sys/i386/conf/GENERIC  Thu Aug 31 18:39:18 2017(r323067)
+++ head/sys/i386/conf/GENERIC  Thu Aug 31 20:16:28 2017(r323068)
@@ -31,6 +31,7 @@ options   PREEMPTION  # Enable kernel thread 
preemption
 optionsINET# InterNETworking
 optionsINET6   # IPv6 communications protocols
 optionsIPSEC   # IP (v4/v6) security
+optionsIPSEC_SUPPORT   # Allow kldload of ipsec and 
tcpmd5
 optionsTCP_HHOOK   # hhook(9) framework for TCP
 optionsTCP_OFFLOAD # TCP offload
 optionsSCTP# Stream Control Transmission Protocol

Modified: head/sys/powerpc/conf/GENERIC
==
--- head/sys/powerpc/conf/GENERIC   Thu Aug 31 18:39:18 2017
(r323067)
+++ head/sys/powerpc/conf/GENERIC   Thu Aug 31 20:16:28 2017
(r323068)
@@ -38,6 +38,7 @@ options   PREEMPTION  #Enable kernel thread 
preemption
 optionsINET#InterNETworking
 optionsINET6   #IPv6 communications protocols
 optionsIPSEC   # IP (v4/v6) security
+optionsIPSEC_SUPPORT   # Allow kldload of ipsec and 
tcpmd5
 optionsTCP_HHOOK   # hhook(9) framework for TCP
 optionsSCTP#Stream Control Transmission Protocol
 optionsFFS #Berkeley Fast Filesystem

Modified: head/sys/riscv/conf/GENERIC
==
--- head/sys/riscv/conf/GENERIC Thu Aug 31 18:39:18 2017(r323067)
+++ head/sys/riscv/conf/GENERIC Thu Aug 31 20:16:28 2017(r323068)
@@ -34,6 +34,7 @@ options   INET# InterNETworking
 optionsINET6   # IPv6 communications protocols
 optionsTCP_HHOOK   # hhook(9) framework for TCP
 optionsIPSEC   # IP (v4/v6) security
+optionsIPSEC_SUPPORT   # Allow kldload of ipsec and 
tcpmd5
 optionsTCP_OFFLOAD # TCP offload
 optionsSCTP# Stream Control Transmission Protocol
 optionsFFS # Berkeley Fast Filesystem

Modified: head/sys/sparc64/conf/GENERIC
==
--- head/sys/sparc64/conf/GENERIC   Thu Aug 31 18:39:18 2017
(r323067)
+++ head/sys/sparc64/conf/GENERIC   Thu Aug 31 20:16:28 2017
(r323068)
@@ -31,6 +31,7 @@ options   PREEMPTION  # Enable kernel thread 
preemption
 optionsINET# 

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

2017-08-31 Thread Conrad Meyer
Author: cem
Date: Thu Aug 31 18:39:18 2017
New Revision: 323067
URL: https://svnweb.freebsd.org/changeset/base/323067

Log:
  amdtemp.4: Update BKDG URL to current location
  
  Sponsored by: Dell EMC Isilon

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

Modified: head/share/man/man4/amdtemp.4
==
--- head/share/man/man4/amdtemp.4   Thu Aug 31 17:53:50 2017
(r323066)
+++ head/share/man/man4/amdtemp.4   Thu Aug 31 18:39:18 2017
(r323067)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 27, 2015
+.Dd August 31, 2017
 .Dt AMDTEMP 4
 .Os
 .Sh NAME
@@ -107,5 +107,5 @@ specified maximum case temperature and maximum thermal
 according to
 .Rs
 .%T BIOS and Kernel Developer's Guide (BKDG) for AMD Processors
-.%U http://developer.amd.com/documentation/guides/Pages/default.aspx
+.%U http://developer.amd.com/resources/developer-guides-manuals/
 .Re
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323066 - head/usr.sbin/efivar

2017-08-31 Thread Warner Losh
Author: imp
Date: Thu Aug 31 17:53:50 2017
New Revision: 323066
URL: https://svnweb.freebsd.org/changeset/base/323066

Log:
  Add UCS2->UTF8 option.
  
  Many UEFI variables are UCS2 strings (some NUL terminated, others
  not). Add --utf8 (-u) to convert UCS2 strings to UTF8 before printing.
  
  Sponsored by: Netflix

Modified:
  head/usr.sbin/efivar/Makefile
  head/usr.sbin/efivar/efivar.8
  head/usr.sbin/efivar/efivar.c

Modified: head/usr.sbin/efivar/Makefile
==
--- head/usr.sbin/efivar/Makefile   Thu Aug 31 17:32:24 2017
(r323065)
+++ head/usr.sbin/efivar/Makefile   Thu Aug 31 17:53:50 2017
(r323066)
@@ -5,4 +5,7 @@ MAN=efivar.8
 
 LIBADD= efivar
 
+EFIBOOT=${SRCTOP}/sys/boot/efi
+CFLAGS+=   -I${EFIBOOT}/include
+
 .include 

Modified: head/usr.sbin/efivar/efivar.8
==
--- head/usr.sbin/efivar/efivar.8   Thu Aug 31 17:32:24 2017
(r323065)
+++ head/usr.sbin/efivar/efivar.8   Thu Aug 31 17:53:50 2017
(r323066)
@@ -32,7 +32,7 @@
 .Nd UEFI environment variable interaction
 .Sh SYNOPSIS
 .Nm
-.Op Fl abdDHlLNpRtw
+.Op Fl abdDHlLNpRtuw
 .Op Fl n Ar name
 .Op Fl f Ar file
 .Op Fl -append
@@ -51,6 +51,7 @@
 .Op Fl -print
 .Op Fl -print-decimal
 .Op Fl -raw-guid
+.Op Fl -utf8
 .Op Fl -write
 .Sh DESCRIPTION
 This program manages
@@ -143,6 +144,9 @@ Do not display the variable name.
 Print the value of the variable.
 .It Fl R Fl -raw-guid
 Do not substitute well known names for GUID numeric values in output.
+.It Fl u Fl -utf8
+Treat the value of the variable as UCS2 and convert it to UTF8 and
+print the result.
 .It Fl w Fl -write
 Write (replace) the variable specified with the value specified from
 standard input.

Modified: head/usr.sbin/efivar/efivar.c
==
--- head/usr.sbin/efivar/efivar.c   Thu Aug 31 17:32:24 2017
(r323065)
+++ head/usr.sbin/efivar/efivar.c   Thu Aug 31 17:53:50 2017
(r323066)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include "efichar.h"
 
 /* options descriptor */
 static struct option longopts[] = {
@@ -58,13 +59,14 @@ static struct option longopts[] = {
{ "print",  no_argument,NULL,   'p' },
{ "print-decimal",  no_argument,NULL,   'd' },
{ "raw-guid",   no_argument,NULL,   'R' },
+   { "utf8",   no_argument,NULL,   'u' },
{ "write",  no_argument,NULL,   'w' },
{ NULL, 0,  NULL,   0 }
 };
 
 
 static int aflag, Aflag, bflag, dflag, Dflag, gflag, Hflag, Nflag,
-   lflag, Lflag, Rflag, wflag, pflag;
+   lflag, Lflag, Rflag, wflag, pflag, uflag;
 static char *varname;
 static u_long attrib = EFI_VARIABLE_NON_VOLATILE | 
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS;
 
@@ -176,6 +178,27 @@ asciidump(uint8_t *data, size_t datalen)
 }
 
 static void
+utf8dump(uint8_t *data, size_t datalen)
+{
+   char *utf8 = NULL;
+   efi_char *ucs2;
+
+   /*
+* NUL terminate the string. Not all strings need it, but some
+* do and an extra NUL won't change what's printed.
+*/
+   ucs2 = malloc(datalen + sizeof(efi_char));
+   memcpy(ucs2, data, datalen);
+   ucs2[datalen / sizeof(efi_char)] = 0;
+   ucs2_to_utf8(ucs2, );
+   if (!Nflag)
+   printf("\n");
+   printf("%s\n", utf8);
+   free(utf8);
+   free(ucs2);
+}
+
+static void
 hexdump(uint8_t *data, size_t datalen)
 {
size_t i;
@@ -245,6 +268,8 @@ print_var(efi_guid_t *guid, char *name)
printf("%s-%s", gname, name);
if (Aflag)
asciidump(data, datalen);
+   else if (uflag)
+   utf8dump(data, datalen);
else if (bflag)
bindump(data, datalen);
else if (dflag)
@@ -343,6 +368,9 @@ parse_args(int argc, char **argv)
break;
case 't':
attrib = strtoul(optarg, NULL, 16);
+   break;
+   case 'u':
+   uflag++;
break;
case 'w':
wflag++;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323065 - in head/sys/boot/efi: boot1 include

2017-08-31 Thread Warner Losh
Author: imp
Date: Thu Aug 31 17:32:24 2017
New Revision: 323065
URL: https://svnweb.freebsd.org/changeset/base/323065

Log:
  Save where we're booted from
  
  Record the file path for boot1.efi as the UEFI environemnt variable
  FreeBSDBootVarGUID:Boot1Path. Record the device this came from as
  FreeBSDBootVarGUID:Boot1Dev. While later stages of the boot may be
  able to guess these values by retrieving UEFIGlobal:BootCurrent and
  groveling through the correct UEFIGlobal:Boot, this provides
  certanty in the face of behavior from any part of the boot loader
  chain that might "guess" what to do next. These env variables are
  volatile and will disappear on reboot.
  
  Sponsored by: Netflix

Modified:
  head/sys/boot/efi/boot1/boot1.c
  head/sys/boot/efi/include/efiapi.h

Modified: head/sys/boot/efi/boot1/boot1.c
==
--- head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:19 2017
(r323064)
+++ head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:24 2017
(r323065)
@@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+typedef CHAR16 efi_char;
+#include 
 
 #include "boot_module.h"
 #include "paths.h"
@@ -53,6 +55,7 @@ static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCO
 static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL;
 static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL;
 static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID;
+static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID;
 
 /*
  * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures
@@ -77,6 +80,34 @@ Free(void *buf, const char *file __unused, int line __
(void)BS->FreePool(buf);
 }
 
+static int
+wcslen(const CHAR16 *str)
+{
+   int i;
+
+   i = 0;
+   while (*str++)
+   i++;
+   return i;
+}
+
+static EFI_STATUS
+efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr)
+{
+   CHAR16 *var = NULL;
+   size_t len;
+   EFI_STATUS rv;
+
+   utf8_to_ucs2(varname, , );
+   if (var == NULL)
+   return (EFI_OUT_OF_RESOURCES);
+   rv = RS->SetVariable(var, ,
+   EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+   wcslen(valstr) * 2, valstr);
+   free(var);
+   return (rv);
+}
+
 /*
  * devpath_last returns the last non-path end node in devpath.
  */
@@ -394,6 +425,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
if (status == EFI_SUCCESS) {
text = efi_devpath_name(img->FilePath);
printf("   Load Path: %S\n", text);
+   efi_setenv_freebsd_wcs("Boot1Path", text);
efi_free_devpath_name(text);
 
status = BS->HandleProtocol(img->DeviceHandle, ,
@@ -404,6 +436,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
} else {
text = efi_devpath_name(imgpath);
printf("   Load Device: %S\n", text);
+   efi_setenv_freebsd_wcs("Boot1Dev", text);
efi_free_devpath_name(text);
}
 

Modified: head/sys/boot/efi/include/efiapi.h
==
--- head/sys/boot/efi/include/efiapi.h  Thu Aug 31 17:32:19 2017
(r323064)
+++ head/sys/boot/efi/include/efiapi.h  Thu Aug 31 17:32:24 2017
(r323065)
@@ -247,7 +247,7 @@ EFI_STATUS
 typedef
 EFI_STATUS
 (EFIAPI *EFI_SET_VARIABLE) (
-IN CHAR16   *VariableName,
+IN const CHAR16 *VariableName,
 IN EFI_GUID *VendorGuid,
 IN UINT32   Attributes,
 IN UINTNDataSize,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323062 - head/sys/boot/efi/libefi

2017-08-31 Thread Warner Losh
Author: imp
Date: Thu Aug 31 17:32:09 2017
New Revision: 323062
URL: https://svnweb.freebsd.org/changeset/base/323062

Log:
  Make efichar.c routines available to libefi.
  
  Make efichar.c routines available to libefi as well as
  libefivar. Define LIBEFI when building so we can conditionally include
  stand.h vs the normal userland stuff.

Modified:
  head/sys/boot/efi/libefi/Makefile
  head/sys/boot/efi/libefi/efichar.c

Modified: head/sys/boot/efi/libefi/Makefile
==
--- head/sys/boot/efi/libefi/Makefile   Thu Aug 31 17:22:35 2017
(r323061)
+++ head/sys/boot/efi/libefi/Makefile   Thu Aug 31 17:32:09 2017
(r323062)
@@ -11,7 +11,7 @@ LIB=  efi
 INTERNALLIB=
 WARNS?=2
 
-SRCS=  delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \
+SRCS=  delay.c devpath.c efi_console.c efichar.c efinet.c efipart.c env.c 
errno.c \
handles.c wchar.c libefi.c efi_driver_utils.c efizfs.c devicename.c
 
 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
@@ -55,5 +55,7 @@ CFLAGS+= ${FORMAT_EXTENSIONS}
 .if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "aarch64"
 CFLAGS+= -DTERM_EMU
 .endif
+
+CFLAGS+= -DLIBEFI
 
 .include 

Modified: head/sys/boot/efi/libefi/efichar.c
==
--- head/sys/boot/efi/libefi/efichar.c  Thu Aug 31 17:22:35 2017
(r323061)
+++ head/sys/boot/efi/libefi/efichar.c  Thu Aug 31 17:32:09 2017
(r323062)
@@ -29,10 +29,14 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#ifdef LIBEFI
+#include 
+#else
 #include 
 #include 
 #include 
 #include 
+#endif
 #include 
 #include 
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323064 - head/sys/boot/efi/boot1

2017-08-31 Thread Warner Losh
Author: imp
Date: Thu Aug 31 17:32:19 2017
New Revision: 323064
URL: https://svnweb.freebsd.org/changeset/base/323064

Log:
  Exit rather than panic for most errors.
  
  In the FreeBSD UEFI boot protocol, boot1.efi exits back to UEFI if it
  can't boot the image for most reasons (so that further items in the
  EFI boot manger list can be tried). Rename panic to efi_panic, make it
  static and give it an extra status argument. Exit back to UEFI with
  that status argument so the next loader can be tried.
  
  Use malloc/free exclusively instead of mixing malloc/free and
  AllocatePool/FreePool. The code is smaller.
  
  Sponsored by: Netflix

Modified:
  head/sys/boot/efi/boot1/boot1.c

Modified: head/sys/boot/efi/boot1/boot1.c
==
--- head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:14 2017
(r323063)
+++ head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:19 2017
(r323064)
@@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$");
 #include "boot_module.h"
 #include "paths.h"
 
+static void efi_panic(EFI_STATUS s, const char *fmt, ...) __dead2 
__printflike(2, 3);
+
 static const boot_module_t *boot_modules[] =
 {
 #ifdef EFI_ZFS_BOOT
@@ -275,11 +277,9 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B
 
/* Run through each module, see if it can load this partition */
for (i = 0; i < NUM_BOOT_MODULES; i++) {
-   if ((status = BS->AllocatePool(EfiLoaderData,
-   sizeof(*devinfo), (void **))) !=
-   EFI_SUCCESS) {
-   DPRINTF("\nFailed to allocate devinfo (%lu)\n",
-   EFI_ERROR_CODE(status));
+   devinfo = malloc(sizeof(*devinfo));
+   if (devinfo == NULL) {
+   DPRINTF("\nFailed to allocate devinfo\n");
continue;
}
devinfo->dev = blkio;
@@ -292,7 +292,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B
status = boot_modules[i]->probe(devinfo);
if (status == EFI_SUCCESS)
return (EFI_SUCCESS);
-   (void)BS->FreePool(devinfo);
+   free(devinfo);
}
 
return (EFI_UNSUPPORTED);
@@ -411,10 +411,10 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
 
/* Get all the device handles */
hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE);
-   if ((status = BS->AllocatePool(EfiLoaderData, hsize, (void **)))
-   != EFI_SUCCESS)
-   panic("Failed to allocate %d handles (%lu)", NUM_HANDLES_INIT,
-   EFI_ERROR_CODE(status));
+   handles = malloc(hsize);
+   if (handles == NULL) {
+   printf("Failed to allocate %d handles\n", NUM_HANDLES_INIT);
+   }
 
status = BS->LocateHandle(ByProtocol, , NULL,
, handles);
@@ -422,21 +422,19 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
case EFI_SUCCESS:
break;
case EFI_BUFFER_TOO_SMALL:
-   (void)BS->FreePool(handles);
-   if ((status = BS->AllocatePool(EfiLoaderData, hsize,
-   (void **))) != EFI_SUCCESS) {
-   panic("Failed to allocate %zu handles (%lu)", hsize /
-   sizeof(*handles), EFI_ERROR_CODE(status));
-   }
+   free(handles);
+   handles = malloc(hsize);
+   if (handles == NULL)
+   efi_panic(EFI_OUT_OF_RESOURCES, "Failed to allocate %d 
handles\n",
+   NUM_HANDLES_INIT);
status = BS->LocateHandle(ByProtocol, ,
NULL, , handles);
if (status != EFI_SUCCESS)
-   panic("Failed to get device handles (%lu)\n",
-   EFI_ERROR_CODE(status));
+   efi_panic(status, "Failed to get device handles\n");
break;
default:
-   panic("Failed to get device handles (%lu)",
-   EFI_ERROR_CODE(status));
+   efi_panic(status, "Failed to get device handles\n");
+   break;
}
 
/* Scan all partitions, probing with all modules. */
@@ -457,7 +455,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
try_boot();
 
/* If we get here, we're out of luck... */
-   panic("No bootable partitions found!");
+   efi_panic(EFI_LOAD_ERROR, "No bootable partitions found!");
 }
 
 /*
@@ -479,8 +477,12 @@ add_device(dev_info_t **devinfop, dev_info_t *devinfo)
dev->next = devinfo;
 }
 
-void
-panic(const char *fmt, ...)
+/*
+ * OK. We totally give up. Exit back to EFI with a sensible status so
+ * it can try the next option on the list.
+ */
+static void
+efi_panic(EFI_STATUS s, const char *fmt, ...)
 {
va_list ap;
 
@@ -490,7 +492,7 @@ panic(const char *fmt, ...)

svn commit: r323063 - head/sys/boot/efi/boot1

2017-08-31 Thread Warner Losh
Author: imp
Date: Thu Aug 31 17:32:14 2017
New Revision: 323063
URL: https://svnweb.freebsd.org/changeset/base/323063

Log:
  boot1.efi: print more info about where boot1.efi is loaded from
  
  Print the device that boot1.efi was loaded from. Print the path as
  well (since it isn't included in DeviceHandle). Move block where we do
  this earlier so all the block handle code is now together.
  
  Sponsored by: Netflix

Modified:
  head/sys/boot/efi/boot1/boot1.c

Modified: head/sys/boot/efi/boot1/boot1.c
==
--- head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:09 2017
(r323062)
+++ head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:14 2017
(r323063)
@@ -344,6 +344,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL;
SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL;
UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles;
+   CHAR16 *text;
 
/* Basic initialization*/
ST = Xsystab;
@@ -387,6 +388,27 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
}
putchar('\n');
 
+   /* Determine the devpath of our image so we can prefer it. */
+   status = BS->HandleProtocol(IH, , (VOID**));
+   imgpath = NULL;
+   if (status == EFI_SUCCESS) {
+   text = efi_devpath_name(img->FilePath);
+   printf("   Load Path: %S\n", text);
+   efi_free_devpath_name(text);
+
+   status = BS->HandleProtocol(img->DeviceHandle, ,
+   (void **));
+   if (status != EFI_SUCCESS) {
+   DPRINTF("Failed to get image DevicePath (%lu)\n",
+   EFI_ERROR_CODE(status));
+   } else {
+   text = efi_devpath_name(imgpath);
+   printf("   Load Device: %S\n", text);
+   efi_free_devpath_name(text);
+   }
+
+   }
+
/* Get all the device handles */
hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE);
if ((status = BS->AllocatePool(EfiLoaderData, hsize, (void **)))
@@ -421,24 +443,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
nhandles = hsize / sizeof(*handles);
printf("   Probing %zu block devices...", nhandles);
DPRINTF("\n");
-
-   /* Determine the devpath of our image so we can prefer it. */
-   status = BS->HandleProtocol(IH, , (VOID**));
-   imgpath = NULL;
-   if (status == EFI_SUCCESS) {
-   status = BS->HandleProtocol(img->DeviceHandle, ,
-   (void **));
-   if (status != EFI_SUCCESS)
-   DPRINTF("Failed to get image DevicePath (%lu)\n",
-   EFI_ERROR_CODE(status));
-#ifdef EFI_DEBUG
-   {
-   CHAR16 *text = efi_devpath_name(imgpath);
-   DPRINTF("boot1 imagepath: %S\n", text);
-   efi_free_devpath_name(text);
-   }
-#endif
-   }
 
for (i = 0; i < nhandles; i++)
probe_handle_status(handles[i], imgpath);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323059 - head/sys/dev/ntb/ntb_hw

2017-08-31 Thread Alexander Motin
Author: mav
Date: Thu Aug 31 17:02:06 2017
New Revision: 323059
URL: https://svnweb.freebsd.org/changeset/base/323059

Log:
  Remove unneeded pmap_change_attr() calls.
  
  Reported by:  kib
  MFC after:13 days

Modified:
  head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
==
--- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Aug 31 16:32:11 2017
(r323058)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Aug 31 17:02:06 2017
(r323059)
@@ -316,8 +316,6 @@ ntb_plx_attach(device_t dev)
device_printf(dev, "Can't allocate configuration BAR.\n");
return (ENXIO);
}
-   pmap_change_attr((vm_offset_t)rman_get_start(sc->conf_res),
-   rman_get_size(sc->conf_res), VM_MEMATTR_UNCACHEABLE);
 
/* Identify chip port we are connected to. */
val = bus_read_4(sc->conf_res, 0x360);
@@ -337,8 +335,6 @@ ntb_plx_attach(device_t dev)
mw->mw_size = rman_get_size(mw->mw_res);
mw->mw_vbase = rman_get_virtual(mw->mw_res);
mw->mw_map_mode = VM_MEMATTR_UNCACHEABLE;
-   pmap_change_attr((vm_offset_t)mw->mw_vbase, mw->mw_size,
-   mw->mw_map_mode);
sc->mw_count++;
 
/* Skip over adjacent BAR for 64-bit BARs. */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r323053 - head/sys/dev/ntb/ntb_hw

2017-08-31 Thread Alexander Motin
On 31.08.2017 17:43, Conrad Meyer wrote:
>> Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
>> ==
>> --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Aug 31 13:32:01 2017 
>>(r323052)
>> +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Aug 31 13:41:44 2017 
>>(r323053)
>> @@ -473,7 +473,7 @@ ntb_plx_link_enable(device_t dev, enum ntb_speed speed
>> return (0);
>> }
>>
>> -   reg = (sc->port < 8) ? 0x00208 : 0x08208;
>> +   reg = ((sc->port & ~7) << 12) | 0x208;
>> val = bus_read_4(sc->conf_res, reg);
>> if ((val & (1 << (sc->port & 7))) == 0) {
>> /* If already enabled, generate fake link event and exit. */
>> @@ -495,7 +495,7 @@ ntb_plx_link_disable(device_t dev)
>> if (sc->link)
>> return (0);
>>
>> -   reg = (sc->port < 8) ? 0x00208 : 0x08208;
>> +   reg = ((sc->port & ~7) << 12) | 0x208;
>> val = bus_read_4(sc->conf_res, reg);
>> val |= (1 << (sc->port & 7));
>> bus_write_4(sc->conf_res, reg, val);
>> @@ -512,7 +512,7 @@ ntb_plx_link_enabled(device_t dev)
>> if (sc->link)
>> return (TRUE);
>>
>> -   reg = (sc->port < 8) ? 0x00208 : 0x08208;
>> +   reg = ((sc->port & ~7) << 12) | 0x208;
>> val = bus_read_4(sc->conf_res, reg);
>> return ((val & (1 << (sc->port & 7))) == 0);
>>  }
>>
> 
> To me, the duplication strongly suggests that this should be a macro.

Added in r323058.

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


svn commit: r323058 - head/sys/dev/ntb/ntb_hw

2017-08-31 Thread Alexander Motin
Author: mav
Date: Thu Aug 31 16:32:11 2017
New Revision: 323058
URL: https://svnweb.freebsd.org/changeset/base/323058

Log:
  Add/polish some defines.
  
  MFC after:13 days

Modified:
  head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
==
--- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Aug 31 15:53:47 2017
(r323057)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Aug 31 16:32:11 2017
(r323058)
@@ -106,31 +106,36 @@ struct ntb_plx_softc {
 #definePLX_NTX_LINK_OFFSET 0x01000
 
 /* Bases of NTx our/peer interface registers */
-#definePLX_NTX_OUR(sc) \
+#definePLX_NTX_OUR_BASE(sc)\
 (PLX_NTX_BASE(sc) + ((sc)->link ? PLX_NTX_LINK_OFFSET : 0))
-#definePLX_NTX_PEER(sc)\
+#definePLX_NTX_PEER_BASE(sc)   \
 (PLX_NTX_BASE(sc) + ((sc)->link ? 0 : PLX_NTX_LINK_OFFSET))
 
 /* Read/write NTx our interface registers */
-#define NTX_READ(sc, reg)  \
-bus_read_4((sc)->conf_res, PLX_NTX_OUR(sc) + (reg))
-#define NTX_WRITE(sc, reg, val)\
-bus_write_4((sc)->conf_res, PLX_NTX_OUR(sc) + (reg), (val))
+#defineNTX_READ(sc, reg)   \
+bus_read_4((sc)->conf_res, PLX_NTX_OUR_BASE(sc) + (reg))
+#defineNTX_WRITE(sc, reg, val) \
+bus_write_4((sc)->conf_res, PLX_NTX_OUR_BASE(sc) + (reg), (val))
 
 /* Read/write NTx peer interface registers */
-#define PNTX_READ(sc, reg) \
-bus_read_4((sc)->conf_res, PLX_NTX_PEER(sc) + (reg))
-#define PNTX_WRITE(sc, reg, val)   \
-bus_write_4((sc)->conf_res, PLX_NTX_PEER(sc) + (reg), (val))
+#definePNTX_READ(sc, reg)  \
+bus_read_4((sc)->conf_res, PLX_NTX_PEER_BASE(sc) + (reg))
+#definePNTX_WRITE(sc, reg, val)\
+bus_write_4((sc)->conf_res, PLX_NTX_PEER_BASE(sc) + (reg), (val))
 
 /* Read/write B2B NTx registers */
-#define BNTX_READ(sc, reg) \
+#defineBNTX_READ(sc, reg)  \
 bus_read_4((sc)->mw_info[(sc)->b2b_mw].mw_res, \
 PLX_NTX_BASE(sc) + (reg))
-#define BNTX_WRITE(sc, reg, val)   \
+#defineBNTX_WRITE(sc, reg, val)\
 bus_write_4((sc)->mw_info[(sc)->b2b_mw].mw_res,\
 PLX_NTX_BASE(sc) + (reg), (val))
 
+#definePLX_PORT_BASE(p)((p) << 12)
+#definePLX_STATION_PORT_BASE(sc)   PLX_PORT_BASE((sc)->port & ~7)
+
+#definePLX_PORT_CONTROL(sc)(PLX_STATION_PORT_BASE(sc) + 
0x208)
+
 static int ntb_plx_init(device_t dev);
 static int ntb_plx_detach(device_t dev);
 static int ntb_plx_mw_set_trans_internal(device_t dev, unsigned mw_idx);
@@ -379,21 +384,16 @@ ntb_plx_attach(device_t dev)
 * Make sure they are present and enabled by writing to them.
 * XXX: Its a hack, but standard 8 registers are not enough.
 */
+   sc->spad_offp1 = sc->spad_off1 = PLX_NTX_OUR_BASE(sc) + 0xc6c;
+   sc->spad_offp2 = sc->spad_off2 = PLX_PORT_BASE(sc->ntx * 8) + 0x20c;
if (sc->b2b_mw >= 0) {
+   /* In NTB-to-NTB mode each side has own scratchpads. */
sc->spad_count1 = PLX_NUM_SPAD;
-   sc->spad_off1 = PLX_NTX_OUR(sc) + 0xc6c;
-   sc->spad_off2 = (sc->ntx == 0) ? 0x0020c : 0x0820c;
-   sc->spad_offp1 = sc->spad_off1;
-   sc->spad_offp2 = sc->spad_off2;
bus_write_4(sc->conf_res, sc->spad_off2, 0x12345678);
if (bus_read_4(sc->conf_res, sc->spad_off2) == 0x12345678)
sc->spad_count2 = PLX_NUM_SPAD_PATT;
} else {
-   sc->spad_count1 = PLX_NUM_SPAD / 2;
-   sc->spad_off1 = PLX_NTX_OUR(sc) + 0xc6c;
-   sc->spad_off2 = (sc->ntx == 0) ? 0x0020c : 0x0820c;
-   sc->spad_offp1 = sc->spad_off1;
-   sc->spad_offp2 = sc->spad_off2;
+   /* Otherwise we have share scratchpads with the peer. */
if (sc->link) {
sc->spad_off1 += PLX_NUM_SPAD / 2 * 4;
sc->spad_off2 += PLX_NUM_SPAD_PATT / 2 * 4;
@@ -401,6 +401,7 @@ ntb_plx_attach(device_t dev)
sc->spad_offp1 += PLX_NUM_SPAD / 2 * 4;
sc->spad_offp2 += PLX_NUM_SPAD_PATT / 2 * 4;
}
+   sc->spad_count1 = PLX_NUM_SPAD / 2;
bus_write_4(sc->conf_res, sc->spad_off2, 0x12345678);
if (bus_read_4(sc->conf_res, sc->spad_off2) == 0x12345678)
sc->spad_count2 = PLX_NUM_SPAD_PATT / 2;
@@ -473,7 +474,7 @@ ntb_plx_link_enable(device_t dev, enum 

Re: svn commit: r323032 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ntb/ntb_hw sys/i386/conf sys/modules/ntb sys/modules/ntb/ntb_hw sys/modules/ntb/ntb_hw_intel sys/modules/ntb/ntb_hw_pl

2017-08-31 Thread Konstantin Belousov
On Thu, Aug 31, 2017 at 07:12:38PM +0300, Alexander Motin wrote:
> On 31.08.2017 19:05, Konstantin Belousov wrote:
> > On Wed, Aug 30, 2017 at 09:16:32PM +, Alexander Motin wrote:
> >> Author: mav
> >> Date: Wed Aug 30 21:16:32 2017
> >> New Revision: 323032
> >> URL: https://svnweb.freebsd.org/changeset/base/323032
> >>
> >> Log:
> >>   Add NTB driver for PLX/Avago/Broadcom PCIe switches.
> >>   
> > In ntb_plx_attach(), BAR 0 and all found BARs 2-5 are explicitely
> > remapped as uncacheable.  Why is it needed ?  Does rman on x86
> > ever map any resource as not non-cacheable ?
> 
> Hmm.  May be not.  I added those to be sure while debugging one issue,
> which appeared unrelated.  Shall I remove them, expecting non-cacheable
> to be default there?
Unless you need some other mode on the windows, e.g. write-combining,
I do not see a use for re-applying the same mapping attributes.  The
pmap function is somewhat optimized, but it still had to iterate over
the page table.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r322969 - in head: sbin/mdconfig sys/dev/md sys/sys

2017-08-31 Thread Maxim Sobolev
Fair enough. If you want I have the patch against 11-stable, we have this
feature merged in our private 11.x tree.

-Max

On Thu, Aug 31, 2017 at 7:26 AM, Ian Lepore  wrote:

> Unfortunately, I'm not in a position to test those changes.  My setup
> that uses mdconfig in a 32-bit jail runs on freebsd 10-stable and 11-
> stable systems.  I don't have any 64-bit hardware available to run
> -current.
>
> -- Ian
>
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r323032 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ntb/ntb_hw sys/i386/conf sys/modules/ntb sys/modules/ntb/ntb_hw sys/modules/ntb/ntb_hw_intel sys/modules/ntb/ntb_hw_pl

2017-08-31 Thread Alexander Motin
On 31.08.2017 19:05, Konstantin Belousov wrote:
> On Wed, Aug 30, 2017 at 09:16:32PM +, Alexander Motin wrote:
>> Author: mav
>> Date: Wed Aug 30 21:16:32 2017
>> New Revision: 323032
>> URL: https://svnweb.freebsd.org/changeset/base/323032
>>
>> Log:
>>   Add NTB driver for PLX/Avago/Broadcom PCIe switches.
>>   
> In ntb_plx_attach(), BAR 0 and all found BARs 2-5 are explicitely
> remapped as uncacheable.  Why is it needed ?  Does rman on x86
> ever map any resource as not non-cacheable ?

Hmm.  May be not.  I added those to be sure while debugging one issue,
which appeared unrelated.  Shall I remove them, expecting non-cacheable
to be default there?

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


Re: svn commit: r323032 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ntb/ntb_hw sys/i386/conf sys/modules/ntb sys/modules/ntb/ntb_hw sys/modules/ntb/ntb_hw_intel sys/modules/ntb/ntb_hw_pl

2017-08-31 Thread Konstantin Belousov
On Wed, Aug 30, 2017 at 09:16:32PM +, Alexander Motin wrote:
> Author: mav
> Date: Wed Aug 30 21:16:32 2017
> New Revision: 323032
> URL: https://svnweb.freebsd.org/changeset/base/323032
> 
> Log:
>   Add NTB driver for PLX/Avago/Broadcom PCIe switches.
>   
In ntb_plx_attach(), BAR 0 and all found BARs 2-5 are explicitely
remapped as uncacheable.  Why is it needed ?  Does rman on x86
ever map any resource as not non-cacheable ?

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


svn commit: r323057 - head/lib/libefivar

2017-08-31 Thread Warner Losh
Author: imp
Date: Thu Aug 31 15:53:47 2017
New Revision: 323057
URL: https://svnweb.freebsd.org/changeset/base/323057

Log:
  Fix parsing File() nodes in device paths.
  
  o Add File to the mUefiDevicePathLibDevPathFromTextTable table so we
don't include 'File()' in the supposed path name. This happens because
of a possible misfeature in the EDK2 code where any path that's not
recognized is treated as a File() node.
  o Convert utf8 input into ucs2 output rather than just copying the
utf8 and hoping for the best (no good comes from that).
  o Remove bogus comment about needing to add 1. The dummy array already
is length 1, so that's included in sizeof the struct, so there's no
need to add it.
  
  Sponsored by: Netflix

Modified:
  head/lib/libefivar/efivar-dp-parse.c

Modified: head/lib/libefivar/efivar-dp-parse.c
==
--- head/lib/libefivar/efivar-dp-parse.cThu Aug 31 15:53:27 2017
(r323056)
+++ head/lib/libefivar/efivar-dp-parse.cThu Aug 31 15:53:47 2017
(r323057)
@@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include "efichar.h"
+
 #include "efi-osdep.h"
 #include "efivar-dp.h"
 
@@ -3031,21 +3033,15 @@ DevPathFromTextFilePath (
 
   StrCpyS (File->PathName, StrLen (TextDeviceNode) + 1, TextDeviceNode);
 #else
+  size_t len = (sizeof (FILEPATH_DEVICE_PATH) + StrLen (TextDeviceNode) * 2);
+  efi_char * v;
   File = (FILEPATH_DEVICE_PATH *) CreateDeviceNode (
 MEDIA_DEVICE_PATH,
 MEDIA_FILEPATH_DP,
-(UINT16) (sizeof (FILEPATH_DEVICE_PATH) + 
StrLen (TextDeviceNode) + 1)
+   (UINT16)len
 );
-
-  /* 
-   * Note: We'd have to change the Tianocore header files to fix this
-   * to not need a cast.  Instead we just cast it here. The Interface
-   * to the user may have issues since this won't be a UCS-2
-   * string. Also note that in the original code, a NUL wasn't
-   * allocated for the end of the string, but we copy that below. This
-   * has been corrected.
-   */
-  StrCpyS ((char *)File->PathName, StrLen (TextDeviceNode) + 1, 
TextDeviceNode);
+  v = File->PathName;
+  utf8_to_ucs2(TextDeviceNode, , );
 #endif
 
   return (EFI_DEVICE_PATH_PROTOCOL *) File;
@@ -3560,6 +3556,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TA
   {"Media",   DevPathFromTextMedia   },
   {"Fv",  DevPathFromTextFv  },
   {"FvFile",  DevPathFromTextFvFile  },
+  {"File",DevPathFromTextFilePath},
   {"Offset",  DevPathFromTextRelativeOffsetRange },
   {"RamDisk", DevPathFromTextRamDisk },
   {"VirtualDisk", DevPathFromTextVirtualDisk },
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323056 - head/lib/libefivar

2017-08-31 Thread Warner Losh
Author: imp
Date: Thu Aug 31 15:53:27 2017
New Revision: 323056
URL: https://svnweb.freebsd.org/changeset/base/323056

Log:
  Fix printing File() nodes in device paths.
  
  Device paths encoded into the FILEPATH_DEVICE_PATH are UCS2 not
  ASCII/UTF8. Convert to utf8 and print that when printing File
  paths. Also, since File may be at the end of a long device path,
  output File() around the path so it doesn't just show up as random
  nodes that might accidentally match real node paths names and cause
  errors.

Modified:
  head/lib/libefivar/efivar-dp-format.c

Modified: head/lib/libefivar/efivar-dp-format.c
==
--- head/lib/libefivar/efivar-dp-format.c   Thu Aug 31 14:27:09 2017
(r323055)
+++ head/lib/libefivar/efivar-dp-format.c   Thu Aug 31 15:53:27 2017
(r323056)
@@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include "efichar.h"
+
 #include "efi-osdep.h"
 #include "efivar-dp.h"
 
@@ -1872,9 +1874,12 @@ DevPathToTextFilePath (
   )
 {
   FILEPATH_DEVICE_PATH  *Fp;
+  char *name = NULL;
 
   Fp = DevPath;
-  UefiDevicePathLibCatPrint (Str, "%s", Fp->PathName);
+  ucs2_to_utf8(Fp->PathName, );
+  UefiDevicePathLibCatPrint (Str, "File(%s)", name);
+  free(name);
 }
 
 /**
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r322969 - in head: sbin/mdconfig sys/dev/md sys/sys

2017-08-31 Thread Ian Lepore
Unfortunately, I'm not in a position to test those changes.  My setup
that uses mdconfig in a 32-bit jail runs on freebsd 10-stable and 11-
stable systems.  I don't have any 64-bit hardware available to run
-current.

-- Ian

On Wed, 2017-08-30 at 10:10 -0700, Maxim Sobolev wrote:
> Hi Ian, I've committed support for the md_label into 32-bit-to-64-bit 
> ioctl
> translation later and tested it for a bit here. It would be nice if
> you
> give it a go as well so if there are any bugs I'd like to iron them
> out
> before I MFC this piece in few weeks. Interestingly enough, I found
> mdconfig -l[v] is not working when i386 binary is run on amd64
> kernels, but
> it seems to have nothing to do with this change. It fails to
> mmap("/dev/devstat") in the geom userland libs. Turns out the
> mdconfig(8)
> is not using ioctl() but rather geom layer for the "list / query"
> functionality. In fact there is no CLI code in the system that would
> exercise either MDIOCLIST or MDIOCQUERY.  No userland code for the
> MDIOCLIST at all in the base and the only code that uses MDIOCQUERY
> is in
> some bsnmpd modules. For that reason I could not verify that it works
> 100%,
> but I've tested allocating device with and without label using i386
> binary
> on amd64 and it seems to DTRT. The label is retrieved properly when I
> query
> device with native 64-bit mdconfig.
> 
> It would be really nice to add extra mode flag into mdconfig so that
> it
> goes via those ioctl() rather than geom to fetch the device data
> data. If
> nothing else it would provide a basis to create an unit test for
> those
> ioctls.
> 
> -Max
> 
> On Tue, Aug 29, 2017 at 7:19 AM, Ian Lepore  wrote:
> 
> > 
> > On Mon, 2017-08-28 at 16:40 -0700, Maxim Sobolev wrote:
> > > 
> > > John, well, this depends on how you look at it. The padding
> > > element size
> > is
> > > 
> > > "int", which when you account for the alignment has the nice
> > > property on
> > > both 32 and 64-bit arches that no matter what kind of element you
> > > add
> > > (char, short, int or void *), you only need to bring down MDNPAD
> > > by 1 to
> > > keep the structure size the same. It also has a second
> > > interesting
> > property
> > > 
> > > that number of padding elements needed stays the same no matter
> > > if
> > > sizeof(void *) is 64 or 32, otherwise you would have to have
> > > MDNPAD
> > diverge
> > > 
> > > on 32 and 64 bit arches after adding pointer which has different
> > > sizes
> > > (just like you suggested it should originally). I am not 100%
> > > sure if it
> > > was intentionally designed like this by PHK from the day one, but
> > > I found
> > > it quite interesting. I am not quite sure if having
> > > sizeof(md_ioctl) is
> > > ever been required to stay the same between 64 and 32 bit arches.
> > > I don't
> > > think there is any support for having 32-bit mdconfig run on 64-
> > > bit
> > kernel.
> > > 
> > > 
> > > -Max
> > > 
> > mdconfig works in 32-bit jails on a 64-bit host, and I rely on that
> > being the case.  With poudriere evolving to become a general image
> > building tool, and with it being so jail-centric, it's likely to be
> > another use case.
> > 
> > -- Ian
> > 
> > > 
> > > On Mon, Aug 28, 2017 at 1:49 PM, John Baldwin 
> > > wrote:
> > > 
> > > > 
> > > > 
> > > > On Monday, August 28, 2017 12:46:48 PM Ryan Libby wrote:
> > > > > 
> > > > > 
> > > > > On Mon, Aug 28, 2017 at 11:24 AM, Maxim Sobolev  > > > > bsd.
> > > > > org>
> > > > wrote:
> > > > > 
> > > > > 
> > > > > > 
> > > > > > 
> > > > > > Hi John,
> > > > > > 
> > > > > > Thanks for your feedback! To address the points that you've
> > > > > > raised:
> > > > > > 
> > > > > > 1. I've tested on both 32 and 64 bit platforms, it seems
> > > > > > not to
> > > > > > be the
> > > > > > case. See imp's comment and my reply here
> > > > > > https://reviews.freebsd.org/D10457#216855 . Did I miss
> > > > > > something? Can
> > > > you
> > > > > 
> > > > > 
> > > > > > 
> > > > > > 
> > > > > > post piece of C code that produces different sizeof(struct
> > > > > > old)
> > > > > > vs.
> > > > > > sizeof(struct new) on some platform?
> > > > > [...]
> > > > > > 
> > > > > > 
> > > > > > On Mon, Aug 28, 2017 at 9:19 AM, John Baldwin  > > > > > org>
> > > > > > wrote:
> > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > On Monday, August 28, 2017 03:54:08 PM Maxim Sobolev
> > > > > > > wrote:
> > > > > > > > 
> > > > > > > > 
> > > > > > > > Author: sobomax
> > > > > > > > Date: Mon Aug 28 15:54:07 2017
> > > > > > > > New Revision: 322969
> > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/322969
> > > > > > > > 
> > > > > > > > Log:
> > > > > > > >   Add ability to label md(4) devices.
> > > > > > > > 
> > > > > > > >   This feature comes from the fact that we rely memory-
> > > > > > > > backed md(4)
> > > > > > > >   in our build process heavily. However, if the build
> > > > > > > > goes
> > > > > > > > 

Re: svn commit: r323053 - head/sys/dev/ntb/ntb_hw

2017-08-31 Thread Conrad Meyer
Hi Mav,

On Thu, Aug 31, 2017 at 6:41 AM, Alexander Motin  wrote:
> Author: mav
> Date: Thu Aug 31 13:41:44 2017
> New Revision: 323053
> URL: https://svnweb.freebsd.org/changeset/base/323053
>
> Log:
>   Fix port control for PEX 8749.
>
>   That chip has three Station Ports, so previous address math was incorrect.
>
>   MFC after:13 days
>   Sponsored by: iXsystems, Inc.
>
> Modified:
>   head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
>
> Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
> ==
> --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Aug 31 13:32:01 2017  
>   (r323052)
> +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Aug 31 13:41:44 2017  
>   (r323053)
> @@ -473,7 +473,7 @@ ntb_plx_link_enable(device_t dev, enum ntb_speed speed
> return (0);
> }
>
> -   reg = (sc->port < 8) ? 0x00208 : 0x08208;
> +   reg = ((sc->port & ~7) << 12) | 0x208;
> val = bus_read_4(sc->conf_res, reg);
> if ((val & (1 << (sc->port & 7))) == 0) {
> /* If already enabled, generate fake link event and exit. */
> @@ -495,7 +495,7 @@ ntb_plx_link_disable(device_t dev)
> if (sc->link)
> return (0);
>
> -   reg = (sc->port < 8) ? 0x00208 : 0x08208;
> +   reg = ((sc->port & ~7) << 12) | 0x208;
> val = bus_read_4(sc->conf_res, reg);
> val |= (1 << (sc->port & 7));
> bus_write_4(sc->conf_res, reg, val);
> @@ -512,7 +512,7 @@ ntb_plx_link_enabled(device_t dev)
> if (sc->link)
> return (TRUE);
>
> -   reg = (sc->port < 8) ? 0x00208 : 0x08208;
> +   reg = ((sc->port & ~7) << 12) | 0x208;
> val = bus_read_4(sc->conf_res, reg);
> return ((val & (1 << (sc->port & 7))) == 0);
>  }
>

To me, the duplication strongly suggests that this should be a macro.

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


svn commit: r323054 - head/sys/dev/nvme

2017-08-31 Thread Konstantin Belousov
Author: kib
Date: Thu Aug 31 14:21:32 2017
New Revision: 323054
URL: https://svnweb.freebsd.org/changeset/base/323054

Log:
  The nvme module should explicitly declare dependency on the cam.
  
  If both nvme and cam are compiled as modules, nvme cannot be kldloaded
  otherwise.
  
  Reviewed by:  imp
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/dev/nvme/nvme.c

Modified: head/sys/dev/nvme/nvme.c
==
--- head/sys/dev/nvme/nvme.cThu Aug 31 13:41:44 2017(r323053)
+++ head/sys/dev/nvme/nvme.cThu Aug 31 14:21:32 2017(r323054)
@@ -80,6 +80,7 @@ static driver_t nvme_pci_driver = {
 
 DRIVER_MODULE(nvme, pci, nvme_pci_driver, nvme_devclass, nvme_modevent, 0);
 MODULE_VERSION(nvme, 1);
+MODULE_DEPEND(nvme, cam, 1, 1, 1);
 
 static struct _pcsid
 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323053 - head/sys/dev/ntb/ntb_hw

2017-08-31 Thread Alexander Motin
Author: mav
Date: Thu Aug 31 13:41:44 2017
New Revision: 323053
URL: https://svnweb.freebsd.org/changeset/base/323053

Log:
  Fix port control for PEX 8749.
  
  That chip has three Station Ports, so previous address math was incorrect.
  
  MFC after:13 days
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
==
--- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Aug 31 13:32:01 2017
(r323052)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cThu Aug 31 13:41:44 2017
(r323053)
@@ -473,7 +473,7 @@ ntb_plx_link_enable(device_t dev, enum ntb_speed speed
return (0);
}
 
-   reg = (sc->port < 8) ? 0x00208 : 0x08208;
+   reg = ((sc->port & ~7) << 12) | 0x208;
val = bus_read_4(sc->conf_res, reg);
if ((val & (1 << (sc->port & 7))) == 0) {
/* If already enabled, generate fake link event and exit. */
@@ -495,7 +495,7 @@ ntb_plx_link_disable(device_t dev)
if (sc->link)
return (0);
 
-   reg = (sc->port < 8) ? 0x00208 : 0x08208;
+   reg = ((sc->port & ~7) << 12) | 0x208;
val = bus_read_4(sc->conf_res, reg);
val |= (1 << (sc->port & 7));
bus_write_4(sc->conf_res, reg, val);
@@ -512,7 +512,7 @@ ntb_plx_link_enabled(device_t dev)
if (sc->link)
return (TRUE);
 
-   reg = (sc->port < 8) ? 0x00208 : 0x08208;
+   reg = ((sc->port & ~7) << 12) | 0x208;
val = bus_read_4(sc->conf_res, reg);
return ((val & (1 << (sc->port & 7))) == 0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323051 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2017-08-31 Thread Baptiste Daroussin
Author: bapt
Date: Thu Aug 31 13:02:17 2017
New Revision: 323051
URL: https://svnweb.freebsd.org/changeset/base/323051

Log:
  Add sysctls for arc shrinking and growing values
  
  The default value for arc_no_grow_shift may not be optimal when using
  several GiB ARC. Expose it via sysctl allows users to tune it easily.
  
  Also expose arc_grow_retry via sysctl for the same reason. The default value 
of
  60s might, in case of intensive load, be too long.
  
  Submitted by: Nikita Kozlov 
  Reviewed by:  mav, manu, bapt
  MFC after:2 weeks
  Sponsored by: blade
  Differential Revision:https://reviews.freebsd.org/D12144

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Thu Aug 31 
12:36:09 2017(r323050)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Thu Aug 31 
13:02:17 2017(r323051)
@@ -358,6 +358,7 @@ uint64_t zfs_arc_meta_limit = 0;
 uint64_t zfs_arc_meta_min = 0;
 int zfs_arc_grow_retry = 0;
 int zfs_arc_shrink_shift = 0;
+int zfs_arc_no_grow_shift = 0;
 int zfs_arc_p_min_shift = 0;
 uint64_t zfs_arc_average_blocksize = 8 * 1024; /* 8KB */
 u_int zfs_arc_free_target = 0;
@@ -371,6 +372,7 @@ static int sysctl_vfs_zfs_arc_free_target(SYSCTL_HANDL
 static int sysctl_vfs_zfs_arc_meta_limit(SYSCTL_HANDLER_ARGS);
 static int sysctl_vfs_zfs_arc_max(SYSCTL_HANDLER_ARGS);
 static int sysctl_vfs_zfs_arc_min(SYSCTL_HANDLER_ARGS);
+static int sysctl_vfs_zfs_arc_no_grow_shift(SYSCTL_HANDLER_ARGS);
 
 #if defined(__FreeBSD__) && defined(_KERNEL)
 static void
@@ -385,17 +387,25 @@ SYSINIT(arc_free_target_init, SI_SUB_KTHREAD_PAGE, SI_
 TUNABLE_QUAD("vfs.zfs.arc_meta_limit", _arc_meta_limit);
 TUNABLE_QUAD("vfs.zfs.arc_meta_min", _arc_meta_min);
 TUNABLE_INT("vfs.zfs.arc_shrink_shift", _arc_shrink_shift);
+TUNABLE_INT("vfs.zfs.arc_grow_retry", _arc_grow_retry);
+TUNABLE_INT("vfs.zfs.arc_no_grow_shift", _arc_no_grow_shift);
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_max, CTLTYPE_U64 | CTLFLAG_RWTUN,
 0, sizeof(uint64_t), sysctl_vfs_zfs_arc_max, "QU", "Maximum ARC size");
 SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_min, CTLTYPE_U64 | CTLFLAG_RWTUN,
 0, sizeof(uint64_t), sysctl_vfs_zfs_arc_min, "QU", "Minimum ARC size");
+SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_no_grow_shift, CTLTYPE_U32 | CTLFLAG_RWTUN,
+0, sizeof(uint32_t), sysctl_vfs_zfs_arc_no_grow_shift, "U",
+"log2(fraction of ARC which must be free to allow growing)");
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_average_blocksize, CTLFLAG_RDTUN,
 _arc_average_blocksize, 0,
 "ARC average blocksize");
 SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_shrink_shift, CTLFLAG_RW,
 _shrink_shift, 0,
 "log2(fraction of arc to reclaim)");
+SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_grow_retry, CTLFLAG_RW,
+_grow_retry, 0,
+"Wait in seconds before considering growing ARC");
 SYSCTL_INT(_vfs_zfs, OID_AUTO, compressed_arc_enabled, CTLFLAG_RDTUN,
 _compressed_arc_enabled, 0, "Enable compressed ARC");
 
@@ -1065,6 +1075,24 @@ sysctl_vfs_zfs_arc_meta_limit(SYSCTL_HANDLER_ARGS)
 }
 
 static int
+sysctl_vfs_zfs_arc_no_grow_shift(SYSCTL_HANDLER_ARGS)
+{
+   uint32_t val;
+   int err;
+
+   val = arc_no_grow_shift;
+   err = sysctl_handle_32(oidp, , 0, req);
+   if (err != 0 || req->newptr == NULL)
+   return (err);
+
+if (val >= arc_shrink_shift)
+   return (EINVAL);
+
+   arc_no_grow_shift = val;
+   return (0);
+}
+
+static int
 sysctl_vfs_zfs_arc_max(SYSCTL_HANDLER_ARGS)
 {
uint64_t val;
@@ -6505,6 +6533,8 @@ arc_init(void)
if (zfs_arc_shrink_shift > 0)
arc_shrink_shift = zfs_arc_shrink_shift;
 
+   if (zfs_arc_no_grow_shift > 0)
+   arc_no_grow_shift = zfs_arc_no_grow_shift;
/*
 * Ensure that arc_no_grow_shift is less than arc_shrink_shift.
 */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323049 - head/contrib/unbound/validator

2017-08-31 Thread Dag-Erling Smørgrav
Author: des
Date: Thu Aug 31 12:02:14 2017
New Revision: 323049
URL: https://svnweb.freebsd.org/changeset/base/323049

Log:
  Merge upstream r4302 to support multiple concurrently valid anchors.
  
  If an unpatched unbound-anchor is run without a preexisting root anchor
  between 2017-09-11 and 2017-10-11, it will fail and Unbound will not be
  able to start unless the validator is disabled.  An EN will be issued
  with patches for existing systems and information on how to work around
  the issue on new installations.

Modified:
  head/contrib/unbound/validator/autotrust.c
Directory Properties:
  head/contrib/unbound/   (props changed)

Modified: head/contrib/unbound/validator/autotrust.c
==
--- head/contrib/unbound/validator/autotrust.c  Thu Aug 31 11:43:21 2017
(r323048)
+++ head/contrib/unbound/validator/autotrust.c  Thu Aug 31 12:02:14 2017
(r323049)
@@ -1571,6 +1571,11 @@ key_matches_a_ds(struct module_env* env, struct val_en
verbose(VERB_ALGO, "DS match attempt failed");
continue;
}
+   /* match of hash is sufficient for bootstrap of trust point */
+   (void)reason;
+   (void)ve;
+   return 1;
+   /* no need to check RRSIG, DS hash already matched with source
if(dnskey_verify_rrset(env, ve, dnskey_rrset, 
dnskey_rrset, key_idx, ) == sec_status_secure) {
return 1;
@@ -1578,6 +1583,7 @@ key_matches_a_ds(struct module_env* env, struct val_en
verbose(VERB_ALGO, "DS match failed because the key "
"does not verify the keyset: %s", reason);
}
+   */
}
return 0;
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r323027 - in head/sys: dev/e1000 net

2017-08-31 Thread Oleg Bulyzhin
On Wed, Aug 30, 2017 at 06:56:24PM +, Sean Bruno wrote:
> Author: sbruno
> Date: Wed Aug 30 18:56:24 2017
> New Revision: 323027
> URL: https://svnweb.freebsd.org/changeset/base/323027
> 
> Log:
>   Revert r323008 and its conversion of e1000/iflib to using SX locks.
>   
>   This seems to be missing something on the 82574L causing NFS root mounts
>   to hang.

JFYI: with r323008 my test machine keeps crashing during boot:

[skipped]

pcib3: allocated I/O port range (0xdc00-0xdc1f) for rid 18 of pci0:3:0:0
pcib3: matched entry for 3.0.INTA
pcib3: slot 0 INTA hardwired to IRQ 17
em0:  port 0xdc00-0xdc1f mem 
0xfeae-0xfeaf,0xfeac-0xfead irq 17 at device 0.0 on pci3
em0: attach_pre capping queues at 1
panic: unknown mac type e

cpuid = 0
time = 1
KDB: enter: panic
[ thread pid 0 tid 10 ]
Stopped at  kdb_enter+0x3b: movq$0,kdb_why
db> bt
Tracing pid 0 tid 10 td 0x80bd5c80
kdb_enter() at kdb_enter+0x3b/frame 0x80ffc2b0
vpanic() at vpanic+0x1b9/frame 0x80ffc330
panic() at panic+0x43/frame 0x80ffc390
e1000_reset_hw_82571() at e1000_reset_hw_82571+0x626/frame 0x80ffc3d0
em_if_attach_pre() at em_if_attach_pre+0xe49/frame 0x80ffc440
iflib_device_register() at iflib_device_register+0x74b/frame 0x80ffc760
iflib_device_attach() at iflib_device_attach+0xb7/frame 0x80ffc790
device_attach() at device_attach+0x3ee/frame 0x80ffc7d0
bus_generic_attach() at bus_generic_attach+0x5a/frame 0x80ffc7f0
pci_attach() at pci_attach+0xd5/frame 0x80ffc830
device_attach() at device_attach+0x3ee/frame 0x80ffc870
bus_generic_attach() at bus_generic_attach+0x5a/frame 0x80ffc890
acpi_pcib_pci_attach() at acpi_pcib_pci_attach+0xa1/frame 0x80ffc8d0
device_attach() at device_attach+0x3ee/frame 0x80ffc910
bus_generic_attach() at bus_generic_attach+0x5a/frame 0x80ffc930
pci_attach() at pci_attach+0xd5/frame 0x80ffc970
device_attach() at device_attach+0x3ee/frame 0x80ffc9b0
bus_generic_attach() at bus_generic_attach+0x5a/frame 0x80ffc9d0
acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x3bc/frame 0x80ffca40
--More--^M^Mdevice_attach() at device_attach+0x3ee/frame 
0x80ffca80
bus_generic_attach() at bus_generic_attach+0x5a/frame 0x80ffcaa0
acpi_attach() at acpi_attach+0xe85/frame 0x80ffcb50
device_attach() at device_attach+0x3ee/frame 0x80ffcb90
bus_generic_attach() at bus_generic_attach+0x5a/frame 0x80ffcbb0
nexus_acpi_attach() at nexus_acpi_attach+0x73/frame 0x80ffcbe0
device_attach() at device_attach+0x3ee/frame 0x80ffcc20
bus_generic_new_pass() at bus_generic_new_pass+0x116/frame 0x80ffcc50
bus_set_pass() at bus_set_pass+0x8c/frame 0x80ffcc80
configure() at configure+0x9/frame 0x80ffcc90
mi_startup() at mi_startup+0x9c/frame 0x80ffccb0
btext() at btext+0x2c
db>

Hardware is:
# pciconf -lv|grep -A4 em0
em0@pci0:3:0:0: class=0x02 card=0x10828086 chip=0x107d8086 rev=0x06 hdr=0x00
vendor = 'Intel Corporation'
device = '82572EI Gigabit Ethernet Controller (Copper)'
class  = network
subclass   = ethernet

-- 
Oleg.


=== Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- o...@rinet.ru ===


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


svn commit: r323047 - head/sys/dev/ntb

2017-08-31 Thread Alexander Motin
Author: mav
Date: Thu Aug 31 10:59:39 2017
New Revision: 323047
URL: https://svnweb.freebsd.org/changeset/base/323047

Log:
  Make ntb_set_ctx() always generate fake link event.
  
  It allows application driver get initial link state without racing with
  hardware interrupts, thanks to the context rmlock held here.
  
  MFC after:1 week
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/dev/ntb/ntb.c

Modified: head/sys/dev/ntb/ntb.c
==
--- head/sys/dev/ntb/ntb.c  Thu Aug 31 10:53:10 2017(r323046)
+++ head/sys/dev/ntb/ntb.c  Thu Aug 31 10:59:39 2017(r323047)
@@ -264,6 +264,13 @@ ntb_set_ctx(device_t ntb, void *ctx, const struct ntb_
}
nc->ctx = ctx;
nc->ctx_ops = ctx_ops;
+
+   /*
+* If applicaiton driver asks for link events, generate fake one now
+* to let it update link state without races while we hold the lock.
+*/
+   if (ctx_ops->link_event != NULL)
+   ctx_ops->link_event(ctx);
rm_wunlock(>ctx_lock);
 
return (0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r323046 - head/sys/dev/ntb

2017-08-31 Thread Alexander Motin
Author: mav
Date: Thu Aug 31 10:53:10 2017
New Revision: 323046
URL: https://svnweb.freebsd.org/changeset/base/323046

Log:
  Make ntb_transport(4) ready receive early link events.
  
  Those events may be reported as soon as callback is registered, if the link
  is enabled by hardware or some other application.
  
  While there, clean link_is_up variable on link down event.
  
  MFC after:1 week

Modified:
  head/sys/dev/ntb/ntb_transport.c

Modified: head/sys/dev/ntb/ntb_transport.c
==
--- head/sys/dev/ntb/ntb_transport.cThu Aug 31 09:08:06 2017
(r323045)
+++ head/sys/dev/ntb/ntb_transport.cThu Aug 31 10:53:10 2017
(r323046)
@@ -442,12 +442,12 @@ ntb_transport_attach(device_t dev)
callout_init(>link_work, 0);
callout_init(>link_watchdog, 0);
TASK_INIT(>link_cleanup, 0, ntb_transport_link_cleanup_work, nt);
+   nt->link_is_up = false;
 
rc = ntb_set_ctx(dev, nt, _transport_ops);
if (rc != 0)
goto err;
 
-   nt->link_is_up = false;
ntb_link_enable(dev, NTB_SPEED_AUTO, NTB_WIDTH_AUTO);
 
if (enable_xeon_watchdog != 0)
@@ -1279,6 +1279,9 @@ ntb_transport_link_cleanup(struct ntb_transport_ctx *n
struct ntb_transport_qp *qp;
int i;
 
+   callout_drain(>link_work);
+   nt->link_is_up = 0;
+
/* Pass along the info to any clients */
for (i = 0; i < nt->qp_count; i++) {
if ((nt->qp_bitmap & (1 << i)) != 0) {
@@ -1287,9 +1290,6 @@ ntb_transport_link_cleanup(struct ntb_transport_ctx *n
callout_drain(>link_work);
}
}
-
-   if (!nt->link_is_up)
-   callout_drain(>link_work);
 
/*
 * The scratchpad registers keep the values if the remote side
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2017-08-31 Thread Alexander Motin
Author: mav
Date: Thu Aug 31 09:08:06 2017
New Revision: 323045
URL: https://svnweb.freebsd.org/changeset/base/323045

Log:
  Fix flags field decoding in ACPI_NFIT_CONTROL_REGION.
  
  It looked like incomplete copy/paste, printing absolute garbage.
  
  While there, print ValidFields field ax hex, since it is a bitmask.
  
  MFC after:3 days

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

Modified: head/usr.sbin/acpi/acpidump/acpi.c
==
--- head/usr.sbin/acpi/acpidump/acpi.c  Thu Aug 31 02:37:44 2017
(r323044)
+++ head/usr.sbin/acpi/acpidump/acpi.c  Thu Aug 31 09:08:06 2017
(r323045)
@@ -1277,7 +1277,7 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit)
(u_int)ctlreg->SubsystemDeviceId);
printf("\tSubsystemRevisionId=%u\n",
(u_int)ctlreg->SubsystemRevisionId);
-   printf("\tValidFields=%u\n", (u_int)ctlreg->ValidFields);
+   printf("\tValidFields=0x%02x\n", (u_int)ctlreg->ValidFields);
printf("\tManufacturingLocation=%u\n",
(u_int)ctlreg->ManufacturingLocation);
printf("\tManufacturingDate=%u\n",
@@ -1300,8 +1300,7 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit)
 #define PRINTFLAG(var, flag)   printflag((var), ACPI_NFIT_## flag, #flag)
 
printf("\tFlags=");
-   PRINTFLAG(mmap->Flags, ADD_ONLINE_ONLY);
-   PRINTFLAG(mmap->Flags, PROXIMITY_VALID);
+   PRINTFLAG(ctlreg->Flags, CONTROL_BUFFERED);
PRINTFLAG_END();
 
 #undef PRINTFLAG
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"