svn commit: r249608 - head/sys/x86/include

2013-04-18 Thread Rui Paulo
Author: rpaulo
Date: Thu Apr 18 07:09:27 2013
New Revision: 249608
URL: http://svnweb.freebsd.org/changeset/base/249608

Log:
  Move the previously added CPUID7 macros to CPUID_STDEXT.

Modified:
  head/sys/x86/include/specialreg.h

Modified: head/sys/x86/include/specialreg.h
==
--- head/sys/x86/include/specialreg.h   Thu Apr 18 05:58:07 2013
(r249607)
+++ head/sys/x86/include/specialreg.h   Thu Apr 18 07:09:27 2013
(r249608)
@@ -172,23 +172,6 @@
 #defineCPUTPM2_EFFREQ  0x0001
 
 /*
- * Structured Extended Features
- */
-#defineCPUID7_GSFSBASE 0x0001
-#defineCPUID7_TSCADJ   0x0002
-#defineCPUID7_BMI1 0x0008
-#defineCPUID7_HLE  0x0010
-#defineCPUID7_AVX2 0x0020
-#defineCPUID7_SMEP 0x0080
-#defineCPUID7_BMI2 0x0100
-#defineCPUID7_ENHMOVSB 0x0200
-#defineCPUID7_INVPCID  0x0400
-#defineCPUID7_RTM  0x0800
-#defineCPUID7_RDSEED   0x0004
-#defineCPUID7_ADX  0x0008
-#defineCPUID7_SMAP 0x0010
-
-/*
  * Important bits in the AMD extended cpuid flags
  */
 #defineAMDID_SYSCALL   0x0800
@@ -295,11 +278,22 @@
 #defineAMDID_COREID_SIZE   0xf000
 #defineAMDID_COREID_SIZE_SHIFT 12
 
+/*
+ * Structured Extended Features
+ */
 #defineCPUID_STDEXT_FSGSBASE   0x0001
 #defineCPUID_STDEXT_TSC_ADJUST 0x0002
+#defineCPUID_STDEXT_BMI1   0x0008
+#defineCPUID_STDEXT_HLE0x0010
+#defineCPUID_STDEXT_AVX2   0x0020
 #defineCPUID_STDEXT_SMEP   0x0080
+#defineCPUID_STDEXT_BMI2   0x0100
 #defineCPUID_STDEXT_ENH_MOVSB  0x0200
+#defineCPUID_STDEXT_RTM0x0800
 #defineCPUID_STDEXT_INVPCID0x0400
