svn commit: r298574 - in head/sys/dev/hyperv: include vmbus

2016-04-25 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Apr 25 09:00:06 2016
New Revision: 298574
URL: https://svnweb.freebsd.org/changeset/base/298574

Log:
  hyperv/channel: Add functions to synchronize sub-channel offers
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/dev/hyperv/include/hyperv.h
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c

Modified: head/sys/dev/hyperv/include/hyperv.h
==
--- head/sys/dev/hyperv/include/hyperv.hMon Apr 25 06:08:45 2016
(r298573)
+++ head/sys/dev/hyperv/include/hyperv.hMon Apr 25 09:00:06 2016
(r298574)
@@ -818,6 +818,7 @@ typedef struct hv_vmbus_channel {
 */
TAILQ_HEAD(, hv_vmbus_channel)  sc_list_anchor;
TAILQ_ENTRY(hv_vmbus_channel)   sc_list_entry;
+   int subchan_cnt;
 
/*
 * The primary channel this sub-channle belongs to.
@@ -914,6 +915,9 @@ int hv_vmbus_channel_teardown_gpdal(
 struct hv_vmbus_channel* vmbus_select_outgoing_channel(struct hv_vmbus_channel 
*promary);
 
 void   vmbus_channel_cpu_set(struct hv_vmbus_channel *chan, int cpu);
+struct hv_vmbus_channel **
+   vmbus_get_subchan(struct hv_vmbus_channel *pri_chan, int 
subchan_cnt);
+void   vmbus_rel_subchan(struct hv_vmbus_channel **subchan, int 
subchan_cnt);
 
 /**
  * @brief Get physical address from virtual

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Apr 25 06:08:45 2016
(r298573)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Apr 25 09:00:06 2016
(r298574)
@@ -239,6 +239,17 @@ vmbus_channel_process_offer(hv_vmbus_cha
new_channel->state = HV_CHANNEL_OPEN_STATE;
if (channel->sc_creation_callback != NULL)
channel->sc_creation_callback(new_channel);
+
+   /*
+* Bump up sub-channel count and notify anyone that is
+* interested in this sub-channel, after this 
sub-channel
+* is setup.
+*/
+   mtx_lock(&channel->sc_lock);
+   channel->subchan_cnt++;
+   mtx_unlock(&channel->sc_lock);
+   wakeup(channel);
+
return;
}
 
@@ -771,3 +782,41 @@ vmbus_scan(void)
mtx_sleep(&vmbus_devcnt, &vmbus_chwait_lock, 0, "waitdev", 0);
mtx_unlock(&vmbus_chwait_lock);
 }
+
+struct hv_vmbus_channel **
+vmbus_get_subchan(struct hv_vmbus_channel *pri_chan, int subchan_cnt)
+{
+   struct hv_vmbus_channel **ret, *chan;
+   int i;
+
+   ret = malloc(subchan_cnt * sizeof(struct hv_vmbus_channel *), M_TEMP,
+   M_WAITOK);
+
+   mtx_lock(&pri_chan->sc_lock);
+
+   while (pri_chan->subchan_cnt < subchan_cnt)
+   mtx_sleep(pri_chan, &pri_chan->sc_lock, 0, "subch", 0);
+
+   i = 0;
+   TAILQ_FOREACH(chan, &pri_chan->sc_list_anchor, sc_list_entry) {
+   /* TODO: refcnt chan */
+   ret[i] = chan;
+
+   ++i;
+   if (i == subchan_cnt)
+   break;
+   }
+   KASSERT(i == subchan_cnt, ("invalid subchan count %d, should be %d",
+   pri_chan->subchan_cnt, subchan_cnt));
+
+   mtx_unlock(&pri_chan->sc_lock);
+
+   return ret;
+}
+
+void
+vmbus_rel_subchan(struct hv_vmbus_channel **subchan, int subchan_cnt __unused)
+{
+
+   free(subchan, M_TEMP);
+}
___
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: r298575 - head/sys/dev/hyperv/netvsc

2016-04-25 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Apr 25 10:16:07 2016
New Revision: 298575
URL: https://svnweb.freebsd.org/changeset/base/298575