+#defineCPUID_STDEXT_RDSEED 0x0004
+#defineCPUID_STDEXT_ADX0x0008
+#defineCPUID_STDEXT_SMAP   0x0010
 
 /*
  * CPUID manufacturers identifiers
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2013-04-18 Thread Joel Dahl
Author: joel (doc committer)
Date: Thu Apr 18 10:08:27 2013
New Revision: 249616
URL: http://svnweb.freebsd.org/changeset/base/249616

Log:
  Remove EOL whitespace.

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

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Thu Apr 18 10:06:52 2013
(r249615)
+++ head/share/man/man5/rc.conf.5   Thu Apr 18 10:08:27 2013
(r249616)
@@ -3987,7 +3987,7 @@ Set to the fully qualified domain name (
 Unset by default.
 Set extra parameters for jail
 .Va jname ,
-such as 
+such as
 .Dq Li allow.chflags
 or
 .Dq Li children.max .
@@ -4001,7 +4001,7 @@ script out of their corresponding
 variables:
 .Bl  -tag -width host.hostname -offset indent
 .It Li path
-set from 
+set from
 .Va jail_ Ns Ao Ar jname Ac Ns Va _rootdir
 .It Li host.hostname
 set from
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r249622 - in head/sys/dev: mvs siis

2013-04-18 Thread Alexander Motin
Author: mav
Date: Thu Apr 18 12:43:06 2013
New Revision: 249622
URL: http://svnweb.freebsd.org/changeset/base/249622

Log:
  Make siis(4) and mvs(4) send bus_get_dma_tag() requests to parent buses
  passing real bus' child pointers instead of grandchilds.
  
  Requested by: kib

Modified:
  head/sys/dev/mvs/mvs_pci.c
  head/sys/dev/mvs/mvs_soc.c
  head/sys/dev/siis/siis.c

Modified: head/sys/dev/mvs/mvs_pci.c
==
--- head/sys/dev/mvs/mvs_pci.c  Thu Apr 18 11:13:48 2013(r249621)
+++ head/sys/dev/mvs/mvs_pci.c  Thu Apr 18 12:43:06 2013(r249622)
@@ -488,6 +488,13 @@ mvs_child_location_str(device_t dev, dev
return (0);
 }
 
+static bus_dma_tag_t
+mvs_get_dma_tag(device_t bus, device_t child)
+{
+
+   return (bus_get_dma_tag(bus));
+}
+
 static device_method_t mvs_methods[] = {
DEVMETHOD(device_probe, mvs_probe),
DEVMETHOD(device_attach,mvs_attach),
@@ -500,6 +507,7 @@ static device_method_t mvs_methods[] = {
DEVMETHOD(bus_setup_intr,   mvs_setup_intr),
DEVMETHOD(bus_teardown_intr,mvs_teardown_intr),
DEVMETHOD(bus_child_location_str, mvs_child_location_str),
+   DEVMETHOD(bus_get_dma_tag,  mvs_get_dma_tag),
DEVMETHOD(mvs_edma, mvs_edma),
{ 0, 0 }
 };

Modified: head/sys/dev/mvs/mvs_soc.c
==
--- head/sys/dev/mvs/mvs_soc.c  Thu Apr 18 11:13:48 2013(r249621)
+++ head/sys/dev/mvs/mvs_soc.c  Thu Apr 18 12:43:06 2013(r249622)
@@ -430,6 +430,13 @@ mvs_child_location_str(device_t dev, dev
return (0);
 }
 
+static bus_dma_tag_t
+mvs_get_dma_tag(device_t bus, device_t child)
+{
+
+   return (bus_get_dma_tag(bus));
+}
+
 static device_method_t mvs_methods[] = {
DEVMETHOD(device_probe, mvs_probe),
DEVMETHOD(device_attach,mvs_attach),
@@ -441,8 +448,9 @@ static device_method_t mvs_methods[] = {
DEVMETHOD(bus_release_resource, mvs_release_resource),
DEVMETHOD(bus_setup_intr,   mvs_setup_intr),
DEVMETHOD(bus_teardown_intr,mvs_teardown_intr),
-   DEVMETHOD(mvs_edma, mvs_edma),
DEVMETHOD(bus_child_location_str, mvs_child_location_str),
+   DEVMETHOD(bus_get_dma_tag,  mvs_get_dma_tag),
+   DEVMETHOD(mvs_edma, mvs_edma),
{ 0, 0 }
 };
 static driver_t mvs_driver = {

Modified: head/sys/dev/siis/siis.c
==
--- head/sys/dev/siis/siis.cThu Apr 18 11:13:48 2013(r249621)
+++ head/sys/dev/siis/siis.cThu Apr 18 12:43:06 2013(r249622)
@@ -414,6 +414,13 @@ siis_child_location_str(device_t dev, de
return (0);
 }
 
+static bus_dma_tag_t
+siis_get_dma_tag(device_t bus, device_t child)
+{
+
+   return (bus_get_dma_tag(bus));
+}
+
 devclass_t siis_devclass;
 static device_method_t siis_methods[] = {
DEVMETHOD(device_probe, siis_probe),
@@ -427,6 +434,7 @@ static device_method_t siis_methods[] = 
DEVMETHOD(bus_setup_intr,   siis_setup_intr),
DEVMETHOD(bus_teardown_intr,siis_teardown_intr),
DEVMETHOD(bus_child_location_str, siis_child_location_str),
+   DEVMETHOD(bus_get_dma_tag,  siis_get_dma_tag),
{ 0, 0 }
 };
 static driver_t siis_driver = {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r249623 - in head/sys: fs/nfsclient nfsclient

2013-04-18 Thread Rick Macklem
Author: rmacklem
Date: Thu Apr 18 13:09:04 2013
New Revision: 249623
URL: http://svnweb.freebsd.org/changeset/base/249623

Log:
  Both NFS clients can deadlock when using the rdirplus mount
  option. This can occur when an nfsiod thread that already holds
  a buffer lock attempts to acquire a vnode lock on an entry in
  the directory (a LOR) when another thread holding the vnode lock
  is waiting on an nfsiod thread. This patch avoids the deadlock by disabling
  readahead for this case, so the nfsiod threads never do readdirplus.
  Since readaheads for directories need the directory offset cookie
  from the previous read, they cannot normally happen in parallel.
  As such, testing by jhb@ and myself didn't find any performance
  degredation when this patch is applied. If there is a case where
  this results in a significant performance degradation, mounting
  without the rdirplus option can be done to re-enable readahead
  for directories.
  
  Reported and tested by:   jhb
  Reviewed by:  jhb
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clbio.c
  head/sys/nfsclient/nfs_bio.c

Modified: head/sys/fs/nfsclient/nfs_clbio.c
==
--- head/sys/fs/nfsclient/nfs_clbio.c   Thu Apr 18 12:43:06 2013
(r249622)
+++ head/sys/fs/nfsclient/nfs_clbio.c   Thu Apr 18 13:09:04 2013
(r249623)
@@ -1404,10 +1404,18 @@ ncl_asyncio(struct nfsmount *nmp, struct
 * Commits are usually short and sweet so lets save some cpu and
 * leave the async daemons for more important rpc's (such as reads
 * and writes).
+*
+* Readdirplus RPCs do vget()s to acquire the vnodes for entries
+* in the directory in order to update attributes. This can deadlock
+* with another thread that is waiting for async I/O to be done by
+* an nfsiod thread while holding a lock on one of these vnodes.
+* To avoid this deadlock, don't allow the async nfsiod threads to
+* perform Readdirplus RPCs.
 */
mtx_lock(ncl_iod_mutex);
-   if (bp-b_iocmd == BIO_WRITE  (bp-b_flags  B_NEEDCOMMIT) 
-   (nmp-nm_bufqiods  ncl_numasync / 2)) {
+   if ((bp-b_iocmd == BIO_WRITE  (bp-b_flags  B_NEEDCOMMIT) 
+(nmp-nm_bufqiods  ncl_numasync / 2)) ||
+   (bp-b_vp-v_type == VDIR  (nmp-nm_flag  NFSMNT_RDIRPLUS))) {
mtx_unlock(ncl_iod_mutex);
return(EIO);
}

Modified: head/sys/nfsclient/nfs_bio.c
==
--- head/sys/nfsclient/nfs_bio.cThu Apr 18 12:43:06 2013
(r249622)
+++ head/sys/nfsclient/nfs_bio.cThu Apr 18 13:09:04 2013
(r249623)
@@ -1345,10 +1345,18 @@ nfs_asyncio(struct nfsmount *nmp, struct
 * Commits are usually short and sweet so lets save some cpu and
 * leave the async daemons for more important rpc's (such as reads
 * and writes).
+*
+* Readdirplus RPCs do vget()s to acquire the vnodes for entries
+* in the directory in order to update attributes. This can deadlock
+* with another thread that is waiting for async I/O to be done by
+* an nfsiod thread while holding a lock on one of these vnodes.
+* To avoid this deadlock, don't allow the async nfsiod threads to
+* perform Readdirplus RPCs.
 */
mtx_lock(nfs_iod_mtx);
-   if (bp-b_iocmd == BIO_WRITE  (bp-b_flags  B_NEEDCOMMIT) 
-   (nmp-nm_bufqiods  nfs_numasync / 2)) {
+   if ((bp-b_iocmd == BIO_WRITE  (bp-b_flags  B_NEEDCOMMIT) 
+(nmp-nm_bufqiods  nfs_numasync / 2)) ||
+   (bp-b_vp-v_type == VDIR  (nmp-nm_flag  NFSMNT_RDIRPLUS))) {
mtx_unlock(nfs_iod_mtx);
return(EIO);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r249625 - head/sys/x86/x86

2013-04-18 Thread Alexander Motin
Author: mav
Date: Thu Apr 18 17:07:04 2013
New Revision: 249625
URL: http://svnweb.freebsd.org/changeset/base/249625

Log:
  Introduce kern.timecounter.smp_tsc_adjust tunable (disabled by default) and
  respective functionality, allowing to synchronize TSC on APs to match BSP's
  during boot.  It may be unsafe in general case due to theoretical chance of
  later drift if CPUs are using different clock rate or source, but it allows
  to use TSC in some cases when difference caused by some initialization bug,
  while TSCs are known to increment synchronously.
  
  Reviewed by:  jimharris, kib
  MFC after:1 month

Modified:
  head/sys/x86/x86/tsc.c

Modified: head/sys/x86/x86/tsc.c
==
--- head/sys/x86/x86/tsc.c  Thu Apr 18 13:19:41 2013(r249624)
+++ head/sys/x86/x86/tsc.c  Thu Apr 18 17:07:04 2013(r249625)
@@ -65,6 +65,11 @@ int  smp_tsc;
 SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc, CTLFLAG_RDTUN, smp_tsc, 0,
 Indicates whether the TSC is safe to use in SMP mode);
 TUNABLE_INT(kern.timecounter.smp_tsc, smp_tsc);
+
+intsmp_tsc_adjust = 0;
+SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc_adjust, CTLFLAG_RDTUN,
+smp_tsc_adjust, 0, Try to adjust TSC on APs to match BSP);
+TUNABLE_INT(kern.timecounter.smp_tsc_adjust, smp_tsc_adjust);
 #endif
 
 static int tsc_shift = 1;
@@ -403,25 +408,77 @@ comp_smp_tsc(void *arg)
}
 }
 