Log:
  hyperv/hn: Synchronize sub-channel offers
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Mon Apr 25 09:00:06 
2016(r298574)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Mon Apr 25 10:16:07 
2016(r298575)
@@ -421,7 +421,7 @@ static int
 netvsc_attach(device_t dev)
 {
struct hv_device *device_ctx = vmbus_get_devctx(dev);
-   struct hv_vmbus_channel *chan;
+   struct hv_vmbus_channel *pri_chan;
netvsc_device_info device_info;
hn_softc_t *sc;
int unit = device_get_unit(dev);
@@ -502,12 +502,12 @@ netvsc_attach(device_t dev)
/*
 * Associate the first TX/RX ring w/ the primary channel.
 */
-   chan = device_ctx->channel;
-   KASSERT(HV_VMBUS_CHAN_ISPRIMARY(chan), ("not primary channel"));
-   KASSERT(chan->offer_msg.offer.sub_channel_index == 0,
+   pri_chan = device_ctx->channel;
+   KASSERT(HV_VMBUS_CHAN_ISPRIMARY(pri_chan), ("not primary channel"));
+   KASSERT(pri_chan->offer_msg.offer.sub_channel_index == 0,
("primary channel subidx %u",
-chan->offer_msg.offer.sub_channel_index));
-   hn_channel_attach(sc, chan);
+pri_chan->offer_msg.offer.sub_channel_index));
+   hn_channel_attach(sc, pri_chan);
 
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = hn_ioctl;
@@ -547,6 +547,19 @@ netvsc_attach(device_t dev)
error = hv_rf_on_device_add(device_ctx, &device_info, ring_cnt);
if (error)
goto failed;
+
+   if (sc->net_dev->num_channel > 1) {
+   struct hv_vmbus_channel **subchan;
+   int subchan_cnt = sc->net_dev->num_channel - 1;
+
+   /*
+* Wait for sub-channels setup to complete.
+*/
+   subchan = vmbus_get_subchan(pri_chan, subchan_cnt);
+   vmbus_rel_subchan(subchan, subchan_cnt);
+   device_printf(dev, "%d sub-channels setup done\n", subchan_cnt);
+   }
+
KASSERT(sc->net_dev->num_channel > 0 &&
sc->net_dev->num_channel <= sc->hn_rx_ring_inuse,
("invalid channel count %u, should be less than %d",
___
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: r298543 - head/sys/ofed/drivers/infiniband/core

2016-04-25 Thread Hans Petter Selasky

On 04/24/16 17:56, Bjoern A. Zeeb wrote:

Author: bz
Date: Sun Apr 24 15:56:05 2016
New Revision: 298543
URL: https://svnweb.freebsd.org/changeset/base/298543

Log:
   Fix NOIP kernels to compile.

Modified:
   head/sys/ofed/drivers/infiniband/core/cma.c

Modified: head/sys/ofed/drivers/infiniband/core/cma.c
==
--- head/sys/ofed/drivers/infiniband/core/cma.c Sun Apr 24 14:49:01 2016
(r298542)
+++ head/sys/ofed/drivers/infiniband/core/cma.c Sun Apr 24 15:56:05 2016
(r298543)
@@ -2319,6 +2319,7 @@ static int cma_bind_addr(struct rdma_cm_
if (!cma_any_addr(src_addr))
return rdma_bind_addr(id, src_addr);
else {
+#if defined(INET6) || defined(INET)
union {
  #ifdef INET
struct sockaddr_in in;
@@ -2327,6 +2328,7 @@ static int cma_bind_addr(struct rdma_cm_
struct sockaddr_in6 in6;
  #endif
} addr;
+#endif

switch(dst_addr->sa_family) {
  #ifdef INET




Thank you Bjoern!

--HPS
___
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: r298577 - head/usr.bin/mkuzip

2016-04-25 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Apr 25 13:20:35 2016
New Revision: 298577
URL: https://svnweb.freebsd.org/changeset/base/298577

Log:
  Try to make gcc builds happy again by removing a redundant declaration.

Modified:
  head/usr.bin/mkuzip/mkuzip.c

Modified: head/usr.bin/mkuzip/mkuzip.c
==
--- head/usr.bin/mkuzip/mkuzip.cMon Apr 25 12:25:30 2016
(r298576)
+++ head/usr.bin/mkuzip/mkuzip.cMon Apr 25 13:20:35 2016
(r298577)
@@ -78,7 +78,6 @@ static struct mkuz_format ulzma_fmt = {
 static struct mkuz_blk *readblock(int, u_int32_t);
 static void usage(void);
 static void cleanup(void);
-int mkuz_memvcmp(const void *, unsigned char, size_t);
 
 static char *cleanfile = NULL;
 
___
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: r298578 - in head/sys: conf riscv/riscv

2016-04-25 Thread Ruslan Bukin
Author: br
Date: Mon Apr 25 13:20:57 2016
New Revision: 298578
URL: https://svnweb.freebsd.org/changeset/base/298578

Log:
  Revert r298477 ("Clear the DDR memory").
  
  There is no need to clear all the DDR memory (we only need to clear
  BSS section).
  I was playing with non-default version of hardware (the bitfile
  synthesized for 4-level page memory system) and clearing was helpful,
  but then realized support for 4-level page system is untested/broken
  in both RocketCore and lowRISC.

Modified:
  head/sys/conf/options.riscv
  head/sys/riscv/riscv/locore.S

Modified: head/sys/conf/options.riscv
==
--- head/sys/conf/options.riscv Mon Apr 25 13:20:35 2016(r298577)
+++ head/sys/conf/options.riscv Mon Apr 25 13:20:57 2016(r298578)
@@ -2,4 +2,3 @@
 
 RISCV  opt_global.h
 VFPopt_global.h
-DDR_CLEAR_SIZE opt_global.h

Modified: head/sys/riscv/riscv/locore.S
==
--- head/sys/riscv/riscv/locore.S   Mon Apr 25 13:20:35 2016
(r298577)
+++ head/sys/riscv/riscv/locore.S   Mon Apr 25 13:20:57 2016
(r298578)
@@ -126,17 +126,6 @@ _start:
csrra0, mhartid
bneza0, mpentry
 
-#if defined(DDR_CLEAR_SIZE)
-   /* Clear DDR memory */
-   la  t0, _end
-   li  t1, DDR_CLEAR_SIZE
-1:
-   sd  zero, 0(t0)
-   addit0, t0, 8
-   bltut0, t1, 1b
-   /* End */
-#endif
-
/* Build event queue for current core */
build_ring
 
___
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: r298579 - head/sys/riscv/riscv

2016-04-25 Thread Ruslan Bukin
Author: br
Date: Mon Apr 25 13:30:37 2016
New Revision: 298579
URL: https://svnweb.freebsd.org/changeset/base/298579

Log:
  Do not setup machine exception vector.
  
  Sounds strange, but both RocketCore and lowRISC do not operate
  if we set it.
  
  All the known implementations (Spike, QEMU, RocketCore, lowRISC) uses
  default machine trap vector address and operates fine with this.
  
  Original Berkeley Boot Loader (bbl) does not set this as well.
  
  Sponsored by: DARPA, AFRL
  Sponsored by: HEIF5

Modified:
  head/sys/riscv/riscv/locore.S

Modified: head/sys/riscv/riscv/locore.S
==
--- head/sys/riscv/riscv/locore.S   Mon Apr 25 13:20:57 2016
(r298578)
+++ head/sys/riscv/riscv/locore.S   Mon Apr 25 13:30:37 2016
(r298579)
@@ -133,9 +133,6 @@ _start:
la  t0, hardstack_end
csrwmscratch, t0
 
-   la  t0, mentry
-   csrwmtvec, t0
-
li  t0, 0
csrwsscratch, t0
 
@@ -335,10 +332,6 @@ ENTRY(mpentry)
lw  t1, 0(t0)
beqzt1, 1b
 
-   /* Setup machine exception vector */
-   la  t0, mentry
-   csrwmtvec, t0
-
/* Build event queue ring for this core */
build_ring
 
___
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: r298443 - head/usr.bin/stat

2016-04-25 Thread Pedro Giffuni

Marcelo, please revert.

And check your script, of course.

Pedro.

On 23/04/2016 04:23, luke wrote:
On Fri, Apr 22, 2016 at 11:43 AM, Marcelo Araujo > wrote:


Author: araujo
Date: Fri Apr 22 03:43:06 2016
New Revision: 298443
URL: https://svnweb.freebsd.org/changeset/base/298443

Log:
  Use macro MAX() from sys/param.h.

  MFC after:2 weeks.

Modified:
  head/usr.bin/stat/stat.c

Modified: head/usr.bin/stat/stat.c

==
--- head/usr.bin/stat/stat.cFri Apr 22 03:37:27 2016  
(r298442)
+++ head/usr.bin/stat/stat.cFri Apr 22 03:43:06 2016  
(r298443)

@@ -1025,7 +1025,7 @@ format1(const struct stat *st,
 *
 * Nanoseconds: long.
 */
-   (void)snprintf(tmp, sizeof(tmp), "%dld", prec > 9
? 9 : prec);
+   (void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9,
prec));
(void)strcat(lfmt, tmp);

/*
___
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
"



Hi,

Should this be MIN() ?

(void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9));


--
Chang-Hsien Tsai



___
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: r298580 - in head/sys/riscv: include riscv

2016-04-25 Thread Ruslan Bukin
Author: br
Date: Mon Apr 25 14:47:51 2016
New Revision: 298580
URL: https://svnweb.freebsd.org/changeset/base/298580

Log:
  o Implement shared pagetables and switch from 4 to 3 levels page
  memory system.
  
  RISC-V ISA has only single page table base register for both kernel
  and user addresses translation. Before this commit we were using an
  extra (4th) level of pagetables for switching between kernel and user
  pagetables, but then realized FPGA hardware has 3-level page system
  hardcoded. It is also become clear that the bitfile synthesized for
  4-level system is untested/broken, so we can't use extra level for
  switching.
  
  We are now share level 1 of pagetables between kernel and user VA.
  This requires to keep track of all the user pmaps created and once we
  adding L1 page to kernel pmap we have to add it to all the user pmaps.
  
  o Change the VM layout as we must have topmost bit to be 1 in the
selected page system for kernel addresses and 0 for user addresses.
  o Implement pmap_kenter_device().
  o Create the l3 tables for the early devmap.
  
  Sponsored by: DARPA, AFRL
  Sponsored by: HEIF5

Modified:
  head/sys/riscv/include/pcpu.h
  head/sys/riscv/include/pmap.h
  head/sys/riscv/include/vmparam.h
  head/sys/riscv/riscv/genassym.c
  head/sys/riscv/riscv/locore.S
  head/sys/riscv/riscv/machdep.c
  head/sys/riscv/riscv/pmap.c
  head/sys/riscv/riscv/swtch.S

Modified: head/sys/riscv/include/pcpu.h
==
--- head/sys/riscv/include/pcpu.h   Mon Apr 25 13:30:37 2016
(r298579)
+++ head/sys/riscv/include/pcpu.h   Mon Apr 25 14:47:51 2016
(r298580)
@@ -46,9 +46,8 @@
 
 #definePCPU_MD_FIELDS  
\
uint32_t pc_pending_ipis;   /* IPIs pending to this CPU */  \
-   uint64_t pc_sptbr;  /* L0 page table base (VA) */   \
uint64_t pc_reg;/* CPU MMIO base (PA) */\
-   char __pad[109]
+   char __pad[117]
 
 #ifdef _KERNEL
 

Modified: head/sys/riscv/include/pmap.h
==
--- head/sys/riscv/include/pmap.h   Mon Apr 25 13:30:37 2016
(r298579)
+++ head/sys/riscv/include/pmap.h   Mon Apr 25 14:47:51 2016
(r298580)
@@ -74,12 +74,18 @@ struct pv_addr {
vm_paddr_t  pv_pa;
 };
 
+/* An entry in the list of all pmaps */
+struct pmap_list_entry {
+   SLIST_ENTRY(pmap_list_entry) pmap_link;
+   struct pmap *pmap;
+};
 
 struct pmap {
struct mtx  pm_mtx;
struct pmap_statistics  pm_stats;   /* pmap statictics */
pd_entry_t  *pm_l1;
TAILQ_HEAD(,pv_chunk)   pm_pvchunk; /* list of mappings in pmap */
+   struct pmap_list_entry  *p_entry; /* Place in the list of all pmaps */
 };
 
 typedef struct pv_entry {

Modified: head/sys/riscv/include/vmparam.h
==
--- head/sys/riscv/include/vmparam.hMon Apr 25 13:30:37 2016
(r298579)
+++ head/sys/riscv/include/vmparam.hMon Apr 25 14:47:51 2016
(r298580)
@@ -153,12 +153,12 @@
 #defineVM_MAX_ADDRESS  (0xUL)
 
 /* 32 GiB of kernel addresses */
-#defineVM_MIN_KERNEL_ADDRESS   (0xff80UL)
-#defineVM_MAX_KERNEL_ADDRESS   (0xff88UL)
+#defineVM_MIN_KERNEL_ADDRESS   (0xffc0UL)
+#defineVM_MAX_KERNEL_ADDRESS   (0xffc8UL)
 
 /* Direct Map for 128 GiB of PA: 0x0 - 0x1f */
-#defineDMAP_MIN_ADDRESS(0xffc0UL)
-#defineDMAP_MAX_ADDRESS(0xffdfUL)
+#defineDMAP_MIN_ADDRESS(0xffd0UL)
+#defineDMAP_MAX_ADDRESS(0xffefUL)
 
 #defineDMAP_MIN_PHYSADDR   (0xUL)
 #defineDMAP_MAX_PHYSADDR   (DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS)
@@ -187,7 +187,7 @@
 })
 
 #defineVM_MIN_USER_ADDRESS (0xUL)
-#defineVM_MAX_USER_ADDRESS (0x0080UL)
+#defineVM_MAX_USER_ADDRESS (0x0040UL)
 
 #defineVM_MINUSER_ADDRESS  (VM_MIN_USER_ADDRESS)
 #defineVM_MAXUSER_ADDRESS  (VM_MAX_USER_ADDRESS)

Modified: head/sys/riscv/riscv/genassym.c
==
--- head/sys/riscv/riscv/genassym.c Mon Apr 25 13:30:37 2016
(r298579)
+++ head/sys/riscv/riscv/genassym.c Mon Apr 25 14:47:51 2016
(r298580)
@@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$");
 
 ASSYM(KERNBASE, KERNBASE);
 ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS);
+ASSYM(VM_MAX_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS);
 ASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
 ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
 
@@ -75,7 +76,6 @@ ASSYM(PCB_A, offsetof(struc

svn commit: r298581 - head/usr.bin/whois

2016-04-25 Thread Tony Finch
Author: fanf
Date: Mon Apr 25 15:46:42 2016
New Revision: 298581
URL: https://svnweb.freebsd.org/changeset/base/298581

Log:
  Example RIPE whois query with options and spaces.
  
  Since it is used in the example, mention the -- option in the synopsis
  even though it is a universal standard, and tweak to fit it on one line.

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

Modified: head/usr.bin/whois/whois.1
==
--- head/usr.bin/whois/whois.1  Mon Apr 25 14:47:51 2016(r298580)
+++ head/usr.bin/whois/whois.1  Mon Apr 25 15:46:42 2016(r298581)
@@ -28,7 +28,7 @@
 .\" From: @(#)whois.1  8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd January 23, 2016
+.Dd April 25, 2016
 .Dt WHOIS 1
 .Os
 .Sh NAME
@@ -37,8 +37,9 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl aAbfgiIklmPQrRS
-.Op Fl c Ar country-code | Fl h Ar host
+.Op Fl c Ar TLD | Fl h Ar host
 .Op Fl p Ar port
+.Op Fl -
 .Ar name ...
 .Sh DESCRIPTION
 The
@@ -90,11 +91,12 @@ Get query syntax documentation using
 Use the Network Abuse Clearinghouse database.
 It contains addresses to which network abuse should be reported,
 indexed by domain name.
-.It Fl c Ar country-code
+.It Fl c Ar TLD
 This is the equivalent of using the
 .Fl h
 option with an argument of
-.Qq Ar country-code Ns Li .whois-servers.net .
+.Qq Ar TLD Ns Li .whois-servers.net .
+This can be helpful for locating country-class TLD whois servers.
 .It Fl f
 Use the African Network Information Centre
 .Pq Tn AfriNIC
@@ -233,7 +235,7 @@ option as shown in the following example
 .Ar CONTACT-ID
 is substituted with the actual contact identifier.
 .Pp
-.Dl "whois -c RU CONTACT-ID"
+.Dl Ic whois -c RU CONTACT-ID
 .Pp
 (Note: This example is specific to the
 .Tn TLD
@@ -251,7 +253,25 @@ on port
 .Dq Li rwhois
 (written numerically as 4321).
 .Pp
-.Dl "whois -h whois.example.com -p rwhois query-data"
+.Dl Ic whois -h whois.example.com -p rwhois query-data
+.Pp
+Some whois servers support complex queries
+with dash-letter options.
+You can use the
+.Fl -
+option to separate
+.Nm
+command options from whois server query options.
+A query containing spaces must be quoted as one
+argument to the
+.Nm
+command.
+The following example asks the RIPE whois server
+to return a brief description of its
+.Dq Li domain
+object type:
+.Pp
+.Dl Ic whois -r -- '-t domain'
 .Sh SEE ALSO
 .Rs
 .%A Ken Harrenstien
___
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: r298580 - in head/sys/riscv: include riscv

2016-04-25 Thread Konstantin Belousov
On Mon, Apr 25, 2016 at 02:47:51PM +, Ruslan Bukin wrote:
> Author: br
> Date: Mon Apr 25 14:47:51 2016
> New Revision: 298580
> URL: https://svnweb.freebsd.org/changeset/base/298580
> 
> Log:
>   o Implement shared pagetables and switch from 4 to 3 levels page
>   memory system.

> +/* An entry in the list of all pmaps */
> +struct pmap_list_entry {
> + SLIST_ENTRY(pmap_list_entry) pmap_link;
> + struct pmap *pmap;
> +};

This is weird. Why do you need separate structure to track the all
pmaps list, instead of embedding the list link into pmap itself ? In
particular, the pmap_list_entry.pmap pointing to the pmap looks strange.

And why do you use single-linked list for the container where you need
to remove elements ?  The cost is the iteration over the whole container
on removal, vs. additional pointer in each pmap.
___
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: r298582 - head/sys/dev/iwm

2016-04-25 Thread Adrian Chadd
Author: adrian
Date: Mon Apr 25 16:13:04 2016
New Revision: 298582
URL: https://svnweb.freebsd.org/changeset/base/298582

Log:
  [iwn] fix firmware command use in iwm_auth().
  
  The iwm firmware has separate commands for add, modify and delete for
  various things (mac, phy context, etc.)  The openbsd driver has a habit
  of just completely resetting the NIC each time, which is technically
  mostly okay (as long as the reset doesn't actually fail!) but it means
  a lot of the code is doing ADD when it should do MODIFY.
  
  The firmware responds in kind - it just asserts.
  
  This fixes auth attempts that occur after the NIC has been already
  configured.
  
  (I'm sure there are more instances of this!)
  
  Tested:
  
  iwm0:  mem 0xf140-0xf1401fff irq 17 at 
device 0.0 on pci2
  iwm0: revision: 0x140, firmware 25.228 (API ver. 9)
  
  .. STA mode.
  
  Submitted by: Masachika ISHIZUKA 

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwm_binding.c
  head/sys/dev/iwm/if_iwm_binding.h
  head/sys/dev/iwm/if_iwm_time_event.c
  head/sys/dev/iwm/if_iwm_time_event.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Mon Apr 25 15:46:42 2016(r298581)
+++ head/sys/dev/iwm/if_iwm.c   Mon Apr 25 16:13:04 2016(r298582)
@@ -3159,7 +3159,6 @@ iwm_auth(struct ieee80211vap *vap, struc
struct iwm_node *in;
struct iwm_vap *iv = IWM_VAP(vap);
uint32_t duration;
-   uint32_t min_duration;
int error;
 
/*
@@ -3201,7 +3200,25 @@ iwm_auth(struct ieee80211vap *vap, struc
if (iv->is_uploaded) {
if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) {
device_printf(sc->sc_dev,
-   "%s: failed to add MAC\n", __func__);
+   "%s: failed to update MAC\n", __func__);
+   goto out;
+   }
+   if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0],
+   in->in_ni.ni_chan, 1, 1)) != 0) {
+   device_printf(sc->sc_dev,
+   "%s: failed update phy ctxt\n", __func__);
+   goto out;
+   }
+   in->in_phyctxt = &sc->sc_phyctxt[0];
+
+   if ((error = iwm_mvm_binding_update(sc, in)) != 0) {
+   device_printf(sc->sc_dev,
+   "%s: binding update cmd\n", __func__);
+   goto out;
+   }
+   if ((error = iwm_mvm_update_sta(sc, in)) != 0) {
+   device_printf(sc->sc_dev,
+   "%s: failed to update sta\n", __func__);
goto out;
}
} else {
@@ -3210,61 +3227,36 @@ iwm_auth(struct ieee80211vap *vap, struc
"%s: failed to add MAC\n", __func__);
goto out;
}
-   }
-
-   if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0],
-   in->in_ni.ni_chan, 1, 1)) != 0) {
-   device_printf(sc->sc_dev,
-   "%s: failed add phy ctxt\n", __func__);
-   goto out;
-   }
-   in->in_phyctxt = &sc->sc_phyctxt[0];
-
-   if ((error = iwm_mvm_binding_add_vif(sc, in)) != 0) {
-   device_printf(sc->sc_dev,
-   "%s: binding cmd\n", __func__);
-   goto out;
-   }
-
-   if ((error = iwm_mvm_add_sta(sc, in)) != 0) {
-   device_printf(sc->sc_dev,
-   "%s: failed to add MAC\n", __func__);
-   goto out;
-   }
-
-   /* a bit superfluous? */
-   while (sc->sc_auth_prot)
-   msleep(&sc->sc_auth_prot, &sc->sc_mtx, 0, "iwmauth", 0);
-   sc->sc_auth_prot = 1;
-
-   duration = min(IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS,
-   200 + in->in_ni.ni_intval);
-   min_duration = min(IWM_MVM_TE_SESSION_PROTECTION_MIN_TIME_MS,
-   100 + in->in_ni.ni_intval);
-   iwm_mvm_protect_session(sc, in, duration, min_duration, 500);
-
-   IWM_DPRINTF(sc, IWM_DEBUG_RESET,
-   "%s: waiting for auth_prot\n", __func__);
-   while (sc->sc_auth_prot != 2) {
-   /*
-* well, meh, but if the kernel is sleeping for half a
-* second, we have bigger problems
-*/
-   if (sc->sc_auth_prot == 0) {
+   if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0],
+   in->in_ni.ni_chan, 1, 1)) != 0) {
device_printf(sc->sc_dev,
-   "%s: missed auth window!\n", __func__);
+   "%s: failed add phy ctxt!\n", __func__);
error = ETIMEDOUT;
goto out;
-   } else if (sc->sc_auth_prot == -1) {
+   }
+   

svn commit: r298583 - head/sys/dev/bhnd/cores/chipc

2016-04-25 Thread Adrian Chadd
Author: adrian
Date: Mon Apr 25 16:53:13 2016
New Revision: 298583
URL: https://svnweb.freebsd.org/changeset/base/298583

Log:
  [bhnd] Fix ChipCommon probing.
  
  ChipCommon probing uses mapping table "chipc_devices". It calls 
bhnd_device_lookup,
  which iterate over mapping table with end condition:
  
  entry->desc != NULL
  
  So if mapping table contains row with description equals to NULL, it will
  stop processing of mapping. I.e. description is mandatory field and should
  be not NULL.
  
  This patch corrects mapping table for ChipCommon.
  
  Submitted by: Michael Zhilin 
  Differential Revision:https://reviews.freebsd.org/D6088

Modified:
  head/sys/dev/bhnd/cores/chipc/chipc.c

Modified: head/sys/dev/bhnd/cores/chipc/chipc.c
==
--- head/sys/dev/bhnd/cores/chipc/chipc.c   Mon Apr 25 16:13:04 2016
(r298582)
+++ head/sys/dev/bhnd/cores/chipc/chipc.c   Mon Apr 25 16:53:13 2016
(r298583)
@@ -66,7 +66,7 @@ static struct bhnd_device_quirk chipc_qu
 
 /* Supported device identifiers */
 static const struct bhnd_device chipc_devices[] = {
-   BHND_DEVICE(CC, NULL, chipc_quirks),
+   BHND_DEVICE(CC, "CC", chipc_quirks),
BHND_DEVICE_END
 };
 
___
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: r298584 - head/usr.sbin/jail

2016-04-25 Thread Jamie Gritton
Author: jamie
Date: Mon Apr 25 17:01:13 2016
New Revision: 298584
URL: https://svnweb.freebsd.org/changeset/base/298584

Log:
  Note the existence of module-specific jail paramters, starting with the
  linux.* parameters when linux emulation is loaded.
  
  MFC after:5 days

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

Modified: head/usr.sbin/jail/jail.8
==
--- head/usr.sbin/jail/jail.8   Mon Apr 25 16:53:13 2016(r298583)
+++ head/usr.sbin/jail/jail.8   Mon Apr 25 17:01:13 2016(r298584)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 20, 2015
+.Dd April 25, 2016
 .Dt JAIL 8
 .Os
 .Sh NAME
@@ -610,6 +610,32 @@ have not had jail functionality added to
 .El
 .El
 .Pp
+Kernel modules may add their own parameters, which only exist when the
+module is loaded.
+These are typically headed under a parameter named after the module,
+with values of
+.Dq inherit
+to give the jail full use of the module,
+.Dq new
+to encapsulate the jail in some module-specific way,
+and
+.Dq disable
+to make the module unavailable to the jail.
+There also may be other parameters to define jail behavior within the module.
+Module-specific parameters include:
+.Bl -tag -width indent
+.It Va linux
+Determine how a jail's Linux emulation environment appears.
+A value of
+.Dq inherit
+will keep the same environment, and
+.Dq new
+will give the jail it's own environment (still originally inherited when
+the jail is created).
+.It Va linux.osname , linux.osrelease , linux.oss_version
+The Linux OS name, OS release, and OSS version associated with this jail.
+.El
+.Pp
 There are pseudo-parameters that are not passed to the kernel, but are
 used by
 .Nm
___
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: r298585 - in head: sys/kern usr.sbin/jail

2016-04-25 Thread Jamie Gritton
Author: jamie
Date: Mon Apr 25 17:06:50 2016
New Revision: 298585
URL: https://svnweb.freebsd.org/changeset/base/298585

Log:
  Encapsulate SYSV IPC objects in jails.  Define per-module parameters
  sysvmsg, sysvsem, and sysvshm, with the following bahavior:
  
  inherit: allow full access to the IPC primitives.  This is the same as
  the current setup with allow.sysvipc is on.  Jails and the base system
  can see (and moduly) each other's objects, which is generally considered
  a bad thing (though may be useful in some circumstances).
  
  disable: all no access, same as the current setup with allow.sysvipc off.
  
  new: A jail may see use the IPC objects that it has created.  It also
  gets its own IPC key namespace, so different jails may have their own
  objects using the same key value.  The parent jail (or base system) can
  see the jail's IPC objects, but not its keys.
  
  PR:   48471
  Submitted by: based on work by kikucha...@gmail.com
  MFC after:5 days

Modified:
  head/sys/kern/sysv_msg.c
  head/sys/kern/sysv_sem.c
  head/sys/kern/sysv_shm.c
  head/usr.sbin/jail/jail.8

Modified: head/sys/kern/sysv_msg.c
==
--- head/sys/kern/sysv_msg.cMon Apr 25 17:01:13 2016(r298584)
+++ head/sys/kern/sysv_msg.cMon Apr 25 17:06:50 2016(r298585)
@@ -62,8 +62,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -80,6 +83,14 @@ static MALLOC_DEFINE(M_MSG, "msg", "SVID
 static int msginit(void);
 static int msgunload(void);
 static int sysvmsg_modload(struct module *, int, void *);
+static void msq_remove(struct msqid_kernel *);
+static struct prison *msg_find_prison(struct ucred *);
+static int msq_prison_cansee(struct prison *, struct msqid_kernel *);
+static int msg_prison_check(void *, void *);
+static int msg_prison_set(void *, void *);
+static int msg_prison_get(void *, void *);
+static int msg_prison_remove(void *, void *);
+static void msg_prison_cleanup(struct prison *);
 
 
 #ifdef MSG_DEBUG
@@ -155,6 +166,7 @@ static struct msgmap *msgmaps;  /* MSGSEG
 static struct msg *msghdrs;/* MSGTQL msg headers */
 static struct msqid_kernel *msqids;/* MSGMNI msqid_kernel struct's */
 static struct mtx msq_mtx; /* global mutex for message queues. */
+static unsigned msg_prison_slot;/* prison OSD slot */
 
 static struct syscall_helper_data msg_syscalls[] = {
SYSCALL_INIT_HELPER(msgctl),
@@ -194,7 +206,15 @@ static struct syscall_helper_data msg32_
 static int
 msginit()
 {
+   struct prison *pr;
+   void *rsv;
int i, error;
+   osd_method_t methods[PR_MAXMETHOD] = {
+   [PR_METHOD_CHECK] = msg_prison_check,
+   [PR_METHOD_SET] =   msg_prison_set,
+   [PR_METHOD_GET] =   msg_prison_get,
+   [PR_METHOD_REMOVE] =msg_prison_remove,
+   };
 
msginfo.msgmax = msginfo.msgseg * msginfo.msgssz;
msgpool = malloc(msginfo.msgmax, M_MSG, M_WAITOK);
@@ -252,6 +272,29 @@ msginit()
}
mtx_init(&msq_mtx, "msq", NULL, MTX_DEF);
 
+   /* Set current prisons according to their allow.sysvipc. */
+   msg_prison_slot = osd_jail_register(NULL, methods);
+   rsv = osd_reserve(msg_prison_slot);
+   prison_lock(&prison0);
+   (void)osd_jail_set_reserved(&prison0, msg_prison_slot, rsv, &prison0);
+   prison_unlock(&prison0);
+   rsv = NULL;
+   sx_slock(&allprison_lock);
+   TAILQ_FOREACH(pr, &allprison, pr_list) {
+   if (rsv == NULL)
+   rsv = osd_reserve(msg_prison_slot);
+   prison_lock(pr);
+   if ((pr->pr_allow & PR_ALLOW_SYSVIPC) && pr->pr_ref > 0) {
+   (void)osd_jail_set_reserved(pr, msg_prison_slot, rsv,
+   &prison0);
+   rsv = NULL;
+   }
+   prison_unlock(pr);
+   }
+   if (rsv != NULL)
+   osd_free_reserved(rsv);
+   sx_sunlock(&allprison_lock);
+
error = syscall_helper_register(msg_syscalls, SY_THR_STATIC_KLD);
if (error != 0)
return (error);
@@ -292,6 +335,8 @@ msgunload()
if (msqid != msginfo.msgmni)
return (EBUSY);
 
+   if (msg_prison_slot != 0)
+   osd_jail_deregister(msg_prison_slot);
 #ifdef MAC
for (i = 0; i < msginfo.msgtql; i++)
mac_sysvmsg_destroy(&msghdrs[i]);
@@ -366,6 +411,67 @@ msg_freehdr(msghdr)
 #endif
 }
 
+static void
+msq_remove(struct msqid_kernel *msqkptr)
+{
+   struct msg *msghdr;
+
+   racct_sub_cred(msqkptr->cred, RACCT_NMSGQ, 1);
+   racct_sub_cred(msqkptr->cred, RACCT_MSGQQUEUED, msqkptr->u.msg_qnum);
+   racct_sub_cred(msqkptr->cred, RACCT_MSGQSIZE, msqkptr->u.msg_cbytes);
+   crfree(msqkptr->cred);
+   msqkptr->cred = NULL;
+
+

svn commit: r298586 - head/sys/arm64/include

2016-04-25 Thread Andrew Turner
Author: andrew
Date: Mon Apr 25 17:32:08 2016
New Revision: 298586
URL: https://svnweb.freebsd.org/changeset/base/298586

Log:
  Use the yield instruction in the arm64 cpu_spinwait. This instruction is
  a hint to the hardware the software is not performing a task.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm64/include/cpu.h

Modified: head/sys/arm64/include/cpu.h
==
--- head/sys/arm64/include/cpu.hMon Apr 25 17:06:50 2016
(r298585)
+++ head/sys/arm64/include/cpu.hMon Apr 25 17:32:08 2016
(r298586)
@@ -50,7 +50,7 @@
 
 #definecpu_getstack(td)((td)->td_frame->tf_sp)
 #definecpu_setstack(td, sp)((td)->td_frame->tf_sp = (sp))
-#definecpu_spinwait()  /* nothing */
+#definecpu_spinwait()  __asm __volatile("yield" ::: "memory")
 
 /* Extract CPU affinity levels 0-3 */
 #defineCPU_AFF0(mpidr) (u_int)(((mpidr) >> 0) & 0xff)
___
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: r298587 - head/sys/cddl/dev/dtrace

2016-04-25 Thread Mark Johnston
Author: markj
Date: Mon Apr 25 18:09:36 2016
New Revision: 298587
URL: https://svnweb.freebsd.org/changeset/base/298587

Log:
  Add a kern.dtrace.err_verbose sysctl to control dtrace_err_verbose.
  
  When this flag is turned on, DOF and DIF validation errors are printed to
  the kernel message buffer. This is useful for debugging.
  
  Also remove the debug.dtrace.debug sysctl, which has no effect.

Modified:
  head/sys/cddl/dev/dtrace/dtrace_sysctl.c

Modified: head/sys/cddl/dev/dtrace/dtrace_sysctl.c
==
--- head/sys/cddl/dev/dtrace/dtrace_sysctl.cMon Apr 25 17:32:08 2016
(r298586)
+++ head/sys/cddl/dev/dtrace/dtrace_sysctl.cMon Apr 25 18:09:36 2016
(r298587)
@@ -22,11 +22,6 @@
  *
  */
 
-SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace debug 
parameters");
-
-intdtrace_debug = 0;
-SYSCTL_INT(_debug_dtrace, OID_AUTO, debug, CTLFLAG_RWTUN, &dtrace_debug, 0, 
"");
-
 /* Report registered DTrace providers. */
 static int
 sysctl_dtrace_providers(SYSCTL_HANDLER_ARGS)
@@ -78,11 +73,17 @@ sysctl_dtrace_providers(SYSCTL_HANDLER_A
return (error);
 }
 
+SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace debug 
parameters");
+
 SYSCTL_PROC(_debug_dtrace, OID_AUTO, providers, CTLTYPE_STRING | CTLFLAG_RD,
 0, 0, sysctl_dtrace_providers, "A", "available DTrace providers");
 
 SYSCTL_NODE(_kern, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace parameters");
 
+SYSCTL_INT(_kern_dtrace, OID_AUTO, err_verbose, CTLFLAG_RW,
+&dtrace_err_verbose, 0,
+"print DIF and DOF validation errors to the message buffer");
+
 SYSCTL_INT(_kern_dtrace, OID_AUTO, memstr_max, CTLFLAG_RW, &dtrace_memstr_max,
 0, "largest allowed argument to memstr(), 0 indicates no limit");
 
___
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: head/usr.bin/mkuzip

2016-04-25 Thread Maxim Sobolev
Thanks and sorry about that. I did not realize we use different compilers
for different architectures. By any chance, do you know is there a way to
test buildworld on amd64 with gcc?

On Mon, Apr 25, 2016 at 6:20 AM, Bjoern A. Zeeb  wrote:

> Author: bz
> Date: Mon Apr 25 13:20:35 2016
> New Revision: 298577
> URL: https://svnweb.freebsd.org/changeset/base/298577
>
> Log:
>   Try to make gcc builds happy again by removing a redundant declaration.
>
> Modified:
>   head/usr.bin/mkuzip/mkuzip.c
>
> Modified: head/usr.bin/mkuzip/mkuzip.c
>
> ==
> --- head/usr.bin/mkuzip/mkuzip.cMon Apr 25 12:25:30 2016
> (r298576)
> +++ head/usr.bin/mkuzip/mkuzip.cMon Apr 25 13:20:35 2016
> (r298577)
> @@ -78,7 +78,6 @@ static struct mkuz_format ulzma_fmt = {
>  static struct mkuz_blk *readblock(int, u_int32_t);
>  static void usage(void);
>  static void cleanup(void);
> -int mkuz_memvcmp(const void *, unsigned char, size_t);
>
>  static char *cleanfile = NULL;
>
>
>
___
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: r298589 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace

2016-04-25 Thread Mark Johnston
Author: markj
Date: Mon Apr 25 18:40:57 2016
New Revision: 298589
URL: https://svnweb.freebsd.org/changeset/base/298589

Log:
  Allow DOF sections with excessively long probe function components.
  
  Without this change, DTrace will refuse to load a DOF section if the
  function component of any of its probes exceeds DTRACE_FUNCNAMELEN (128).
  Probes in C++ programs can have very long function components. Rather than
  rejecting all probes if a single probe exceeds the limit, simply skip the
  invalid probe and emit a warning. This ensures that valid probes are
  instantiated.
  
  PR:   207735
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cMon Apr 
25 18:13:21 2016(r298588)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cMon Apr 
25 18:40:57 2016(r298589)
@@ -9355,6 +9355,10 @@ dtrace_helper_provide_one(dof_helper_t *
probe = (dof_probe_t *)(uintptr_t)(daddr +
prb_sec->dofs_offset + i * prb_sec->dofs_entsize);
 
+   /* See the check in dtrace_helper_provider_validate(). */
+   if (strlen(strtab + probe->dofpr_func) >= DTRACE_FUNCNAMELEN)
+   continue;
+
dhpb.dthpb_mod = dhp->dofhp_mod;
dhpb.dthpb_func = strtab + probe->dofpr_func;
dhpb.dthpb_name = strtab + probe->dofpr_name;
@@ -16042,7 +16046,13 @@ dtrace_helper_provider_validate(dof_hdr_
 
if (strlen(strtab + probe->dofpr_func) >= DTRACE_FUNCNAMELEN) {
dtrace_dof_error(dof, "function name too long");
-   return (-1);
+   /*
+* Keep going if the function name is too long.
+* Unlike provider and probe names, we cannot reasonably
+* impose restrictions on function names, since they're
+* a property of the code being instrumented. We will
+* skip this probe in dtrace_helper_provide_one().
+*/
}
 
if (probe->dofpr_name >= str_sec->dofs_size ||
___
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: r298590 - head/sys/cddl/contrib/opensolaris/uts/common/sys

2016-04-25 Thread Mark Johnston
Author: markj
Date: Mon Apr 25 18:44:11 2016
New Revision: 298590
URL: https://svnweb.freebsd.org/changeset/base/298590

Log:
  Increase DTRACE_FUNCNAMELEN from 128 to 192.
  
  This allows for the long function components encountered in www/firefox.
  This constant is part of DTrace's userland ABI, so this change may not be
  MFC'ed.
  
  PR:   207735

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h   Mon Apr 25 
18:40:57 2016(r298589)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h   Mon Apr 25 
18:44:11 2016(r298590)
@@ -87,7 +87,7 @@ typedef int model_t;
 
 #defineDTRACE_PROVNAMELEN  64
 #defineDTRACE_MODNAMELEN   64
-#defineDTRACE_FUNCNAMELEN  128
+#defineDTRACE_FUNCNAMELEN  192
 #defineDTRACE_NAMELEN  64
 #defineDTRACE_FULLNAMELEN  (DTRACE_PROVNAMELEN + DTRACE_MODNAMELEN 
+ \
DTRACE_FUNCNAMELEN + DTRACE_NAMELEN + 4)
___
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: head/usr.bin/mkuzip

2016-04-25 Thread Ian Lepore
On Mon, 2016-04-25 at 11:39 -0700, Maxim Sobolev wrote:
> Thanks and sorry about that. I did not realize we use different
> compilers
> for different architectures. By any chance, do you know is there a
> way to
> test buildworld on amd64 with gcc?
> 

Add these args to src.conf or the command line.  I haven't tried these
with anything except arm platforms for a couple years, but in theory it
should work on amd64...

#WITH_GCC=yes
#WITH_GNUCXX=yes
#WITH_GCC_BOOTSTRAP=yes
#WITHOUT_CLANG=yes
#WITHOUT_CLANG_IS_CC=yes
#WITHOUT_CLANG_BOOTSTRAP=yes

-- Ian

> On Mon, Apr 25, 2016 at 6:20 AM, Bjoern A. Zeeb 
> wrote:
> 
> > Author: bz
> > Date: Mon Apr 25 13:20:35 2016
> > New Revision: 298577
> > URL: https://svnweb.freebsd.org/changeset/base/298577
> > 
> > Log:
> >   Try to make gcc builds happy again by removing a redundant
> > declaration.
> > 
> > Modified:
> >   head/usr.bin/mkuzip/mkuzip.c
> > 
> > Modified: head/usr.bin/mkuzip/mkuzip.c
> > 
> > ===
> > ===
> > --- head/usr.bin/mkuzip/mkuzip.cMon Apr 25 12:25:30 2016
> > (r298576)
> > +++ head/usr.bin/mkuzip/mkuzip.cMon Apr 25 13:20:35 2016
> > (r298577)
> > @@ -78,7 +78,6 @@ static struct mkuz_format ulzma_fmt = {
> >  static struct mkuz_blk *readblock(int, u_int32_t);
> >  static void usage(void);
> >  static void cleanup(void);
> > -int mkuz_memvcmp(const void *, unsigned char, size_t);
> > 
> >  static char *cleanfile = NULL;
> > 
> > 
> > 
___
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: r298591 - in head/sys: dev/bxe modules/bxe

2016-04-25 Thread David C Somayajulu
Author: davidcs
Date: Mon Apr 25 18:55:01 2016
New Revision: 298591
URL: https://svnweb.freebsd.org/changeset/base/298591

Log:
  1. Removed -Wno-shift-negative-value from Makefile
  2. Fixed warning its absence caused in bxe_elink.c
  
  MFC after:5 days

Modified:
  head/sys/dev/bxe/bxe_elink.c
  head/sys/modules/bxe/Makefile

Modified: head/sys/dev/bxe/bxe_elink.c
==
--- head/sys/dev/bxe/bxe_elink.cMon Apr 25 18:44:11 2016
(r298590)
+++ head/sys/dev/bxe/bxe_elink.cMon Apr 25 18:55:01 2016
(r298591)
@@ -11969,8 +11969,8 @@ static elink_status_t elink_54618se_conf
elink_eee_disable(phy, params, vars);
}
} else {
-   vars->eee_status &= ~SHMEM_EEE_1G_ADV <<
-   SHMEM_EEE_SUPPORTED_SHIFT;
+   vars->eee_status &= ((uint32_t)(~SHMEM_EEE_1G_ADV) <<
+   SHMEM_EEE_SUPPORTED_SHIFT);
 
if (phy->flags & ELINK_FLAGS_EEE) {
/* Handle legacy auto-grEEEn */

Modified: head/sys/modules/bxe/Makefile
==
--- head/sys/modules/bxe/Makefile   Mon Apr 25 18:44:11 2016
(r298590)
+++ head/sys/modules/bxe/Makefile   Mon Apr 25 18:55:01 2016
(r298591)
@@ -17,6 +17,5 @@ SRCS  += bxe.c   \
57712_init_values.c
 
 CFLAGS += -I${BXE}
-CFLAGS += -Wno-shift-negative-value
 
 .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"


Re: svn commit: r298585 - in head: sys/kern usr.sbin/jail

2016-04-25 Thread Subbsd
I do not know how it works for/in jails, but looks like this breaks
work SHM in host. I've got on any QT-based application after this
commit:

EP Get failed: 'Feature not implemented.
The feature requested is not implemented by the recipient or server
and therefore cannot be processed.' (501)"
[23:05:55] W:QNativeImage: Unable to attach to shared memory segment.
Segmentation fault (core dumped)


and tracing stops on:
shmget(0x0,0x634e0,0x3c0)= 65580 (0x1002c)
shmat(0x1002c,0x0,0x0)   ERR#22 'Invalid argument'

On Mon, Apr 25, 2016 at 8:06 PM, Jamie Gritton  wrote:
> Author: jamie
> Date: Mon Apr 25 17:06:50 2016
> New Revision: 298585
> URL: https://svnweb.freebsd.org/changeset/base/298585
>
> Log:
>   Encapsulate SYSV IPC objects in jails.  Define per-module parameters
>   sysvmsg, sysvsem, and sysvshm, with the following bahavior:
>
>   inherit: allow full access to the IPC primitives.  This is the same as
>   the current setup with allow.sysvipc is on.  Jails and the base system
>   can see (and moduly) each other's objects, which is generally considered
>   a bad thing (though may be useful in some circumstances).
>
>   disable: all no access, same as the current setup with allow.sysvipc off.
>
>   new: A jail may see use the IPC objects that it has created.  It also
>   gets its own IPC key namespace, so different jails may have their own
>   objects using the same key value.  The parent jail (or base system) can
>   see the jail's IPC objects, but not its keys.
>
>   PR:   48471
>   Submitted by: based on work by kikucha...@gmail.com
>   MFC after:5 days
>
> Modified:
>   head/sys/kern/sysv_msg.c
>   head/sys/kern/sysv_sem.c
>   head/sys/kern/sysv_shm.c
>   head/usr.sbin/jail/jail.8
>
> Modified: head/sys/kern/sysv_msg.c
> ==
> --- head/sys/kern/sysv_msg.cMon Apr 25 17:01:13 2016(r298584)
> +++ head/sys/kern/sysv_msg.cMon Apr 25 17:06:50 2016(r298585)
> @@ -62,8 +62,11 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -80,6 +83,14 @@ static MALLOC_DEFINE(M_MSG, "msg", "SVID
>  static int msginit(void);
>  static int msgunload(void);
>  static int sysvmsg_modload(struct module *, int, void *);
> +static void msq_remove(struct msqid_kernel *);
> +static struct prison *msg_find_prison(struct ucred *);
> +static int msq_prison_cansee(struct prison *, struct msqid_kernel *);
> +static int msg_prison_check(void *, void *);
> +static int msg_prison_set(void *, void *);
> +static int msg_prison_get(void *, void *);
> +static int msg_prison_remove(void *, void *);
> +static void msg_prison_cleanup(struct prison *);
>
>
>  #ifdef MSG_DEBUG
> @@ -155,6 +166,7 @@ static struct msgmap *msgmaps;  /* MSGSEG
>  static struct msg *msghdrs;/* MSGTQL msg headers */
>  static struct msqid_kernel *msqids;/* MSGMNI msqid_kernel struct's */
>  static struct mtx msq_mtx; /* global mutex for message queues. */
> +static unsigned msg_prison_slot;/* prison OSD slot */
>
>  static struct syscall_helper_data msg_syscalls[] = {
> SYSCALL_INIT_HELPER(msgctl),
> @@ -194,7 +206,15 @@ static struct syscall_helper_data msg32_
>  static int
>  msginit()
>  {
> +   struct prison *pr;
> +   void *rsv;
> int i, error;
> +   osd_method_t methods[PR_MAXMETHOD] = {
> +   [PR_METHOD_CHECK] = msg_prison_check,
> +   [PR_METHOD_SET] =   msg_prison_set,
> +   [PR_METHOD_GET] =   msg_prison_get,
> +   [PR_METHOD_REMOVE] =msg_prison_remove,
> +   };
>
> msginfo.msgmax = msginfo.msgseg * msginfo.msgssz;
> msgpool = malloc(msginfo.msgmax, M_MSG, M_WAITOK);
> @@ -252,6 +272,29 @@ msginit()
> }
> mtx_init(&msq_mtx, "msq", NULL, MTX_DEF);
>
> +   /* Set current prisons according to their allow.sysvipc. */
> +   msg_prison_slot = osd_jail_register(NULL, methods);
> +   rsv = osd_reserve(msg_prison_slot);
> +   prison_lock(&prison0);
> +   (void)osd_jail_set_reserved(&prison0, msg_prison_slot, rsv, &prison0);
> +   prison_unlock(&prison0);
> +   rsv = NULL;
> +   sx_slock(&allprison_lock);
> +   TAILQ_FOREACH(pr, &allprison, pr_list) {
> +   if (rsv == NULL)
> +   rsv = osd_reserve(msg_prison_slot);
> +   prison_lock(pr);
> +   if ((pr->pr_allow & PR_ALLOW_SYSVIPC) && pr->pr_ref > 0) {
> +   (void)osd_jail_set_reserved(pr, msg_prison_slot, rsv,
> +   &prison0);
> +   rsv = NULL;
> +   }
> +   prison_unlock(pr);
> +   }
> +   if (rsv != NULL)
> +   osd_free_reserved(rsv);
> +   sx_sunlock(&allprison_lock);
> +
> error = syscal

svn commit: r298592 - head/usr.sbin/lpr/lpd

2016-04-25 Thread Garance A Drosehn
Author: gad
Date: Mon Apr 25 20:58:54 2016
New Revision: 298592
URL: https://svnweb.freebsd.org/changeset/base/298592

Log:
  Remove a variable and three lines of code which I should have removed as
  part of revision 98776 back on June 24/2002.  Noticed by pfg@ trying
  coccinelle for checking code.
  
  MFC after:3 weeks

Modified:
  head/usr.sbin/lpr/lpd/lpd.c

Modified: head/usr.sbin/lpr/lpd/lpd.c
==
--- head/usr.sbin/lpr/lpd/lpd.c Mon Apr 25 18:55:01 2016(r298591)
+++ head/usr.sbin/lpr/lpd/lpd.c Mon Apr 25 20:58:54 2016(r298592)
@@ -657,11 +657,7 @@ chkhost(struct sockaddr *f, int ch_opts)
char hostbuf[NI_MAXHOST], ip[NI_MAXHOST];
char serv[NI_MAXSERV];
char *syserr, *usererr;
-   int error, errsav, fpass, good, wantsl;
-
-   wantsl = 0;
-   if (ch_opts & LPD_LOGCONNERR)
-   wantsl = 1; /* also syslog the errors */
+   int error, errsav, fpass, good;
 
from_host = ".na.";
 
___
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: r298593 - head/sys/dev/random

2016-04-25 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Apr 25 21:14:32 2016
New Revision: 298593
URL: https://svnweb.freebsd.org/changeset/base/298593

Log:
  dev/random: use our roundup() macro instead of re-implementing it.
  
  While here also use howmany() macro from sys/param.h
  No functional change.
  
  Reviewed by:  markm (roundup replacement part)
  Approved by:  so

Modified:
  head/sys/dev/random/fortuna.c
  head/sys/dev/random/randomdev.c
  head/sys/dev/random/yarrow.c

Modified: head/sys/dev/random/fortuna.c
==
--- head/sys/dev/random/fortuna.c   Mon Apr 25 20:58:54 2016
(r298592)
+++ head/sys/dev/random/fortuna.c   Mon Apr 25 21:14:32 2016
(r298593)
@@ -324,7 +324,7 @@ random_fortuna_genrandom(uint8_t *buf, u
 *  - K = GenerateBlocks(2)
 */
KASSERT((bytecount <= RANDOM_FORTUNA_MAX_READ), ("invalid single read 
request to Fortuna of %d bytes", bytecount));
-   blockcount = (bytecount + RANDOM_BLOCKSIZE - 1)/RANDOM_BLOCKSIZE;
+   blockcount = howmany(bytecount, RANDOM_BLOCKSIZE);
random_fortuna_genblocks(buf, blockcount);
random_fortuna_genblocks(temp, RANDOM_KEYS_PER_BLOCK);
randomdev_encrypt_init(&fortuna_state.fs_key, temp);

Modified: head/sys/dev/random/randomdev.c
==
--- head/sys/dev/random/randomdev.c Mon Apr 25 20:58:54 2016
(r298592)
+++ head/sys/dev/random/randomdev.c Mon Apr 25 21:14:32 2016
(r298593)
@@ -68,9 +68,6 @@ static u_int READ_RANDOM(void *, u_int);
 #define READ_RANDOMread_random
 #endif
 
-/* Return the largest number >= x that is a multiple of m */
-#define CEIL_TO_MULTIPLE(x, m) x) + (m) - 1)/(m))*(m))
-
 static d_read_t randomdev_read;
 static d_write_t randomdev_write;
 static d_poll_t randomdev_poll;
@@ -164,7 +161,7 @@ READ_RANDOM_UIO(struct uio *uio, bool no
 * which is what the underlying generator is expecting.
 * See the random_buf size requirements in the 
Yarrow/Fortuna code.
 */
-   read_len = CEIL_TO_MULTIPLE(read_len, RANDOM_BLOCKSIZE);
+   read_len = roundup(read_len, RANDOM_BLOCKSIZE);
/* Work in chunks page-sized or less */
read_len = MIN(read_len, PAGE_SIZE);
p_random_alg_context->ra_read(random_buf, read_len);
@@ -204,7 +201,7 @@ READ_RANDOM(void *random_buf, u_int len)
 * Round up the read length to a crypto block size 
multiple,
 * which is what the underlying generator is expecting.
 */
-   read_len = CEIL_TO_MULTIPLE(len, RANDOM_BLOCKSIZE);
+   read_len = roundup(len, RANDOM_BLOCKSIZE);
p_random_alg_context->ra_read(local_buf, read_len);
memcpy(random_buf, local_buf, len);
}

Modified: head/sys/dev/random/yarrow.c
==
--- head/sys/dev/random/yarrow.cMon Apr 25 20:58:54 2016
(r298592)
+++ head/sys/dev/random/yarrow.cMon Apr 25 21:14:32 2016
(r298593)
@@ -374,7 +374,7 @@ random_yarrow_read(uint8_t *buf, u_int b
 
KASSERT((bytecount % RANDOM_BLOCKSIZE) == 0, ("%s(): bytecount (= %d) 
must be a multiple of %d", __func__, bytecount, RANDOM_BLOCKSIZE ));
RANDOM_RESEED_LOCK();
-   blockcount = (bytecount + RANDOM_BLOCKSIZE - 1)/RANDOM_BLOCKSIZE;
+   blockcount = howmany(bytecount, RANDOM_BLOCKSIZE);
for (i = 0; i < blockcount; i++) {
if (yarrow_state.ys_outputblocks++ >= 
yarrow_state.ys_gengateinterval) {
random_yarrow_generator_gate();
___
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"


HEADS UP: I will revert this. (was Re: svn commit: r298443 - head/usr.bin/stat)

2016-04-25 Thread Pedro Giffuni

Hi Marcelo;

Hi;

I assume you have been very busy.

I will revert this in a couple of hours unless you either explain
or revert it yourself.

Pedro.

On 04/23/16 04:23, luke wrote:

On Fri, Apr 22, 2016 at 11:43 AM, Marcelo Araujo mailto:ara...@freebsd.org>> wrote:

Author: araujo
Date: Fri Apr 22 03:43:06 2016
New Revision: 298443
URL: https://svnweb.freebsd.org/changeset/base/298443

Log:
  Use macro MAX() from sys/param.h.

  MFC after:2 weeks.

Modified:
  head/usr.bin/stat/stat.c

Modified: head/usr.bin/stat/stat.c

==
--- head/usr.bin/stat/stat.cFri Apr 22 03:37:27 2016
(r298442)
+++ head/usr.bin/stat/stat.cFri Apr 22 03:43:06 2016
(r298443)
@@ -1025,7 +1025,7 @@ format1(const struct stat *st,
 *
 * Nanoseconds: long.
 */
-   (void)snprintf(tmp, sizeof(tmp), "%dld", prec > 9 ?
9 : prec);
+   (void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9, prec));
(void)strcat(lfmt, tmp);

/*
___
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
"



Hi,

Should this be MIN() ?

(void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9));


--
Chang-Hsien Tsai


___
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: r298594 - head/sys/dev/iwm

2016-04-25 Thread Adrian Chadd
Author: adrian
Date: Mon Apr 25 22:00:05 2016
New Revision: 298594
URL: https://svnweb.freebsd.org/changeset/base/298594

Log:
  [iwm] restart the VAP if there's a firmware panic.
  
  Always print out the firmware panic info before restarting; don't
  put it behind IWM_DEBUG.
  
  Submitted by: bapt
  Differential Revision:https://reviews.freebsd.org/D6081

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Mon Apr 25 21:14:32 2016(r298593)
+++ head/sys/dev/iwm/if_iwm.c   Mon Apr 25 22:00:05 2016(r298594)
@@ -4344,7 +4344,6 @@ iwm_intr(void *arg)
handled |= (r1 & (IWM_CSR_INT_BIT_ALIVE /*| IWM_CSR_INT_BIT_SCD*/));
 
if (r1 & IWM_CSR_INT_BIT_SW_ERR) {
-#ifdef IWM_DEBUG
int i;
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
@@ -4364,13 +4363,21 @@ iwm_intr(void *arg)
"  rx ring: cur=%d\n", sc->rxq.cur);
device_printf(sc->sc_dev,
"  802.11 state %d\n", vap->iv_state);
-#endif
 
-   device_printf(sc->sc_dev, "fatal firmware error\n");
-   iwm_stop(sc);
-   rv = 1;
-   goto out;
+   /* Don't stop the device; just do a VAP restart */
+   IWM_UNLOCK(sc);
+
+   if (vap == NULL) {
+   printf("%s: null vap\n", __func__);
+   return;
+   }
 
+   device_printf(sc->sc_dev, "%s: controller panicked, iv_state = 
%d; "
+   "restarting\n", __func__, vap->iv_state);
+
+   /* XXX TODO: turn this into a callout/taskqueue */
+   ieee80211_restart_all(ic);
+   return;
}
 
if (r1 & IWM_CSR_INT_BIT_HW_ERR) {
___
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: r298585 - in head: sys/kern usr.sbin/jail

2016-04-25 Thread James Gritton
That's a big oops on my part - msg and sem had nearly identical logic, 
but I got it backwards on shm.  I'll put a fix in shortly.


- Jamie


On 2016-04-25 14:28, Subbsd wrote:

I do not know how it works for/in jails, but looks like this breaks
work SHM in host. I've got on any QT-based application after this
commit:

EP Get failed: 'Feature not implemented.
The feature requested is not implemented by the recipient or server
and therefore cannot be processed.' (501)"
[23:05:55] W:QNativeImage: Unable to attach to shared memory segment.
Segmentation fault (core dumped)


and tracing stops on:
shmget(0x0,0x634e0,0x3c0)= 65580 (0x1002c)
shmat(0x1002c,0x0,0x0)   ERR#22 'Invalid 
argument'


On Mon, Apr 25, 2016 at 8:06 PM, Jamie Gritton  
wrote:

Author: jamie
Date: Mon Apr 25 17:06:50 2016
New Revision: 298585
URL: https://svnweb.freebsd.org/changeset/base/298585

Log:
  Encapsulate SYSV IPC objects in jails.  Define per-module parameters
  sysvmsg, sysvsem, and sysvshm, with the following bahavior:

  inherit: allow full access to the IPC primitives.  This is the same 
as
  the current setup with allow.sysvipc is on.  Jails and the base 
system
  can see (and moduly) each other's objects, which is generally 
considered

  a bad thing (though may be useful in some circumstances).

  disable: all no access, same as the current setup with allow.sysvipc 
off.


  new: A jail may see use the IPC objects that it has created.  It 
also
  gets its own IPC key namespace, so different jails may have their 
own
  objects using the same key value.  The parent jail (or base system) 
can

  see the jail's IPC objects, but not its keys.

  PR:   48471
  Submitted by: based on work by kikucha...@gmail.com
  MFC after:5 days

Modified:
  head/sys/kern/sysv_msg.c
  head/sys/kern/sysv_sem.c
  head/sys/kern/sysv_shm.c
  head/usr.sbin/jail/jail.8

Modified: head/sys/kern/sysv_msg.c
==
--- head/sys/kern/sysv_msg.cMon Apr 25 17:01:13 2016
(r298584)
+++ head/sys/kern/sysv_msg.cMon Apr 25 17:06:50 2016
(r298585)

@@ -62,8 +62,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -80,6 +83,14 @@ static MALLOC_DEFINE(M_MSG, "msg", "SVID
 static int msginit(void);
 static int msgunload(void);
 static int sysvmsg_modload(struct module *, int, void *);
+static void msq_remove(struct msqid_kernel *);
+static struct prison *msg_find_prison(struct ucred *);
+static int msq_prison_cansee(struct prison *, struct msqid_kernel *);
+static int msg_prison_check(void *, void *);
+static int msg_prison_set(void *, void *);
+static int msg_prison_get(void *, void *);
+static int msg_prison_remove(void *, void *);
+static void msg_prison_cleanup(struct prison *);


 #ifdef MSG_DEBUG
@@ -155,6 +166,7 @@ static struct msgmap *msgmaps;  /* MSGSEG
 static struct msg *msghdrs;/* MSGTQL msg headers */
 static struct msqid_kernel *msqids;/* MSGMNI msqid_kernel 
struct's */

 static struct mtx msq_mtx; /* global mutex for message queues. */
+static unsigned msg_prison_slot;/* prison OSD slot */

 static struct syscall_helper_data msg_syscalls[] = {
SYSCALL_INIT_HELPER(msgctl),
@@ -194,7 +206,15 @@ static struct syscall_helper_data msg32_
 static int
 msginit()
 {
+   struct prison *pr;
+   void *rsv;
int i, error;
+   osd_method_t methods[PR_MAXMETHOD] = {
+   [PR_METHOD_CHECK] = msg_prison_check,
+   [PR_METHOD_SET] =   msg_prison_set,
+   [PR_METHOD_GET] =   msg_prison_get,
+   [PR_METHOD_REMOVE] =msg_prison_remove,
+   };

msginfo.msgmax = msginfo.msgseg * msginfo.msgssz;
msgpool = malloc(msginfo.msgmax, M_MSG, M_WAITOK);
@@ -252,6 +272,29 @@ msginit()
}
mtx_init(&msq_mtx, "msq", NULL, MTX_DEF);

+   /* Set current prisons according to their allow.sysvipc. */
+   msg_prison_slot = osd_jail_register(NULL, methods);
+   rsv = osd_reserve(msg_prison_slot);
+   prison_lock(&prison0);
+   (void)osd_jail_set_reserved(&prison0, msg_prison_slot, rsv, 
&prison0);

+   prison_unlock(&prison0);
+   rsv = NULL;
+   sx_slock(&allprison_lock);
+   TAILQ_FOREACH(pr, &allprison, pr_list) {
+   if (rsv == NULL)
+   rsv = osd_reserve(msg_prison_slot);
+   prison_lock(pr);
+   if ((pr->pr_allow & PR_ALLOW_SYSVIPC) && pr->pr_ref > 
0) {
+   (void)osd_jail_set_reserved(pr, 
msg_prison_slot, rsv,

+   &prison0);
+   rsv = NULL;
+   }
+   prison_unlock(pr);
+   }
+   if (rsv != NULL)
+   osd_free_reserved(rsv);
+   sx_sunlock(&allprison_lock);
+
error = syscall_helper_regi

Re: svn: head/usr.bin/mkuzip

2016-04-25 Thread Bjoern A. Zeeb

> On 25 Apr 2016, at 18:49 , Ian Lepore  wrote:
> 
> On Mon, 2016-04-25 at 11:39 -0700, Maxim Sobolev wrote:
>> Thanks and sorry about that. I did not realize we use different
>> compilers
>> for different architectures. By any chance, do you know is there a
>> way to
>> test buildworld on amd64 with gcc?
>> 
> 
> Add these args to src.conf or the command line.  I haven't tried these
> with anything except arm platforms for a couple years, but in theory it
> should work on amd64...

I usually just do a make -k -s -j16 tinderbox TARGETS=“amd64 sparc64”  or 
something like that for those cases.

Well, I actually try to compile all platforms all the time in a loop, which is 
why I notice but .. that’s a different story ;-)

/bz
___
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: r298597 - head/sys/kern

2016-04-25 Thread Jamie Gritton
Author: jamie
Date: Mon Apr 25 22:30:10 2016
New Revision: 298597
URL: https://svnweb.freebsd.org/changeset/base/298597

Log:
  Fix the logic in r298585: shm_prison_cansee returns an errno, so is
  the opposite of a boolean.
  
  PR:   48471

Modified:
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_shm.c
==
--- head/sys/kern/sysv_shm.cMon Apr 25 22:25:57 2016(r298596)
+++ head/sys/kern/sysv_shm.cMon Apr 25 22:30:10 2016(r298597)
@@ -230,7 +230,7 @@ shm_find_segment(struct prison *rpr, int
(!shm_allow_removed &&
(shmseg->u.shm_perm.mode & SHMSEG_REMOVED) != 0) ||
(is_shmid && shmseg->u.shm_perm.seq != IPCID_TO_SEQ(arg)) ||
-   !shm_prison_cansee(rpr, shmseg))
+   shm_prison_cansee(rpr, shmseg) != 0)
return (NULL);
return (shmseg);
 }
___
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: r298598 - head/sys/netinet6

2016-04-25 Thread Luiz Otavio O Souza
Author: loos
Date: Mon Apr 25 23:12:39 2016
New Revision: 298598
URL: https://svnweb.freebsd.org/changeset/base/298598

Log:
  Fixes the comment to reflect the code.
  
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Mon Apr 25 22:30:10 2016(r298597)
+++ head/sys/netinet6/nd6.c Mon Apr 25 23:12:39 2016(r298598)
@@ -2352,8 +2352,7 @@ nd6_resolve_slow(struct ifnet *ifp, int 
/*
 * There is a neighbor cache entry, but no ethernet address
 * response yet.  Append this latest packet to the end of the
-* packet queue in the mbuf, unless the number of the packet
-* does not exceed nd6_maxqueuelen.  When it exceeds nd6_maxqueuelen,
+* packet queue in the mbuf.  When it exceeds nd6_maxqueuelen,
 * the oldest packet in the queue will be removed.
 */
 
___
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: r298599 - head/usr.bin/stat

2016-04-25 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 26 00:29:00 2016
New Revision: 298599
URL: https://svnweb.freebsd.org/changeset/base/298599

Log:
  Use MIN() instead of MAX() as the previous syntax was wrote in a weird and
  confused way: "prec > 9 ? 9 : prec".
  
  Submitted by: pfg, ngie and luke 
  MFC after:2 weeks.

Modified:
  head/usr.bin/stat/stat.c

Modified: head/usr.bin/stat/stat.c
==
--- head/usr.bin/stat/stat.cMon Apr 25 23:12:39 2016(r298598)
+++ head/usr.bin/stat/stat.cTue Apr 26 00:29:00 2016(r298599)
@@ -1025,7 +1025,7 @@ format1(const struct stat *st,
 *
 * Nanoseconds: long.
 */
-   (void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9, prec));
+   (void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9));
(void)strcat(lfmt, tmp);
 
/*
___
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: r298443 - head/usr.bin/stat

2016-04-25 Thread Marcelo Araujo
2016-04-25 22:34 GMT+08:00 Pedro Giffuni :

> Marcelo, please revert.
>
> And check your script, of course.
>

Fixed thanks!
The problem is the weird way the expression was wrote before.

Best,


>
> Pedro.
>
>
> On 23/04/2016 04:23, luke wrote:
>
> On Fri, Apr 22, 2016 at 11:43 AM, Marcelo Araujo < 
> ara...@freebsd.org> wrote:
>
>> Author: araujo
>> Date: Fri Apr 22 03:43:06 2016
>> New Revision: 298443
>> URL: https://svnweb.freebsd.org/changeset/base/298443
>>
>> Log:
>>   Use macro MAX() from sys/param.h.
>>
>>   MFC after:2 weeks.
>>
>> Modified:
>>   head/usr.bin/stat/stat.c
>>
>> Modified: head/usr.bin/stat/stat.c
>>
>> ==
>> --- head/usr.bin/stat/stat.cFri Apr 22 03:37:27 2016(r298442)
>> +++ head/usr.bin/stat/stat.cFri Apr 22 03:43:06 2016(r298443)
>> @@ -1025,7 +1025,7 @@ format1(const struct stat *st,
>>  *
>>  * Nanoseconds: long.
>>  */
>> -   (void)snprintf(tmp, sizeof(tmp), "%dld", prec > 9 ? 9 :
>> prec);
>> +   (void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9, prec));
>> (void)strcat(lfmt, tmp);
>>
>> /*
>> ___
>> 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"
>>
>
>
> Hi,
>
> Should this be MIN() ?
>
> (void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9));
>
>
> --
> Chang-Hsien Tsai
>
>
>


-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
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: HEADS UP: I will revert this. (was Re: svn commit: r298443 - head/usr.bin/stat)

2016-04-25 Thread Marcelo Araujo
2016-04-26 5:33 GMT+08:00 Pedro Giffuni :

> Hi Marcelo;
>
> Hi;
>
> I assume you have been very busy.
>
> I will revert this in a couple of hours unless you either explain
> or revert it yourself.
>

Fixed! Sorry my delay, I got a bit busy!
Thanks for the hands up.


>
> Pedro.
>
> On 04/23/16 04:23, luke wrote:
>
>> On Fri, Apr 22, 2016 at 11:43 AM, Marcelo Araujo > > wrote:
>>
>> Author: araujo
>> Date: Fri Apr 22 03:43:06 2016
>> New Revision: 298443
>> URL: https://svnweb.freebsd.org/changeset/base/298443
>>
>> Log:
>>   Use macro MAX() from sys/param.h.
>>
>>   MFC after:2 weeks.
>>
>> Modified:
>>   head/usr.bin/stat/stat.c
>>
>> Modified: head/usr.bin/stat/stat.c
>>
>> ==
>> --- head/usr.bin/stat/stat.cFri Apr 22 03:37:27 2016
>> (r298442)
>> +++ head/usr.bin/stat/stat.cFri Apr 22 03:43:06 2016
>> (r298443)
>> @@ -1025,7 +1025,7 @@ format1(const struct stat *st,
>>  *
>>  * Nanoseconds: long.
>>  */
>> -   (void)snprintf(tmp, sizeof(tmp), "%dld", prec > 9 ?
>> 9 : prec);
>> +   (void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9,
>> prec));
>> (void)strcat(lfmt, tmp);
>>
>> /*
>> ___
>> 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
>> "
>>
>>
>>
>> Hi,
>>
>> Should this be MIN() ?
>>
>> (void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9));
>>
>>
>> --
>> Chang-Hsien Tsai
>>
>>


-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
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: r298600 - in head/lib/libc/db: btree hash

2016-04-25 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Apr 26 01:17:05 2016
New Revision: 298600
URL: https://svnweb.freebsd.org/changeset/base/298600

Log:
  libc: make more use of the howmany() macro when available.
  
  We have a howmany() macro in the  header that is
  convenient to re-use as it makes things easier to read.

Modified:
  head/lib/libc/db/btree/bt_open.c
  head/lib/libc/db/hash/hash.c

Modified: head/lib/libc/db/btree/bt_open.c
==
--- head/lib/libc/db/btree/bt_open.cTue Apr 26 00:29:00 2016
(r298599)
+++ head/lib/libc/db/btree/bt_open.cTue Apr 26 01:17:05 2016
(r298600)
@@ -277,7 +277,7 @@ __bt_open(const char *fname, int flags, 
b.cachesize = b.psize * MINCACHE;
 
/* Calculate number of pages to cache. */
-   ncache = (b.cachesize + t->bt_psize - 1) / t->bt_psize;
+   ncache = howmany(b.cachesize, t->bt_psize);
 
/*
 * The btree data structure requires that at least two keys can fit on

Modified: head/lib/libc/db/hash/hash.c
==
--- head/lib/libc/db/hash/hash.cTue Apr 26 00:29:00 2016
(r298599)
+++ head/lib/libc/db/hash/hash.cTue Apr 26 01:17:05 2016
(r298600)
@@ -160,8 +160,7 @@ __hash_open(const char *file, int flags,
 * maximum bucket number, so the number of buckets is
 * max_bucket + 1.
 */
-   nsegs = (hashp->MAX_BUCKET + 1 + hashp->SGSIZE - 1) /
-hashp->SGSIZE;
+   nsegs = howmany(hashp->MAX_BUCKET + 1, hashp->SGSIZE);
if (alloc_segs(hashp, nsegs))
/*
 * If alloc_segs fails, table will have been destroyed
___
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: r298601 - head/lib/libstand

2016-04-25 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Apr 26 01:19:36 2016
New Revision: 298601
URL: https://svnweb.freebsd.org/changeset/base/298601

Log:
  libstand: make more use of the howmany() macro when available.
  
  We have a howmany() macro in the  header that is
  convenient to re-use as it makes things easier to read.

Modified:
  head/lib/libstand/nandfs.c

Modified: head/lib/libstand/nandfs.c
==
--- head/lib/libstand/nandfs.c  Tue Apr 26 01:17:05 2016(r298600)
+++ head/lib/libstand/nandfs.c  Tue Apr 26 01:19:36 2016(r298601)
@@ -1017,7 +1017,7 @@ ioread(struct open_file *f, off_t pos, v
 
off = pos % bsize;
pos /= bsize;
-   nsec = (length + (bsize - 1)) / bsize;
+   nsec = howmany(length, bsize);
 
NANDFS_DEBUG("pos=%lld length=%d off=%d nsec=%d\n", pos, length,
off, nsec);
___
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: r298602 - head/lib/libcuse

2016-04-25 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Apr 26 01:20:16 2016
New Revision: 298602
URL: https://svnweb.freebsd.org/changeset/base/298602

Log:
  libcuse: make more use of the howmany() macro when available.
  
  We have a howmany() macro in the  header that is
  convenient to re-use as it makes things easier to read.

Modified:
  head/lib/libcuse/cuse_lib.c

Modified: head/lib/libcuse/cuse_lib.c
==
--- head/lib/libcuse/cuse_lib.c Tue Apr 26 01:19:36 2016(r298601)
+++ head/lib/libcuse/cuse_lib.c Tue Apr 26 01:20:16 2016(r298602)
@@ -184,7 +184,7 @@ cuse_vmalloc(int size)
if (size < 1)
return (NULL);
 
-   info.page_count = (size + PAGE_SIZE - 1) / PAGE_SIZE;
+   info.page_count = howmany(size, PAGE_SIZE);
 
CUSE_LOCK();
for (n = 0; n != CUSE_ALLOC_UNIT_MAX; n++) {
___
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: r298603 - head/sys/net80211

2016-04-25 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 26 01:26:11 2016
New Revision: 298603
URL: https://svnweb.freebsd.org/changeset/base/298603

Log:
  [net80211] add an ioctl for LDPC configuration.

Modified:
  head/sys/net80211/ieee80211_ioctl.h

Modified: head/sys/net80211/ieee80211_ioctl.h
==
--- head/sys/net80211/ieee80211_ioctl.h Tue Apr 26 01:20:16 2016
(r298602)
+++ head/sys/net80211/ieee80211_ioctl.h Tue Apr 26 01:26:11 2016
(r298603)
@@ -702,6 +702,7 @@ struct ieee80211req {
 #defineIEEE80211_IOC_RIFS  111 /* RIFS config (on, 
off) */
 #defineIEEE80211_IOC_GREENFIELD112 /* Greenfield (on, off) 
*/
 #defineIEEE80211_IOC_STBC  113 /* STBC Tx/RX (on, off) 
*/
+#defineIEEE80211_IOC_LDPC  114 /* LDPC Tx/RX (on, off) 
*/
 
 #defineIEEE80211_IOC_MESH_ID   170 /* mesh identifier */
 #defineIEEE80211_IOC_MESH_AP   171 /* accepting peerings */
___
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: r298604 - head/sys/net80211

2016-04-25 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 26 01:29:03 2016
New Revision: 298604
URL: https://svnweb.freebsd.org/changeset/base/298604

Log:
  [net80211] add STBC capability flags to iv_flags_ht.
  
  This is in preparation for exposing configuring STBC flags up to ifconfig
  so STBC TX/RX can be configured at runtime.
  
  * Set the FHT_STBC flags for TX/RX if the HT capabilitiex exist
  * Clear the RX STBC HT capability flag when creating a HTCAP IE, so
we only announce it if it's configured in the FHT flags.
  
  Tested:
  
  * AR9331 (carambola2), AP/STA modes

Modified:
  head/sys/net80211/ieee80211_ht.c

Modified: head/sys/net80211/ieee80211_ht.c
==
--- head/sys/net80211/ieee80211_ht.cTue Apr 26 01:26:11 2016
(r298603)
+++ head/sys/net80211/ieee80211_ht.cTue Apr 26 01:29:03 2016
(r298604)
@@ -293,6 +293,11 @@ ieee80211_ht_vattach(struct ieee80211vap
vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_RX;
if (vap->iv_htcaps & IEEE80211_HTC_AMSDU)
vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_TX;
+
+   if (vap->iv_htcaps & IEEE80211_HTCAP_TXSTBC)
+   vap->iv_flags_ht |= IEEE80211_FHT_STBC_TX;
+   if (vap->iv_htcaps & IEEE80211_HTCAP_RXSTBC)
+   vap->iv_flags_ht |= IEEE80211_FHT_STBC_RX;
}
/* NB: disable default legacy WDS, too many issues right now */
if (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY)
@@ -2778,6 +2783,13 @@ ieee80211_add_htcap_body(uint8_t *frm, s
if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) == 0 ||
(caps & IEEE80211_HTCAP_CHWIDTH40) == 0)
caps &= ~IEEE80211_HTCAP_SHORTGI40;
+
+   /* adjust STBC based on receive capabilities */
+   if ((vap->iv_flags_ht & IEEE80211_FHT_STBC_RX) == 0)
+   caps &= ~IEEE80211_HTCAP_RXSTBC;
+
+   /* XXX TODO: adjust LDPC based on receive capabilities */
+
ADDSHORT(frm, caps);
 
/* HT parameters */
___
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: r298605 - head/sys/net80211

2016-04-25 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 26 01:29:26 2016
New Revision: 298605
URL: https://svnweb.freebsd.org/changeset/base/298605

Log:
  [net80211] add the STBC ioctl support.
  
  This adds configurable STBC TX and RX support.

Modified:
  head/sys/net80211/ieee80211_ioctl.c

Modified: head/sys/net80211/ieee80211_ioctl.c
==
--- head/sys/net80211/ieee80211_ioctl.c Tue Apr 26 01:29:03 2016
(r298604)
+++ head/sys/net80211/ieee80211_ioctl.c Tue Apr 26 01:29:26 2016
(r298605)
@@ -1128,6 +1128,13 @@ ieee80211_ioctl_get80211(struct ieee8021
ireq->i_val =
(vap->iv_flags_ht & IEEE80211_FHT_RIFS) != 0;
break;
+   case IEEE80211_IOC_STBC:
+   ireq->i_val = 0;
+   if (vap->iv_flags_ht & IEEE80211_FHT_STBC_TX)
+   ireq->i_val |= 1;
+   if (vap->iv_flags_ht & IEEE80211_FHT_STBC_RX)
+   ireq->i_val |= 2;
+   break;
default:
error = ieee80211_ioctl_getdefault(vap, ireq);
break;
@@ -3265,6 +3272,31 @@ ieee80211_ioctl_set80211(struct ieee8021
if (isvapht(vap))
error = ERESTART;
break;
+   case IEEE80211_IOC_STBC:
+   /* Check if we can do STBC TX/RX before changing the setting */
+   if ((ireq->i_val & 1) &&
+   ((vap->iv_htcaps & IEEE80211_HTCAP_TXSTBC) == 0))
+   return EOPNOTSUPP;
+   if ((ireq->i_val & 2) &&
+   ((vap->iv_htcaps & IEEE80211_HTCAP_RXSTBC) == 0))
+   return EOPNOTSUPP;
+
+   /* TX */
+   if (ireq->i_val & 1)
+   vap->iv_flags_ht |= IEEE80211_FHT_STBC_TX;
+   else
+   vap->iv_flags_ht &= ~IEEE80211_FHT_STBC_TX;
+
+   /* RX */
+   if (ireq->i_val & 2)
+   vap->iv_flags_ht |= IEEE80211_FHT_STBC_RX;
+   else
+   vap->iv_flags_ht &= ~IEEE80211_FHT_STBC_RX;
+
+   /* NB: reset only if we're operating on an 11n channel */
+   if (isvapht(vap))
+   error = ERESTART;
+   break;
default:
error = ieee80211_ioctl_setdefault(vap, ireq);
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: r298606 - head/sbin/ifconfig

2016-04-25 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 26 01:30:29 2016
New Revision: 298606
URL: https://svnweb.freebsd.org/changeset/base/298606

Log:
  [ifconfig] add STBC TX/RX configuration
  
  This adds the ability to view and configure the STBC parameter for
  both transmit and receive.
  
  Whilst here, fix a typo for AMSDU.
  
  TODO:
  
  * manpage update

Modified:
  head/sbin/ifconfig/ifieee80211.c

Modified: head/sbin/ifconfig/ifieee80211.c
==
--- head/sbin/ifconfig/ifieee80211.cTue Apr 26 01:29:26 2016
(r298605)
+++ head/sbin/ifconfig/ifieee80211.cTue Apr 26 01:30:29 2016
(r298606)
@@ -1697,7 +1697,7 @@ set80211ampdu(const char *val, int d, in
int ampdu;
 
if (get80211val(s, IEEE80211_IOC_AMPDU, &du) < 0)
-   errx(-1, "cannot get AMPDU setting");
+   errx(-1, "cannot set AMPDU setting");
if (d < 0) {
d = -d;
ampdu &= ~d;
@@ -1706,6 +1706,21 @@ set80211ampdu(const char *val, int d, in
set80211(s, IEEE80211_IOC_AMPDU, ampdu, 0, NULL);
 }
 
+static void
+set80211stbc(const char *val, int d, int s, const struct afswtch *rafp)
+{
+   int stbc;
+
+   if (get80211val(s, IEEE80211_IOC_STBC, &stbc) < 0)
+   errx(-1, "cannot set STBC setting");
+   if (d < 0) {
+   d = -d;
+   stbc &= ~d;
+   } else
+   stbc |= d;
+   set80211(s, IEEE80211_IOC_STBC, stbc, 0, NULL);
+}
+
 static
 DECL_CMD_FUNC(set80211ampdulimit, val, d)
 {
@@ -4828,6 +4843,23 @@ end:
else if (verbose)
LINE_CHECK("-rifs");
}
+   if (get80211val(s, IEEE80211_IOC_STBC, &val) != -1) {
+   switch (val) {
+   case 0:
+   LINE_CHECK("-stbc");
+   break;
+   case 1:
+   LINE_CHECK("stbctx -stbcrx");
+   break;
+   case 2:
+   LINE_CHECK("-stbctx stbcrx");
+   break;
+   case 3:
+   if (verbose)
+   LINE_CHECK("stbc");
+   break;
+   }
+   }
}
 
if (get80211val(s, IEEE80211_IOC_WME, &wme) != -1) {
@@ -5324,6 +5356,12 @@ static struct cmd ieee80211_cmds[] = {
DEF_CMD("amsdu",3,  set80211amsdu), /* NB: tx+rx */
DEF_CMD("-amsdu",   -3, set80211amsdu),
DEF_CMD_ARG("amsdulimit",   set80211amsdulimit),
+   DEF_CMD("stbcrx",   2,  set80211stbc),
+   DEF_CMD("-stbcrx",  -2, set80211stbc),
+   DEF_CMD("stbctx",   1,  set80211stbc),
+   DEF_CMD("-stbctx",  -1, set80211stbc),
+   DEF_CMD("stbc", 3,  set80211stbc),  /* NB: tx+rx */
+   DEF_CMD("-ampdu",   -3, set80211stbc),
DEF_CMD("puren",1,  set80211puren),
DEF_CMD("-puren",   0,  set80211puren),
DEF_CMD("doth", 1,  set80211doth),
___
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: r298607 - head/sys/dev/ath

2016-04-25 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 26 01:34:21 2016
New Revision: 298607
URL: https://svnweb.freebsd.org/changeset/base/298607

Log:
  [ath] obey the STBC flag setting in iv_flags_ht
  
  Add support for the FHT_STBC_TX flag in iv_flags_ht, so it'll now obey
  the per-vap ifconfig stbctx flag.
  
  This means that we can do STBC TX on one vap and not another VAP.
  (As well as STBC RX on said vap; that changes the HTCAP announcement.)

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

Modified: head/sys/dev/ath/if_ath_tx_ht.c
==
--- head/sys/dev/ath/if_ath_tx_ht.c Tue Apr 26 01:30:29 2016
(r298606)
+++ head/sys/dev/ath/if_ath_tx_ht.c Tue Apr 26 01:34:21 2016
(r298607)
@@ -272,8 +272,11 @@ ath_tx_rate_fill_rcflags(struct ath_soft
 * can receive (at least) 1 stream STBC, AND it's
 * MCS 0-7, AND we have at least two chains enabled,
 * enable STBC.
+*
+* XXX TODO: .. and the rate is an 11n rate?
 */
if (ic->ic_htcaps & IEEE80211_HTCAP_TXSTBC &&
+   ni->ni_vap->iv_flags_ht & IEEE80211_FHT_STBC_TX &&
ni->ni_htcap & IEEE80211_HTCAP_RXSTBC_1STREAM &&
(sc->sc_cur_txchainmask > 1) &&
HT_RC_2_STREAMS(rate) == 1) {
@@ -281,10 +284,6 @@ ath_tx_rate_fill_rcflags(struct ath_soft
}
 
/*
-* XXX TODO: LDPC
-*/
-
-   /*
 * Dual / Triple stream rate?
 */
if (HT_RC_2_STREAMS(rate) == 2)
@@ -565,6 +564,12 @@ ath_rateseries_setup(struct ath_softc *s
}
 
/*
+* TODO: If we're all doing 11n rates then we can set LDPC.
+* If we've been asked to /do/ LDPC but we are handed a
+* legacy rate, then we should complain.  Loudly.
+*/
+
+   /*
 * PktDuration doesn't include slot, ACK, RTS, etc timing -
 * it's just the packet duration
 */
___
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: r298608 - head/sys/dev/ath

2016-04-25 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 26 01:37:03 2016
New Revision: 298608
URL: https://svnweb.freebsd.org/changeset/base/298608

Log:
  [ath] add LDPC capability support and LDPC RX support.
  
  This enables LDPC receive support for the AR9300 chips that support it.
  It'll announce LDPC support via net80211.
  
  Tested:
  
  * AR9380, STA mode
  * AR9331, (to verify the HAL didn't attach it to a chip which
doesn't support LDPC.)
  
  TODO:
  
  * Add in net80211 machinery to make this configurable at runtime.

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Tue Apr 26 01:34:21 2016(r298607)
+++ head/sys/dev/ath/if_ath.c   Tue Apr 26 01:37:03 2016(r298608)
@@ -1062,6 +1062,7 @@ ath_attach(u_int16_t devid, struct ath_s
if (ath_hal_getcapability(ah, HAL_CAP_HT, 0, NULL) == HAL_OK &&
(wmodes & (HAL_MODE_HT20 | HAL_MODE_HT40))) {
uint32_t rxs, txs;
+   uint32_t ldpc;
 
device_printf(sc->sc_dev, "[HT] enabling HT modes\n");
 
@@ -1130,6 +1131,18 @@ ath_attach(u_int16_t devid, struct ath_s
"[HT] RTS aggregates limited to %d KiB\n",
sc->sc_rts_aggr_limit / 1024);
 
+   /*
+* LDPC
+*/
+   if ((ath_hal_getcapability(ah, HAL_CAP_LDPC, 0, &ldpc))
+   == HAL_OK && (ldpc == 1)) {
+   sc->sc_has_ldpc = 1;
+   device_printf(sc->sc_dev,
+   "[HT] LDPC transmit/receive enabled\n");
+   ic->ic_htcaps |= IEEE80211_HTCAP_LDPC;
+   }
+
+
device_printf(sc->sc_dev,
"[HT] %d RX streams; %d TX streams\n", rxs, txs);
}

Modified: head/sys/dev/ath/if_athvar.h
==
--- head/sys/dev/ath/if_athvar.hTue Apr 26 01:34:21 2016
(r298607)
+++ head/sys/dev/ath/if_athvar.hTue Apr 26 01:37:03 2016
(r298608)
@@ -653,6 +653,7 @@ struct ath_softc {
sc_use_ent  : 1,
sc_rx_stbc  : 1,
sc_tx_stbc  : 1,
+   sc_has_ldpc : 1,
sc_hasenforcetxop : 1, /* support enforce TxOP 
*/
sc_hasdivcomb : 1, /* RX diversity 
combining */
sc_rx_lnamixer : 1;/* RX using LNA mixing */
@@ -1307,6 +1308,10 @@ void ath_intr(void *);
 
 #defineath_hal_hasdivantcomb(_ah) \
(ath_hal_getcapability(_ah, HAL_CAP_ANT_DIV_COMB, 0, NULL) == HAL_OK)
+#defineath_hal_hasldpc(_ah) \
+   (ath_hal_getcapability(_ah, HAL_CAP_LDPC, 0, NULL) == HAL_OK)
+#defineath_hal_hasldpcwar(_ah) \
+   (ath_hal_getcapability(_ah, HAL_CAP_LDPCWAR, 0, NULL) == HAL_OK)
 
 /* EDMA definitions */
 #defineath_hal_hasedma(_ah) \
___
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: r298609 - head/sys/fs/ext2fs

2016-04-25 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Apr 26 01:41:15 2016
New Revision: 298609
URL: https://svnweb.freebsd.org/changeset/base/298609

Log:
  ext2fs: make use of the howmany() macro when available.
  
  We have a howmany() macro in the  header that is
  convenient to re-use as it makes things easier to read.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/ext2fs/ext2_vfsops.c

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==
--- head/sys/fs/ext2fs/ext2_vfsops.cTue Apr 26 01:37:03 2016
(r298608)
+++ head/sys/fs/ext2fs/ext2_vfsops.cTue Apr 26 01:41:15 2016
(r298609)
@@ -357,10 +357,10 @@ compute_sb_data(struct vnode *devvp, str
fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs);
fs->e2fs_itpg = fs->e2fs_ipg / fs->e2fs_ipb;
/* s_resuid / s_resgid ? */
-   fs->e2fs_gcount = (es->e2fs_bcount - es->e2fs_first_dblock +
-   EXT2_BLOCKS_PER_GROUP(fs) - 1) / EXT2_BLOCKS_PER_GROUP(fs);
+   fs->e2fs_gcount = howmany(es->e2fs_bcount - es->e2fs_first_dblock,
+   EXT2_BLOCKS_PER_GROUP(fs));
e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd);
-   db_count = (fs->e2fs_gcount + e2fs_descpb - 1) / e2fs_descpb;
+   db_count = howmany(fs->e2fs_gcount, e2fs_descpb);
fs->e2fs_gdbcount = db_count;
fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize,
M_EXT2MNT, M_WAITOK);
@@ -970,7 +970,7 @@ ext2_vget(struct mount *mp, ino_t ino, i
 */
if (!(ip->i_flag & IN_E4EXTENTS) &&
(S_ISDIR(ip->i_mode) || S_ISREG(ip->i_mode))) {
-   used_blocks = (ip->i_size+fs->e2fs_bsize-1) / fs->e2fs_bsize;
+   used_blocks = howmany(ip->i_size, fs->e2fs_bsize);
for (i = used_blocks; i < EXT2_NDIR_BLOCKS; i++)
ip->i_db[i] = 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: r298610 - head/sys/ddb

2016-04-25 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Apr 26 01:52:35 2016
New Revision: 298610
URL: https://svnweb.freebsd.org/changeset/base/298610

Log:
  ddb: Make use of our roundup() macro when available.

Modified:
  head/sys/ddb/db_expr.c

Modified: head/sys/ddb/db_expr.c
==
--- head/sys/ddb/db_expr.c  Tue Apr 26 01:41:15 2016(r298609)
+++ head/sys/ddb/db_expr.c  Tue Apr 26 01:52:35 2016(r298610)
@@ -154,7 +154,7 @@ db_mult_expr(db_expr_t *valuep)
else if (t == tPCT)
lhs %= rhs;
else
-   lhs = ((lhs+rhs-1)/rhs)*rhs;
+   lhs = roundup(lhs, rhs);
}
t = db_read_token();
}
___
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: r298611 - head/sys/dev/iwm

2016-04-25 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 26 03:24:28 2016
New Revision: 298611
URL: https://svnweb.freebsd.org/changeset/base/298611

Log:
  [iwm] add extra transmit setup/completion logging so I can see what's going 
on.
  
  I'm seeing 5GHz association work but data not work until the rate drops,
  so I need way more information about what's being programmed into the
  transmit descriptors.
  
  Tested:
  
  * 7260AC, STA mode

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Tue Apr 26 01:52:35 2016(r298610)
+++ head/sys/dev/iwm/if_iwm.c   Tue Apr 26 03:24:28 2016(r298611)
@@ -2410,6 +2410,17 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_soft
KASSERT(tx_resp->frame_count == 1, ("too many frames"));
 
/* Update rate control statistics. */
+   IWM_DPRINTF(sc, IWM_DEBUG_XMIT, "%s: status=0x%04x, seq=%d, fc=%d, 
btc=%d, frts=%d, ff=%d, irate=%08x, wmt=%d\n",
+   __func__,
+   (int) le16toh(tx_resp->status.status),
+   (int) le16toh(tx_resp->status.sequence),
+   tx_resp->frame_count,
+   tx_resp->bt_kill_count,
+   tx_resp->failure_rts,
+   tx_resp->failure_frame,
+   le32toh(tx_resp->initial_rate),
+   (int) le16toh(tx_resp->wireless_media_time));
+
if (status != IWM_TX_STATUS_SUCCESS &&
status != IWM_TX_STATUS_DIRECT_DONE) {
ieee80211_ratectl_tx_complete(vap, ni,
@@ -2802,8 +2813,12 @@ iwm_tx(struct iwm_softc *sc, struct mbuf
KASSERT(data->in != NULL, ("node is NULL"));
 
IWM_DPRINTF(sc, IWM_DEBUG_XMIT,
-   "sending data: qid=%d idx=%d len=%d nsegs=%d\n",
-   ring->qid, ring->cur, totlen, nsegs);
+   "sending data: qid=%d idx=%d len=%d nsegs=%d txflags=0x%08x 
rate_n_flags=0x%08x rateidx=%d\n",
+   ring->qid, ring->cur, totlen, nsegs,
+   le32toh(tx->tx_flags),
+   le32toh(tx->rate_n_flags),
+   (int) tx->initial_rate_index
+   );
 
/* Fill TX descriptor. */
desc->num_tbs = 2 + nsegs;
___
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: r298612 - head/sys/dev/iwm

2016-04-25 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 26 04:40:59 2016
New Revision: 298612
URL: https://svnweb.freebsd.org/changeset/base/298612

Log:
  [iwm] implement suspend/resume through ieee80211_{suspend,resume}_all
  
  This allows wifi to associate correctly after a suspend/resume cycle.
  
  Yes, I'm using this now day to day.
  
  Tested:
  
  * Intel 7260AC, STA mode

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Tue Apr 26 03:24:28 2016(r298611)
+++ head/sys/dev/iwm/if_iwm.c   Tue Apr 26 04:40:59 2016(r298612)
@@ -4934,6 +4934,8 @@ iwm_init_task(void *arg1)
 static int
 iwm_resume(device_t dev)
 {
+   struct iwm_softc *sc = device_get_softc(dev);
+   int do_reinit = 0;
uint16_t reg;
 
/* Clear device-specific "PCI retry timeout" register (41h). */
@@ -4941,17 +4943,33 @@ iwm_resume(device_t dev)
pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg));
iwm_init_task(device_get_softc(dev));
 
+   IWM_LOCK(sc);
+   if (sc->sc_flags & IWM_FLAG_DORESUME) {
+   sc->sc_flags &= ~IWM_FLAG_DORESUME;
+   do_reinit = 1;
+   }
+   IWM_UNLOCK(sc);
+
+   if (do_reinit)
+   ieee80211_resume_all(&sc->sc_ic);
+
return 0;
 }
 
 static int
 iwm_suspend(device_t dev)
 {
+   int do_stop = 0;
struct iwm_softc *sc = device_get_softc(dev);
 
-   if (sc->sc_ic.ic_nrunning > 0) {
+   do_stop = !! (sc->sc_ic.ic_nrunning > 0);
+
+   ieee80211_suspend_all(&sc->sc_ic);
+
+   if (do_stop) {
IWM_LOCK(sc);
iwm_stop(sc);
+   sc->sc_flags |= IWM_FLAG_DORESUME;
IWM_UNLOCK(sc);
}
 

Modified: head/sys/dev/iwm/if_iwmvar.h
==
--- head/sys/dev/iwm/if_iwmvar.hTue Apr 26 03:24:28 2016
(r298611)
+++ head/sys/dev/iwm/if_iwmvar.hTue Apr 26 04:40:59 2016
(r298612)
@@ -405,6 +405,7 @@ struct iwm_softc {
 #define IWM_FLAG_STOPPED   (1 << 2)
 #define IWM_FLAG_RFKILL(1 << 3)
 #define IWM_FLAG_BUSY  (1 << 4)
+#defineIWM_FLAG_DORESUME   (1 << 5)
 
struct intr_config_hook sc_preinit_hook;
struct callout  sc_watchdog_to;
___
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: r298612 - head/sys/dev/iwm

2016-04-25 Thread Ravi Pokala
> do_stop = !! (sc->sc_ic.ic_nrunning > 0);

Why the double-negation? Isn't

do_stop = (sc->sc_ic.ic_nrunning > 0);

equivalent?

-Ravi (rpokala@)



-Original Message-
From:  on behalf of Adrian Chadd 

Date: 2016-04-25, Monday at 21:40
To: , , 

Subject: svn commit: r298612 - head/sys/dev/iwm

>Author: adrian
>Date: Tue Apr 26 04:40:59 2016
>New Revision: 298612
>URL: https://svnweb.freebsd.org/changeset/base/298612
>
>Log:
>  [iwm] implement suspend/resume through ieee80211_{suspend,resume}_all
>  
>  This allows wifi to associate correctly after a suspend/resume cycle.
>  
>  Yes, I'm using this now day to day.
>  
>  Tested:
>  
>  * Intel 7260AC, STA mode
>
>Modified:
>  head/sys/dev/iwm/if_iwm.c
>  head/sys/dev/iwm/if_iwmvar.h
>
>Modified: head/sys/dev/iwm/if_iwm.c
>==
>--- head/sys/dev/iwm/if_iwm.c  Tue Apr 26 03:24:28 2016(r298611)
>+++ head/sys/dev/iwm/if_iwm.c  Tue Apr 26 04:40:59 2016(r298612)
>@@ -4934,6 +4934,8 @@ iwm_init_task(void *arg1)
> static int
> iwm_resume(device_t dev)
> {
>+  struct iwm_softc *sc = device_get_softc(dev);
>+  int do_reinit = 0;
>   uint16_t reg;
> 
>   /* Clear device-specific "PCI retry timeout" register (41h). */
>@@ -4941,17 +4943,33 @@ iwm_resume(device_t dev)
>   pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg));
>   iwm_init_task(device_get_softc(dev));
> 
>+  IWM_LOCK(sc);
>+  if (sc->sc_flags & IWM_FLAG_DORESUME) {
>+  sc->sc_flags &= ~IWM_FLAG_DORESUME;
>+  do_reinit = 1;
>+  }
>+  IWM_UNLOCK(sc);
>+
>+  if (do_reinit)
>+  ieee80211_resume_all(&sc->sc_ic);
>+
>   return 0;
> }
> 
> static int
> iwm_suspend(device_t dev)
> {
>+  int do_stop = 0;
>   struct iwm_softc *sc = device_get_softc(dev);
> 
>-  if (sc->sc_ic.ic_nrunning > 0) {
>+  do_stop = !! (sc->sc_ic.ic_nrunning > 0);
>+
>+  ieee80211_suspend_all(&sc->sc_ic);
>+
>+  if (do_stop) {
>   IWM_LOCK(sc);
>   iwm_stop(sc);
>+  sc->sc_flags |= IWM_FLAG_DORESUME;
>   IWM_UNLOCK(sc);
>   }
> 
>
>Modified: head/sys/dev/iwm/if_iwmvar.h
>==
>--- head/sys/dev/iwm/if_iwmvar.h   Tue Apr 26 03:24:28 2016
>(r298611)
>+++ head/sys/dev/iwm/if_iwmvar.h   Tue Apr 26 04:40:59 2016
>(r298612)
>@@ -405,6 +405,7 @@ struct iwm_softc {
> #define IWM_FLAG_STOPPED  (1 << 2)
> #define IWM_FLAG_RFKILL   (1 << 3)
> #define IWM_FLAG_BUSY (1 << 4)
>+#define   IWM_FLAG_DORESUME   (1 << 5)
> 
>   struct intr_config_hook sc_preinit_hook;
>   struct callout  sc_watchdog_to;
>

___
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: r298613 - head/sys/dev/hyperv/storvsc

2016-04-25 Thread Sepherosa Ziehau
Author: sephe
Date: Tue Apr 26 04:48:57 2016
New Revision: 298613
URL: https://svnweb.freebsd.org/changeset/base/298613

Log:
  hyperv/stor: Remove the useless hs_open_multi_channel
  
  This fixes the sub-channel offer race after Hyper-V device probe/attach
  is moved to vmbus SYSINIT/attach.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cTue Apr 26 
04:40:59 2016(r298612)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cTue Apr 26 
04:48:57 2016(r298613)
@@ -140,7 +140,6 @@ struct storvsc_softc {
uint32_ths_num_out_reqs;
boolean_t   hs_destroy;
boolean_t   hs_drain_notify;
-   boolean_t   hs_open_multi_channel;
struct sema hs_drain_sema;  
struct hv_storvsc_request   hs_init_req;
struct hv_storvsc_request   hs_reset_req;
@@ -336,9 +335,6 @@ storvsc_handle_sc_creation(void *context
if (sc == NULL)
return;
 
-   if (FALSE == sc->hs_open_multi_channel)
-   return;
-   
memset(&props, 0, sizeof(props));
 
ret = hv_vmbus_channel_open(new_channel,
@@ -417,8 +413,6 @@ storvsc_send_multichannel_request(struct
return;
}
 
-   sc->hs_open_multi_channel = TRUE;
-
if (bootverbose)
printf("Storvsc create multi-channel success!\n");
 }
@@ -1034,7 +1028,6 @@ storvsc_attach(device_t dev)
 
sc->hs_destroy = FALSE;
sc->hs_drain_notify = FALSE;
-   sc->hs_open_multi_channel = FALSE;
sema_init(&sc->hs_drain_sema, 0, "Store Drain Sema");
 
ret = hv_storvsc_connect_vsp(hv_dev);
___
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: r298614 - head/sys/dev/hyperv/storvsc

2016-04-25 Thread Sepherosa Ziehau
Author: sephe
Date: Tue Apr 26 05:00:40 2016
New Revision: 298614
URL: https://svnweb.freebsd.org/changeset/base/298614

Log:
  hyperv/stor: Synchronize sub-channel offers
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cTue Apr 26 
04:48:57 2016(r298613)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cTue Apr 26 
05:00:40 2016(r298614)
@@ -357,6 +357,7 @@ storvsc_handle_sc_creation(void *context
 static void
 storvsc_send_multichannel_request(struct hv_device *dev, int max_chans)
 {
+   struct hv_vmbus_channel **subchan;
struct storvsc_softc *sc;
struct hv_storvsc_request *request;
struct vstor_packet *vstor_packet;  
@@ -413,6 +414,12 @@ storvsc_send_multichannel_request(struct
return;
}
 
+   /*
+* Wait for sub-channels setup to complete.
+*/
+   subchan = vmbus_get_subchan(dev->channel, request_channels_cnt);
+   vmbus_rel_subchan(subchan, request_channels_cnt);
+
if (bootverbose)
printf("Storvsc create multi-channel success!\n");
 }
___
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: r298615 - head/sys/dev/hyperv/netvsc

2016-04-25 Thread Sepherosa Ziehau
Author: sephe
Date: Tue Apr 26 05:08:55 2016
New Revision: 298615
URL: https://svnweb.freebsd.org/changeset/base/298615

Log:
  hyperv/hn: Avoid sub-channel creation callback.
  
  Since the sub-channel offers are synchronized, we can do our own
  channel setup without using the sub-channel creation callback.
  
  This paves the way to whack the sub-channel creation callback.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/hv_net_vsc.h
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  head/sys/dev/hyperv/netvsc/hv_rndis.h

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Apr 26 05:00:40 2016
(r298614)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Apr 26 05:08:55 2016
(r298615)
@@ -661,30 +661,12 @@ hv_nv_disconnect_from_vsp(netvsc_dev *ne
hv_nv_destroy_send_buffer(net_dev);
 }
 
-/*
- * Callback handler for subchannel offer
- * @@param context new subchannel
- */
-static void
-hv_nv_subchan_callback(void *xchan)
+void
+hv_nv_subchan_attach(struct hv_vmbus_channel *chan)
 {
-   struct hv_vmbus_channel *chan = xchan;
-   netvsc_dev *net_dev;
-   uint16_t chn_index = chan->offer_msg.offer.sub_channel_index;
-   struct hv_device *device = chan->device;
-   hn_softc_t *sc = device_get_softc(device->device);
-   int ret;
-
-   net_dev = sc->net_dev;
-
-   if (chn_index >= net_dev->num_channel) {
-   /* Would this ever happen? */
-   return;
-   }
-   netvsc_subchan_callback(sc, chan);
 
chan->hv_chan_rdbuf = malloc(NETVSC_PACKET_SIZE, M_NETVSC, M_WAITOK);
-   ret = hv_vmbus_channel_open(chan, NETVSC_DEVICE_RING_BUFFER_SIZE,
+   hv_vmbus_channel_open(chan, NETVSC_DEVICE_RING_BUFFER_SIZE,
NETVSC_DEVICE_RING_BUFFER_SIZE, NULL, 0,
hv_nv_on_channel_callback, chan);
 }
@@ -721,7 +703,6 @@ hv_nv_on_device_add(struct hv_device *de
free(chan->hv_chan_rdbuf, M_NETVSC);
goto cleanup;
}
-   chan->sc_creation_callback = hv_nv_subchan_callback;
 
/*
 * Connect with the NetVsp

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Apr 26 05:00:40 2016
(r298614)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Apr 26 05:08:55 2016
(r298615)
@@ -1266,6 +1266,7 @@ int hv_nv_on_device_remove(struct hv_dev
 boolean_t destroy_channel);
 int hv_nv_on_send(struct hv_vmbus_channel *chan, netvsc_packet *pkt);
 int hv_nv_get_next_send_section(netvsc_dev *net_dev);
+void hv_nv_subchan_attach(struct hv_vmbus_channel *chan);
 
 #endif  /* __HV_NET_VSC_H__ */
 

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Tue Apr 26 05:00:40 
2016(r298614)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Tue Apr 26 05:08:55 
2016(r298615)
@@ -332,6 +332,7 @@ static void hn_create_rx_data(struct hn_
 static void hn_destroy_rx_data(struct hn_softc *sc);
 static void hn_set_tx_chimney_size(struct hn_softc *, int);
 static void hn_channel_attach(struct hn_softc *, struct hv_vmbus_channel *);
+static void hn_subchan_attach(struct hn_softc *, struct hv_vmbus_channel *);
 
 static int hn_transmit(struct ifnet *, struct mbuf *);
 static void hn_xmit_qflush(struct ifnet *);
@@ -547,19 +548,6 @@ netvsc_attach(device_t dev)
error = hv_rf_on_device_add(device_ctx, &device_info, ring_cnt);
if (error)
goto failed;
-
-   if (sc->net_dev->num_channel > 1) {
-   struct hv_vmbus_channel **subchan;
-   int subchan_cnt = sc->net_dev->num_channel - 1;
-
-   /*
-* Wait for sub-channels setup to complete.
-*/
-   subchan = vmbus_get_subchan(pri_chan, subchan_cnt);
-   vmbus_rel_subchan(subchan, subchan_cnt);
-   device_printf(dev, "%d sub-channels setup done\n", subchan_cnt);
-   }
-
KASSERT(sc->net_dev->num_channel > 0 &&
sc->net_dev->num_channel <= sc->hn_rx_ring_inuse,
("invalid channel count %u, should be less than %d",
@@ -575,6 +563,26 @@ netvsc_attach(device_t dev)
device_printf(dev, "%d TX ring, %d RX ring\n",
sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse);
 
+   if (sc->net_dev->num_channel > 1) {
+   struct hv_vmbus_channel **subchan;
+   int subchan_cnt = sc->net_dev->num_channel - 1;
+   int i;
+
+   /* Wait for sub-channels setup to complete. */
+   subchan = vmbus_get_subchan(pri_ch

svn commit: r298616 - head/sys/dev/hyperv/storvsc

2016-04-25 Thread Sepherosa Ziehau
Author: sephe
Date: Tue Apr 26 05:15:15 2016
New Revision: 298616
URL: https://svnweb.freebsd.org/changeset/base/298616

Log:
  hyperv/stor: Avoid sub-channel creation callback.
  
  Since the sub-channel offers are synchronized, we can do our own
  channel setup without using the sub-channel creation callback.
  
  This paves the way to whack the sub-channel creation callback.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cTue Apr 26 
05:08:55 2016(r298615)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cTue Apr 26 
05:15:15 2016(r298616)
@@ -315,21 +315,14 @@ get_stor_device(struct hv_device *device
return sc;
 }
 
-/**
- * @brief Callback handler, will be invoked when receive mutil-channel offer
- *
- * @param context  new multi-channel
- */
 static void
-storvsc_handle_sc_creation(void *context)
+storvsc_subchan_attach(struct hv_vmbus_channel *new_channel)
 {
-   hv_vmbus_channel *new_channel;
struct hv_device *device;
struct storvsc_softc *sc;
struct vmstor_chan_props props;
int ret = 0;
 
-   new_channel = (hv_vmbus_channel *)context;
device = new_channel->device;
sc = get_stor_device(device, TRUE);
if (sc == NULL)
@@ -362,7 +355,7 @@ storvsc_send_multichannel_request(struct
struct hv_storvsc_request *request;
struct vstor_packet *vstor_packet;  
int request_channels_cnt = 0;
-   int ret;
+   int ret, i;
 
/* get multichannels count that need to create */
request_channels_cnt = MIN(max_chans, mp_ncpus);
@@ -376,9 +369,6 @@ storvsc_send_multichannel_request(struct
 
request = &sc->hs_init_req;
 
-   /* Establish a handler for multi-channel */
-   dev->channel->sc_creation_callback = storvsc_handle_sc_creation;
-
/* request the host to create multi-channel */
memset(request, 0, sizeof(struct hv_storvsc_request));

@@ -414,10 +404,14 @@ storvsc_send_multichannel_request(struct
return;
}
 
-   /*
-* Wait for sub-channels setup to complete.
-*/
+   /* Wait for sub-channels setup to complete. */
subchan = vmbus_get_subchan(dev->channel, request_channels_cnt);
+
+   /* Attach the sub-channels. */
+   for (i = 0; i < request_channels_cnt; ++i)
+   storvsc_subchan_attach(subchan[i]);
+
+   /* Release the sub-channels. */
vmbus_rel_subchan(subchan, request_channels_cnt);
 
if (bootverbose)
___
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: r298617 - in head/sys/dev/hyperv: include vmbus

2016-04-25 Thread Sepherosa Ziehau
Author: sephe
Date: Tue Apr 26 05:21:27 2016
New Revision: 298617
URL: https://svnweb.freebsd.org/changeset/base/298617

Log:
  hyperv/channel: Git rid of the sub-channel creation callback
  
  It is no longer used.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/dev/hyperv/include/hyperv.h
  head/sys/dev/hyperv/vmbus/hv_channel.c
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c

Modified: head/sys/dev/hyperv/include/hyperv.h
==
--- head/sys/dev/hyperv/include/hyperv.hTue Apr 26 05:15:15 2016
(r298616)
+++ head/sys/dev/hyperv/include/hyperv.hTue Apr 26 05:21:27 2016
(r298617)
@@ -691,7 +691,6 @@ typedef struct {
 } hv_vmbus_ring_buffer_info;
 
 typedef void (*hv_vmbus_pfn_channel_callback)(void *context);
-typedef void (*hv_vmbus_sc_creation_callback)(void *context);
 
 typedef enum {
HV_CHANNEL_OFFER_STATE,
@@ -804,13 +803,6 @@ typedef struct hv_vmbus_channel {
 * response on the same channel.
 */
 
-   /*
-* Multi-channel creation callback. This callback will be called in
-* process context when a Multi-channel offer is received from the host.
-* The guest can open the Multi-channel in the context of this callback.
-*/
-   hv_vmbus_sc_creation_callback   sc_creation_callback;
-
struct mtx  sc_lock;
 
/*

Modified: head/sys/dev/hyperv/vmbus/hv_channel.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel.c  Tue Apr 26 05:15:15 2016
(r298616)
+++ head/sys/dev/hyperv/vmbus/hv_channel.c  Tue Apr 26 05:21:27 2016
(r298617)
@@ -618,7 +618,6 @@ hv_vmbus_channel_close_internal(hv_vmbus
hv_vmbus_channel_msg_info* info;
 
channel->state = HV_CHANNEL_OPEN_STATE;
-   channel->sc_creation_callback = NULL;
 
/*
 * set rxq to NULL to avoid more requests be scheduled

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Tue Apr 26 05:15:15 2016
(r298616)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Tue Apr 26 05:21:27 2016
(r298617)
@@ -237,8 +237,6 @@ vmbus_channel_process_offer(hv_vmbus_cha
new_channel, new_channel->primary_channel);
 
new_channel->state = HV_CHANNEL_OPEN_STATE;
-   if (channel->sc_creation_callback != NULL)
-   channel->sc_creation_callback(new_channel);
 
/*
 * Bump up sub-channel count and notify anyone that is
___
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: r298612 - head/sys/dev/iwm

2016-04-25 Thread Warner Losh
On Mon, Apr 25, 2016 at 10:45 PM, Ravi Pokala  wrote:

> > do_stop = !! (sc->sc_ic.ic_nrunning > 0);
>
> Why the double-negation? Isn't
>
> do_stop = (sc->sc_ic.ic_nrunning > 0);
>
> equivalent?
>

It is. However the !! style is from Linux. It converts a bit value to a 0/1
value. Since
foo > 0 already is a Boolean, it isn't needed here.

Warner


> -Ravi (rpokala@)
>
>
>
> -Original Message-
> From:  on behalf of Adrian Chadd
> 
> Date: 2016-04-25, Monday at 21:40
> To: , , <
> svn-src-head@freebsd.org>
> Subject: svn commit: r298612 - head/sys/dev/iwm
>
> >Author: adrian
> >Date: Tue Apr 26 04:40:59 2016
> >New Revision: 298612
> >URL: https://svnweb.freebsd.org/changeset/base/298612
> >
> >Log:
> >  [iwm] implement suspend/resume through ieee80211_{suspend,resume}_all
> >
> >  This allows wifi to associate correctly after a suspend/resume cycle.
> >
> >  Yes, I'm using this now day to day.
> >
> >  Tested:
> >
> >  * Intel 7260AC, STA mode
> >
> >Modified:
> >  head/sys/dev/iwm/if_iwm.c
> >  head/sys/dev/iwm/if_iwmvar.h
> >
> >Modified: head/sys/dev/iwm/if_iwm.c
>
> >==
> >--- head/sys/dev/iwm/if_iwm.c  Tue Apr 26 03:24:28 2016(r298611)
> >+++ head/sys/dev/iwm/if_iwm.c  Tue Apr 26 04:40:59 2016(r298612)
> >@@ -4934,6 +4934,8 @@ iwm_init_task(void *arg1)
> > static int
> > iwm_resume(device_t dev)
> > {
> >+  struct iwm_softc *sc = device_get_softc(dev);
> >+  int do_reinit = 0;
> >   uint16_t reg;
> >
> >   /* Clear device-specific "PCI retry timeout" register (41h). */
> >@@ -4941,17 +4943,33 @@ iwm_resume(device_t dev)
> >   pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg));
> >   iwm_init_task(device_get_softc(dev));
> >
> >+  IWM_LOCK(sc);
> >+  if (sc->sc_flags & IWM_FLAG_DORESUME) {
> >+  sc->sc_flags &= ~IWM_FLAG_DORESUME;
> >+  do_reinit = 1;
> >+  }
> >+  IWM_UNLOCK(sc);
> >+
> >+  if (do_reinit)
> >+  ieee80211_resume_all(&sc->sc_ic);
> >+
> >   return 0;
> > }
> >
> > static int
> > iwm_suspend(device_t dev)
> > {
> >+  int do_stop = 0;
> >   struct iwm_softc *sc = device_get_softc(dev);
> >
> >-  if (sc->sc_ic.ic_nrunning > 0) {
> >+  do_stop = !! (sc->sc_ic.ic_nrunning > 0);
> >+
> >+  ieee80211_suspend_all(&sc->sc_ic);
> >+
> >+  if (do_stop) {
> >   IWM_LOCK(sc);
> >   iwm_stop(sc);
> >+  sc->sc_flags |= IWM_FLAG_DORESUME;
> >   IWM_UNLOCK(sc);
> >   }
> >
> >
> >Modified: head/sys/dev/iwm/if_iwmvar.h
>
> >==
> >--- head/sys/dev/iwm/if_iwmvar.h   Tue Apr 26 03:24:28 2016
> (r298611)
> >+++ head/sys/dev/iwm/if_iwmvar.h   Tue Apr 26 04:40:59 2016
> (r298612)
> >@@ -405,6 +405,7 @@ struct iwm_softc {
> > #define IWM_FLAG_STOPPED  (1 << 2)
> > #define IWM_FLAG_RFKILL   (1 << 3)
> > #define IWM_FLAG_BUSY (1 << 4)
> >+#define   IWM_FLAG_DORESUME   (1 << 5)
> >
> >   struct intr_config_hook sc_preinit_hook;
> >   struct callout  sc_watchdog_to;
> >
>
>
>
___
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: r298612 - head/sys/dev/iwm

2016-04-25 Thread Andriy Voskoboinyk
Tue, 26 Apr 2016 07:40:59 +0300 було написано Adrian Chadd  
:



Author: adrian
Date: Tue Apr 26 04:40:59 2016
New Revision: 298612
URL: https://svnweb.freebsd.org/changeset/base/298612

Log:
  [iwm] implement suspend/resume through ieee80211_{suspend,resume}_all
 This allows wifi to associate correctly after a suspend/resume cycle.
 Yes, I'm using this now day to day.
 Tested:
 * Intel 7260AC, STA mode

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Tue Apr 26 03:24:28 2016(r298611)
+++ head/sys/dev/iwm/if_iwm.c   Tue Apr 26 04:40:59 2016(r298612)
@@ -4934,6 +4934,8 @@ iwm_init_task(void *arg1)
 static int
 iwm_resume(device_t dev)
 {
+   struct iwm_softc *sc = device_get_softc(dev);
+   int do_reinit = 0;
uint16_t reg;
/* Clear device-specific "PCI retry timeout" register (41h). */
@@ -4941,17 +4943,33 @@ iwm_resume(device_t dev)
pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg));
iwm_init_task(device_get_softc(dev));
+   IWM_LOCK(sc);
+   if (sc->sc_flags & IWM_FLAG_DORESUME) {
+   sc->sc_flags &= ~IWM_FLAG_DORESUME;
+   do_reinit = 1;


If no vap was running, then nothing will be started
(because of IEEE80211_FEXT_RESUME flag).


+   }
+   IWM_UNLOCK(sc);
+
+   if (do_reinit)
+   ieee80211_resume_all(&sc->sc_ic);


AFAIK, suspend_all() / resume_all() should work without any
additional logic
(except (?) device-specific PCI registers (41h) pre-setup on resume).


+
return 0;
 }
static int
 iwm_suspend(device_t dev)
 {
+   int do_stop = 0;
struct iwm_softc *sc = device_get_softc(dev);
-   if (sc->sc_ic.ic_nrunning > 0) {
+   do_stop = !! (sc->sc_ic.ic_nrunning > 0);
+
+   ieee80211_suspend_all(&sc->sc_ic);
+
+   if (do_stop) {
IWM_LOCK(sc);
iwm_stop(sc);


Is it really needed? (iwm_stop() will be already executed when the last vap
will be stopped + suspend_resume() waits for ic_parent method).


+   sc->sc_flags |= IWM_FLAG_DORESUME;
IWM_UNLOCK(sc);
}

Modified: head/sys/dev/iwm/if_iwmvar.h
==
--- head/sys/dev/iwm/if_iwmvar.hTue Apr 26 03:24:28 2016
(r298611)
+++ head/sys/dev/iwm/if_iwmvar.hTue Apr 26 04:40:59 2016
(r298612)
@@ -405,6 +405,7 @@ struct iwm_softc {
 #define IWM_FLAG_STOPPED   (1 << 2)
 #define IWM_FLAG_RFKILL(1 << 3)
 #define IWM_FLAG_BUSY  (1 << 4)
+#defineIWM_FLAG_DORESUME   (1 << 5)
struct intr_config_hook sc_preinit_hook;
struct callout  sc_watchdog_to;

___
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: r298618 - head/sys/dev/hyperv/storvsc

2016-04-25 Thread Sepherosa Ziehau
Author: sephe
Date: Tue Apr 26 06:41:36 2016
New Revision: 298618
URL: https://svnweb.freebsd.org/changeset/base/298618

Log:
  hyperv/stor: Set description properly in probe devmethod
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cTue Apr 26 
05:21:27 2016(r298617)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cTue Apr 26 
06:41:36 2016(r298618)
@@ -924,6 +924,7 @@ storvsc_probe(device_t dev)
if(bootverbose)
device_printf(dev,
"Enlightened ATA/IDE detected\n");
+   device_set_desc(dev, 
g_drv_props_table[DRIVER_BLKVSC].drv_desc);
ret = BUS_PROBE_DEFAULT;
} else if(bootverbose)
device_printf(dev, "Emulated ATA/IDE set 
(hw.ata.disk_enable set)\n");
@@ -931,6 +932,7 @@ storvsc_probe(device_t dev)
case DRIVER_STORVSC:
if(bootverbose)
device_printf(dev, "Enlightened SCSI device 
detected\n");
+   device_set_desc(dev, 
g_drv_props_table[DRIVER_STORVSC].drv_desc);
ret = BUS_PROBE_DEFAULT;
break;
default:
@@ -982,7 +984,6 @@ storvsc_attach(device_t dev)
/* fill in device specific properties */
sc->hs_unit = device_get_unit(dev);
sc->hs_dev  = hv_dev;
-   device_set_desc(dev, g_drv_props_table[stor_type].drv_desc);
 
LIST_INIT(&sc->hs_free_list);
mtx_init(&sc->hs_lock, "hvslck", NULL, MTX_DEF);
___
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: r298619 - head/sys/geom/uzip

2016-04-25 Thread Maxim Sobolev
Author: sobomax
Date: Tue Apr 26 06:50:38 2016
New Revision: 298619
URL: https://svnweb.freebsd.org/changeset/base/298619

Log:
  Relax TOC offsets checking somewhat, allowing offset pointing to
  the next byte past EOF to denote zero-block(s) at the very end of
  the file.

Modified:
  head/sys/geom/uzip/g_uzip.c

Modified: head/sys/geom/uzip/g_uzip.c
==
--- head/sys/geom/uzip/g_uzip.c Tue Apr 26 06:41:36 2016(r298618)
+++ head/sys/geom/uzip/g_uzip.c Tue Apr 26 06:50:38 2016(r298619)
@@ -492,7 +492,7 @@ g_uzip_parse_toc(struct g_uzip_softc *sc
for (i = 0; i < sc->nblocks; i++) {
/* First do some bounds checking */
if ((sc->toc[i].offset < min_offset) ||
-   (sc->toc[i].offset >= pp->mediasize)) {
+   (sc->toc[i].offset > pp->mediasize)) {
goto error_offset;
}
DPRINTF_BLK(GUZ_DBG_IO, i, ("%s: cluster #%u "
@@ -711,6 +711,11 @@ g_uzip_taste(struct g_class *mp, struct 
sc->nblocks < offsets_read ? "more" : "less"));
goto e5;
}
+   /*
+* "Fake" last+1 block, to make it easier for the TOC parser to
+* iterate without making the last element a special case.
+*/
+   sc->toc[sc->nblocks].offset = pp->mediasize;
/* Massage TOC (table of contents), make sure it is sound */
if (g_uzip_parse_toc(sc, pp, gp) != 0) {
DPRINTF(GUZ_DBG_ERR, ("%s: TOC error\n", gp->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"


svn commit: r298620 - head/sys/dev/hyperv/netvsc

2016-04-25 Thread Sepherosa Ziehau
Author: sephe
Date: Tue Apr 26 06:50:41 2016
New Revision: 298620
URL: https://svnweb.freebsd.org/changeset/base/298620

Log:
  hyperv/hn: Change description to "Hyper-V Network Interface"
  
  This is consistent w/ other Hyper-V devices.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Tue Apr 26 06:50:38 
2016(r298619)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Tue Apr 26 06:50:41 
2016(r298620)
@@ -402,7 +402,7 @@ netvsc_probe(device_t dev)
 
p = vmbus_get_type(dev);
if (!memcmp(p, &g_net_vsc_device_type.data, sizeof(hv_guid))) {
-   device_set_desc(dev, "Synthetic Network Interface");
+   device_set_desc(dev, "Hyper-V Network Interface");
if (bootverbose)
printf("Netvsc probe... DONE \n");
 
___
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"