+static void
+adj_smp_tsc(void *arg)
+{
+   uint64_t *tsc;
+   int64_t d, min, max;
+   u_int cpu = PCPU_GET(cpuid);
+   u_int first, i, size;
+
+   first = CPU_FIRST();
+   if (cpu == first)
+   return;
+   min = INT64_MIN;
+   max = INT64_MAX;
+   size = (mp_maxid + 1) * 3;
+   for (i = 0, tsc = arg; i  N; i++, tsc += size) {
+   d = tsc[first * 3] - tsc[cpu * 3 + 1];
+   if (d  min)
+   min = d;
+   d = tsc[first * 3 + 1] - tsc[cpu * 3 + 2];
+   if (d  min)
+   min = d;
+   d = tsc[first * 3 + 1] - tsc[cpu * 3];
+   if (d  max)
+   max = d;
+   d = tsc[first * 3 + 2] - tsc[cpu * 3 + 1];
+   if (d  max)
+   max = d;
+   }
+   if (min  max)
+   return;
+   d = min / 2 + max / 2;
+   __asm __volatile (
+   movl $0x10, %%ecx\n\t
+   rdmsr\n\t
+   addl %%edi, %%eax\n\t
+   adcl %%esi, %%edx\n\t
+   wrmsr\n
+   : /* No output */
+   : D ((uint32_t)d), S ((uint32_t)(d  32))
+   : ax, cx, dx, cc
+   );
+}
+
 static int
 test_tsc(void)
 {
uint64_t *data, *tsc;
-   u_int i, size;
+   u_int i, size, adj;
 
if ((!smp_tsc  !tsc_is_invariant) || vm_guest)
return (-100);
size = (mp_maxid + 1) * 3;
data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK);
+   adj = 0;
+retry:
for (i = 0, tsc = data; i  N; i++, tsc += size)
smp_rendezvous(tsc_read_0, tsc_read_1, tsc_read_2, tsc);
smp_tsc = 1;/* XXX */
smp_rendezvous(smp_no_rendevous_barrier, comp_smp_tsc,
smp_no_rendevous_barrier, data);
+   if (!smp_tsc  adj  smp_tsc_adjust) {
+   adj++;
+   smp_rendezvous(smp_no_rendevous_barrier, adj_smp_tsc,
+   smp_no_rendevous_barrier, data);
+   goto retry;
+   }
free(data, M_TEMP);
if (bootverbose)
-   printf(SMP: %sed TSC synchronization test\n,
-   smp_tsc ? pass : fail);
+   printf(SMP: %sed TSC synchronization test%s\n,
+   smp_tsc ? pass : fail, 
+   adj  0 ?  after adjustment : );
if (smp_tsc  tsc_is_invariant) {
switch (cpu_vendor_id) {
case CPU_VENDOR_AMD:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2013-04-18 Thread Navdeep Parhar
Author: np
Date: Thu Apr 18 19:52:11 2013
New Revision: 249627
URL: http://svnweb.freebsd.org/changeset/base/249627

Log:
  cxgbe/tom: Update the CLIP table on the chip when there are changes
  to the list of IPv6 addresses on the system.  The table is used for
  TOE+IPv6 only.

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

Modified: head/sys/dev/cxgbe/tom/t4_tom.c
==
--- head/sys/dev/cxgbe/tom/t4_tom.c Thu Apr 18 18:11:30 2013
(r249626)
+++ head/sys/dev/cxgbe/tom/t4_tom.c Thu Apr 18 19:52:11 2013
(r249627)
@@ -41,6 +41,7 @@ __FBSDID($FreeBSD$);
 #include sys/domain.h
 #include sys/socket.h
 #include sys/socketvar.h
+#include sys/taskqueue.h
 #include net/if.h
 #include netinet/in.h
 #include netinet/in_pcb.h
@@ -89,9 +90,16 @@ static int add_lip(struct adapter *, str
 static int delete_lip(struct adapter *, struct in6_addr *);
 static struct clip_entry *search_lip(struct tom_data *, struct in6_addr *);
 static void init_clip_table(struct adapter *, struct tom_data *);
+static void update_clip(struct adapter *, void *);
+static void t4_clip_task(void *, int);
+static void update_clip_table(struct adapter *, struct tom_data *);
 static void destroy_clip_table(struct adapter *, struct tom_data *);
 static void free_tom_data(struct adapter *, struct tom_data *);
 
+static int in6_ifaddr_gen;
+static eventhandler_tag ifaddr_evhandler;
+static struct timeout_task clip_task;
+
 struct toepcb *
 alloc_toepcb(struct port_info *pi, int txqid, int rxqid, int flags)
 {
@@ -626,7 +634,7 @@ add_lip(struct adapter *sc, struct in6_a
 c.ip_hi = *(uint64_t *)lip-s6_addr[0];
 c.ip_lo = *(uint64_t *)lip-s6_addr[8];
 
-   return (t4_wr_mbox_ns(sc, sc-mbox, c, sizeof(c), c));
+   return (-t4_wr_mbox_ns(sc, sc-mbox, c, sizeof(c), c));
 }
 
 static int
@@ -644,7 +652,7 @@ delete_lip(struct adapter *sc, struct in
 c.ip_hi = *(uint64_t *)lip-s6_addr[0];
 c.ip_lo = *(uint64_t *)lip-s6_addr[8];
 
-   return (t4_wr_mbox_ns(sc, sc-mbox, c, sizeof(c), c));
+   return (-t4_wr_mbox_ns(sc, sc-mbox, c, sizeof(c), c));
 }
 
 static struct clip_entry *
@@ -692,16 +700,56 @@ release_lip(struct tom_data *td, struct 
 static void
 init_clip_table(struct adapter *sc, struct tom_data *td)
 {
-   struct in6_ifaddr *ia;
-   struct in6_addr *lip, tlip;
-   struct clip_entry *ce;
 
ASSERT_SYNCHRONIZED_OP(sc);
 
mtx_init(td-clip_table_lock, CLIP table lock, NULL, MTX_DEF);
TAILQ_INIT(td-clip_table);
+   td-clip_gen = -1;
+
+   update_clip_table(sc, td);
+}
+
+static void
+update_clip(struct adapter *sc, void *arg __unused)
+{
+
+   if (begin_synchronized_op(sc, NULL, HOLD_LOCK, t4tomuc))
+   return;
+
+   if (sc-flags  TOM_INIT_DONE)
+   update_clip_table(sc, sc-tom_softc);
+
+   end_synchronized_op(sc, LOCK_HELD);
+}
+
+static void
+t4_clip_task(void *arg, int count)
+{
+
+   t4_iterate(update_clip, NULL);
+}
+
+static void
+update_clip_table(struct adapter *sc, struct tom_data *td)
+{
+   struct in6_ifaddr *ia;
+   struct in6_addr *lip, tlip;
+   struct clip_head stale;
+   struct clip_entry *ce, *ce_temp;
+   int rc, gen = atomic_load_acq_int(in6_ifaddr_gen);
+
+   ASSERT_SYNCHRONIZED_OP(sc);
 
IN6_IFADDR_RLOCK();
+   mtx_lock(td-clip_table_lock);
+
+   if (gen == td-clip_gen)
+   goto done;
+
+   TAILQ_INIT(stale);
+   TAILQ_CONCAT(stale, td-clip_table, link);
+
TAILQ_FOREACH(ia, V_in6_ifaddrhead, ia_link) {
lip = ia-ia_addr.sin6_addr;
 
@@ -721,18 +769,70 @@ init_clip_table(struct adapter *sc, stru
 * interface?  It's fe80::1 usually (always?).
 */
 
-   mtx_lock(td-clip_table_lock);
-   if (search_lip(td, lip) == NULL) {
-   ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT);
-   memcpy(ce-lip, lip, sizeof(ce-lip));
-   ce-refcount = 0;
-   if (add_lip(sc, lip) == 0)
+   /*
+* If it's in the main list then we already know it's not stale.
+*/
+   TAILQ_FOREACH(ce, td-clip_table, link) {
+   if (IN6_ARE_ADDR_EQUAL(ce-lip, lip))
+   goto next;
+   }
+
+   /*
+* If it's in the stale list we should move it to the main list.
+*/
+   TAILQ_FOREACH(ce, stale, link) {
+   if (IN6_ARE_ADDR_EQUAL(ce-lip, lip)) {
+   TAILQ_REMOVE(stale, ce, link);
TAILQ_INSERT_TAIL(td-clip_table, ce, link);
-   else
+   goto next;
+   }
+   }
+
+   /* A new IP6 

svn commit: r249628 - head/sys/net

2013-04-18 Thread Oleg Bulyzhin
Author: oleg
Date: Thu Apr 18 20:13:33 2013
New Revision: 249628
URL: http://svnweb.freebsd.org/changeset/base/249628

Log:
  Recover missing arp_ifinit() call.
  
  MFC after:2 weeks

Modified:
  head/sys/net/if_vlan.c

Modified: head/sys/net/if_vlan.c
==
--- head/sys/net/if_vlan.c  Thu Apr 18 19:52:11 2013(r249627)
+++ head/sys/net/if_vlan.c  Thu Apr 18 20:13:33 2013(r249628)
@@ -41,6 +41,7 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
+#include opt_inet.h
 #include opt_vlan.h
 
 #include sys/param.h
@@ -66,6 +67,11 @@ __FBSDID($FreeBSD$);
 #include net/if_vlan_var.h
 #include net/vnet.h
 
+#ifdef INET
+#include netinet/in.h
+#include netinet/if_ether.h
+#endif
+
 #defineVLAN_DEF_HWIDTH 4
 #defineVLAN_IFFLAGS(IFF_BROADCAST | IFF_MULTICAST)
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r249629 - head/sys/dev/cxgbe/common

2013-04-18 Thread Navdeep Parhar
Author: np
Date: Thu Apr 18 22:54:41 2013
New Revision: 249629
URL: http://svnweb.freebsd.org/changeset/base/249629

Log:
  cxgbe(4): Refuse to install T5 firmwares on a T4 card (and vice versa).
  
  MFC after:1 week

Modified:
  head/sys/dev/cxgbe/common/t4_hw.c

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==
--- head/sys/dev/cxgbe/common/t4_hw.c   Thu Apr 18 20:13:33 2013
(r249628)
+++ head/sys/dev/cxgbe/common/t4_hw.c   Thu Apr 18 22:54:41 2013
(r249629)
@@ -1136,6 +1136,13 @@ int t4_load_fw(struct adapter *adap, con
   FLASH_FW_MAX_SIZE);
return -EFBIG;
}
+   if ((is_t4(adap)  hdr-chip != FW_HDR_CHIP_T4) ||
+   (is_t5(adap)  hdr-chip != FW_HDR_CHIP_T5)) {
+   CH_ERR(adap,
+   FW image (%d) is not suitable for this adapter (%d)\n,
+   hdr-chip, chip_id(adap));
+   return -EINVAL;
+   }
 
for (csum = 0, i = 0; i  size / sizeof(csum); i++)
csum += ntohl(p[i]);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r249630 - in head/sys: fs/nfsclient nfsclient

2013-04-18 Thread Rick Macklem
Author: rmacklem
Date: Thu Apr 18 23:20:16 2013
New Revision: 249630
URL: http://svnweb.freebsd.org/changeset/base/249630

Log:
  When an NFS unmount occurs, once vflush() writes the last dirty
  buffer for the last vnode on the mount back to the server, it
  returns. At that point, the code continues with the unmount,
  including freeing up the nfs specific part of the mount structure.
  It is possible that an nfsiod thread will try to check for an
  empty I/O queue in the nfs specific part of the mount structure
  after it has been free'd by the unmount. This patch avoids this problem by
  setting the iodmount entries for the mount back to NULL while holding the
  mutex in the unmount and checking the appropriate entry is non-NULL after
  acquiring the mutex in the nfsiod thread.
  
  Reported and tested by:   pho
  Reviewed by:  kib
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clnfsiod.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/nfsclient/nfs_nfsiod.c
  head/sys/nfsclient/nfs_vfsops.c

Modified: head/sys/fs/nfsclient/nfs_clnfsiod.c
==
--- head/sys/fs/nfsclient/nfs_clnfsiod.cThu Apr 18 22:54:41 2013
(r249629)
+++ head/sys/fs/nfsclient/nfs_clnfsiod.cThu Apr 18 23:20:16 2013
(r249630)
@@ -304,6 +304,14 @@ nfssvc_iod(void *instance)
}
mtx_lock(ncl_iod_mutex);
/*
+* Make sure the nmp hasn't been dismounted as soon as
+* ncl_doio() completes for the last buffer.
+*/
+   nmp = ncl_iodmount[myiod];
+   if (nmp == NULL)
+   break;
+
+   /*
 * If there are more than one iod on this mount, then defect
 * so that the iods can be shared out fairly between the mounts
 */

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==
--- head/sys/fs/nfsclient/nfs_clvfsops.cThu Apr 18 22:54:41 2013
(r249629)
+++ head/sys/fs/nfsclient/nfs_clvfsops.cThu Apr 18 23:20:16 2013
(r249630)
@@ -81,6 +81,9 @@ extern struct timeval nfsboottime;
 extern struct nfsstats newnfsstats;
 extern int nfsrv_useacl;
 extern int nfscl_debuglevel;
+extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON];
+extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMON];
+extern struct mtx ncl_iod_mutex;
 NFSCLSTATEMUTEX;
 
 MALLOC_DEFINE(M_NEWNFSREQ, newnfsclient_req, New NFS request header);
@@ -1472,7 +1475,7 @@ nfs_unmount(struct mount *mp, int mntfla
 {
struct thread *td;
struct nfsmount *nmp;
-   int error, flags = 0, trycnt = 0;
+   int error, flags = 0, i, trycnt = 0;
struct nfsclds *dsp, *tdsp;
 
td = curthread;
@@ -1508,6 +1511,14 @@ nfs_unmount(struct mount *mp, int mntfla
 */
if ((mntflags  MNT_FORCE) == 0)
nfscl_umount(nmp, td);
+   /* Make sure no nfsiods are assigned to this mount. */
+   mtx_lock(ncl_iod_mutex);
+   for (i = 0; i  NFS_MAXASYNCDAEMON; i++)
+   if (ncl_iodmount[i] == nmp) {
+   ncl_iodwant[i] = NFSIOD_AVAILABLE;
+   ncl_iodmount[i] = NULL;
+   }
+   mtx_unlock(ncl_iod_mutex);
newnfs_disconnect(nmp-nm_sockreq);
crfree(nmp-nm_sockreq.nr_cred);
FREE(nmp-nm_nam, M_SONAME);

Modified: head/sys/nfsclient/nfs_nfsiod.c
==
--- head/sys/nfsclient/nfs_nfsiod.c Thu Apr 18 22:54:41 2013
(r249629)
+++ head/sys/nfsclient/nfs_nfsiod.c Thu Apr 18 23:20:16 2013
(r249630)
@@ -308,6 +308,14 @@ nfssvc_iod(void *instance)
mtx_unlock(Giant);
mtx_lock(nfs_iod_mtx);
/*
+* Make sure the nmp hasn't been dismounted as soon as
+* nfs_doio() completes for the last buffer.
+*/
+   nmp = nfs_iodmount[myiod];
+   if (nmp == NULL)
+   break;
+
+   /*
 * If there are more than one iod on this mount, then defect
 * so that the iods can be shared out fairly between the mounts
 */

Modified: head/sys/nfsclient/nfs_vfsops.c
==
--- head/sys/nfsclient/nfs_vfsops.c Thu Apr 18 22:54:41 2013
(r249629)
+++ head/sys/nfsclient/nfs_vfsops.c Thu Apr 18 23:20:16 2013
(r249630)
@@ -1362,7 +1362,7 @@ static int
 nfs_unmount(struct mount *mp, int mntflags)
 {
struct nfsmount *nmp;
-   int error, flags = 0;
+   int error, flags = 0, i;
 
if (mntflags  MNT_FORCE)
flags |= FORCECLOSE;
@@ -1387,6 +1387,14 @@ nfs_unmount(struct mount 

svn commit: r249631 - in head/sys: dev/random libkern sys

2013-04-18 Thread Andrey A. Chernov
Author: ache
Date: Fri Apr 19 00:30:52 2013
New Revision: 249631
URL: http://svnweb.freebsd.org/changeset/base/249631

Log:
  Attempt to mitigate poor initialization of arc4 by one-shot
  reinitialization from yarrow right after good entropy is harvested.
  
  Approved by:secteam (delphij)
  MFC after:  1 week

Modified:
  head/sys/dev/random/randomdev_soft.c
  head/sys/libkern/arc4random.c
  head/sys/sys/libkern.h

Modified: head/sys/dev/random/randomdev_soft.c
==
--- head/sys/dev/random/randomdev_soft.cThu Apr 18 23:20:16 2013
(r249630)
+++ head/sys/dev/random/randomdev_soft.cFri Apr 19 00:30:52 2013
(r249631)
@@ -367,6 +367,8 @@ random_yarrow_unblock(void)
selwakeuppri(random_systat.rsel, PUSER);
wakeup(random_systat);
}
+   (void)atomic_cmpset_int(arc4rand_iniseed_state, ARC4_ENTR_NONE,
+   ARC4_ENTR_HAVE);
 }
 
 static int

Modified: head/sys/libkern/arc4random.c
==
--- head/sys/libkern/arc4random.c   Thu Apr 18 23:20:16 2013
(r249630)
+++ head/sys/libkern/arc4random.c   Fri Apr 19 00:30:52 2013
(r249631)
@@ -24,6 +24,8 @@ __FBSDID($FreeBSD$);
 #defineARC4_RESEED_SECONDS 300
 #defineARC4_KEYBYTES (256 / 8)
 
+int arc4rand_iniseed_state = ARC4_ENTR_NONE;
+
 static u_int8_t arc4_i, arc4_j;
 static int arc4_numruns = 0;
 static u_int8_t arc4_sbox[256];
@@ -130,7 +132,8 @@ arc4rand(void *ptr, u_int len, int resee
struct timeval tv;
 
getmicrouptime(tv);
-   if (reseed || 
+   if (atomic_cmpset_int(arc4rand_iniseed_state, ARC4_ENTR_HAVE,
+   ARC4_ENTR_SEED) || reseed ||
   (arc4_numruns  ARC4_RESEED_BYTES) ||
   (tv.tv_sec  arc4_t_reseed))
arc4_randomstir();

Modified: head/sys/sys/libkern.h
==
--- head/sys/sys/libkern.h  Thu Apr 18 23:20:16 2013(r249630)
+++ head/sys/sys/libkern.h  Fri Apr 19 00:30:52 2013(r249631)
@@ -70,6 +70,11 @@ static __inline int abs(int a) { return 
 static __inline long labs(long a) { return (a  0 ? -a : a); }
 static __inline quad_t qabs(quad_t a) { return (a  0 ? -a : a); }
 
+#defineARC4_ENTR_NONE  0   /* Don't have entropy yet. */
+#defineARC4_ENTR_HAVE  1   /* Have entropy. */
+#defineARC4_ENTR_SEED  2   /* Reseeding. */
+extern int arc4rand_iniseed_state;
+
 /* Prototypes for non-quad routines. */
 struct malloc_type;
 uint32_t arc4random(void);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r249633 - head/lib

2013-04-18 Thread Tim Kientzle
Author: kientzle
Date: Fri Apr 19 05:01:14 2013
New Revision: 249633
URL: http://svnweb.freebsd.org/changeset/base/249633

Log:
  Fix the symlink creation from r249484 so that repeated
  installs work correctly.
  
  Suggested by Tijl Coosemans.

Modified:
  head/lib/Makefile

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Fri Apr 19 03:55:54 2013(r249632)
+++ head/lib/Makefile   Fri Apr 19 05:01:14 2013(r249633)
@@ -253,6 +253,6 @@ _libusb=libusb
 .endif
 
 afterinstall:
-   ln -fs ../include ${DESTDIR}/usr/lib/include
+   ln -fs ../include ${DESTDIR}/usr/lib/
 
 .include bsd.subdir.mk
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r249634 - head/lib

2013-04-18 Thread Tim Kientzle
Author: kientzle
Date: Fri Apr 19 05:13:57 2013
New Revision: 249634
URL: http://svnweb.freebsd.org/changeset/base/249634

Log:
  An even more refined version of r249484, until we can come up with
  a good fix for the -print-file-name=include breakage.
  
  As suggested by Andrey Chernov.

Modified:
  head/lib/Makefile

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Fri Apr 19 05:01:14 2013(r249633)
+++ head/lib/Makefile   Fri Apr 19 05:13:57 2013(r249634)
@@ -253,6 +253,6 @@ _libusb=libusb
 .endif
 
 afterinstall:
-   ln -fs ../include ${DESTDIR}/usr/lib/
+   ln -hfs ../include ${DESTDIR}/usr/lib/include
 
 .include bsd.subdir.mk
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r249636 - head/sys/modules/uart

2013-04-18 Thread Justin Hibbits
Author: jhibbits
Date: Fri Apr 19 05:46:16 2013
New Revision: 249636
URL: http://svnweb.freebsd.org/changeset/base/249636

Log:
  Fix the uart(4) module build.  Without uart_dev_lpc the module cannot be 
loaded.

Modified:
  head/sys/modules/uart/Makefile

Modified: head/sys/modules/uart/Makefile
==
--- head/sys/modules/uart/Makefile  Fri Apr 19 05:28:08 2013
(r249635)
+++ head/sys/modules/uart/Makefile  Fri Apr 19 05:46:16 2013
(r249636)
@@ -23,7 +23,7 @@ KMOD= uart
 SRCS=  uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \
uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \
uart_core.c ${uart_cpu_machine} uart_dbg.c \
-   uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c \
+   uart_dev_lpc.c uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c \
uart_dev_z8530.c \
uart_if.c uart_if.h uart_subr.c uart_tty.c
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org