svn commit: r250355 - head/sys/dev/ath

2013-05-08 Thread Adrian Chadd
Author: adrian
Date: Wed May  8 07:30:33 2013
New Revision: 250355
URL: http://svnweb.freebsd.org/changeset/base/250355

Log:
  Revert a previous commit - this is causing hardware errors.
  
  I'm not sure why this is failing.  The holding descriptor should be being
  re-read when starting DMA of the next frame.  Obviously something here
  isn't totally correct.
  
  I'll review the TX queue handling and see if I can figure out why this
  is failing.  I'll then re-revert this patch out and use the holding
  descriptor again.

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

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Wed May  8 07:14:07 2013(r250354)
+++ head/sys/dev/ath/if_ath.c   Wed May  8 07:30:33 2013(r250355)
@@ -4000,20 +4000,19 @@ ath_tx_processq(struct ath_softc *sc, st
break;
}
ATH_TXQ_REMOVE(txq, bf, bf_list);
-
-   /*
-* Always mark the last buffer in this list as busy.
-*
-* The hardware may re-read the holding descriptor
-* even if we hit the end of the list and try writing
-* a new TxDP.
-*
-* If there's no holding descriptor then this is the
-* last buffer in the list of buffers after a fresh
-* reset; it'll soon become the holding buffer.
-*/
-   bf-bf_last-bf_flags |= ATH_BUF_BUSY;
-
+   if (txq-axq_depth  0) {
+   /*
+* More frames follow.  Mark the buffer busy
+* so it's not re-used while the hardware may
+* still re-read the link field in the descriptor.
+*
+* Use the last buffer in an aggregate as that
+* is where the hardware may be - intermediate
+* descriptors won't be busy.
+*/
+   bf-bf_last-bf_flags |= ATH_BUF_BUSY;
+   } else
+   txq-axq_link = NULL;
if (bf-bf_state.bfs_aggr)
txq-axq_aggr_depth--;
 

Modified: head/sys/dev/ath/if_ath_misc.h
==
--- head/sys/dev/ath/if_ath_misc.h  Wed May  8 07:14:07 2013
(r250354)
+++ head/sys/dev/ath/if_ath_misc.h  Wed May  8 07:30:33 2013
(r250355)
@@ -131,10 +131,16 @@ externvoid ath_start_task(void *arg, in
 static inline void
 ath_tx_kick(struct ath_softc *sc)
 {
+   struct ieee80211com *ic = sc-sc_ifp-if_l2com;
 
+   IEEE80211_TX_UNLOCK_ASSERT(ic);
+   ATH_TX_UNLOCK_ASSERT(sc);
+
+   IEEE80211_TX_LOCK(ic);
ATH_TX_LOCK(sc);
ath_start(sc-sc_ifp);
ATH_TX_UNLOCK(sc);
+   IEEE80211_TX_UNLOCK(ic);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250356 - head/sys/dev/ath

2013-05-08 Thread Adrian Chadd
Author: adrian
Date: Wed May  8 08:53:55 2013
New Revision: 250356
URL: http://svnweb.freebsd.org/changeset/base/250356

Log:
  This shouldn't have made it into this commit, sorry.

Modified:
  head/sys/dev/ath/if_ath_misc.h

Modified: head/sys/dev/ath/if_ath_misc.h
==
--- head/sys/dev/ath/if_ath_misc.h  Wed May  8 07:30:33 2013
(r250355)
+++ head/sys/dev/ath/if_ath_misc.h  Wed May  8 08:53:55 2013
(r250356)
@@ -131,16 +131,10 @@ externvoid ath_start_task(void *arg, in
 static inline void
 ath_tx_kick(struct ath_softc *sc)
 {
-   struct ieee80211com *ic = sc-sc_ifp-if_l2com;
 
-   IEEE80211_TX_UNLOCK_ASSERT(ic);
-   ATH_TX_UNLOCK_ASSERT(sc);
-
-   IEEE80211_TX_LOCK(ic);
ATH_TX_LOCK(sc);
ath_start(sc-sc_ifp);
ATH_TX_UNLOCK(sc);
-   IEEE80211_TX_UNLOCK(ic);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250357 - head/sys/arm/freescale/imx

2013-05-08 Thread Aleksandr Rybalko
Author: ray
Date: Wed May  8 09:42:50 2013
New Revision: 250357
URL: http://svnweb.freebsd.org/changeset/base/250357

Log:
  Update copyright date.

Modified:
  head/sys/arm/freescale/imx/bus_space.c
  head/sys/arm/freescale/imx/common.c
  head/sys/arm/freescale/imx/console.c
  head/sys/arm/freescale/imx/i2c.c
  head/sys/arm/freescale/imx/imx51_ccm.c
  head/sys/arm/freescale/imx/imx51_ccmreg.h
  head/sys/arm/freescale/imx/imx51_ccmvar.h
  head/sys/arm/freescale/imx/imx51_dpllreg.h
  head/sys/arm/freescale/imx/imx51_gpio.c
  head/sys/arm/freescale/imx/imx51_iomux.c
  head/sys/arm/freescale/imx/imx51_iomuxreg.h
  head/sys/arm/freescale/imx/imx51_iomuxvar.h
  head/sys/arm/freescale/imx/imx51_ipuv3.c
  head/sys/arm/freescale/imx/imx51_ipuv3reg.h
  head/sys/arm/freescale/imx/imx51_sdmareg.h
  head/sys/arm/freescale/imx/imx51_ssireg.h
  head/sys/arm/freescale/imx/imx51_tzicreg.h
  head/sys/arm/freescale/imx/imx_gpt.c
  head/sys/arm/freescale/imx/imx_gptreg.h
  head/sys/arm/freescale/imx/imx_gptvar.h
  head/sys/arm/freescale/imx/imx_machdep.c
  head/sys/arm/freescale/imx/imx_wdog.c
  head/sys/arm/freescale/imx/imx_wdogreg.h
  head/sys/arm/freescale/imx/tzic.c

Modified: head/sys/arm/freescale/imx/bus_space.c
==
--- head/sys/arm/freescale/imx/bus_space.c  Wed May  8 08:53:55 2013
(r250356)
+++ head/sys/arm/freescale/imx/bus_space.c  Wed May  8 09:42:50 2013
(r250357)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 FreeBSD Foundation
+ * Copyright (C) 2012, 2013 FreeBSD Foundation
  * All rights reserved.
  *
  * This software was developed by Oleksandr Tymoshenko under sponsorship

Modified: head/sys/arm/freescale/imx/common.c
==
--- head/sys/arm/freescale/imx/common.c Wed May  8 08:53:55 2013
(r250356)
+++ head/sys/arm/freescale/imx/common.c Wed May  8 09:42:50 2013
(r250357)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (C) 2008-2011 MARVELL INTERNATIONAL LTD.
- * Copyright (c) 2012 The FreeBSD Foundation
+ * Copyright (c) 2012, 2013 The FreeBSD Foundation
  * All rights reserved.
  *
  * Developed by Semihalf.

Modified: head/sys/arm/freescale/imx/console.c
==
--- head/sys/arm/freescale/imx/console.cWed May  8 08:53:55 2013
(r250356)
+++ head/sys/arm/freescale/imx/console.cWed May  8 09:42:50 2013
(r250357)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2012 The FreeBSD Foundation
+ * Copyright (c) 2012, 2013 The FreeBSD Foundation
  * All rights reserved.
  *
  * This software was developed by Oleksandr Rybalko under sponsorship

Modified: head/sys/arm/freescale/imx/i2c.c
==
--- head/sys/arm/freescale/imx/i2c.cWed May  8 08:53:55 2013
(r250356)
+++ head/sys/arm/freescale/imx/i2c.cWed May  8 09:42:50 2013
(r250357)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (C) 2008-2009 Semihalf, Michal Hajduk
- * Copyright (c) 2012 The FreeBSD Foundation
+ * Copyright (c) 2012, 2013 The FreeBSD Foundation
  * All rights reserved.
  *
  * Portions of this software were developed by Oleksandr Rybalko

Modified: head/sys/arm/freescale/imx/imx51_ccm.c
==
--- head/sys/arm/freescale/imx/imx51_ccm.c  Wed May  8 08:53:55 2013
(r250356)
+++ head/sys/arm/freescale/imx/imx51_ccm.c  Wed May  8 09:42:50 2013
(r250357)
@@ -26,7 +26,7 @@
  */
 
 /*-
- * Copyright (c) 2012 The FreeBSD Foundation
+ * Copyright (c) 2012, 2013 The FreeBSD Foundation
  * All rights reserved.
  *
  * Portions of this software were developed by Oleksandr Rybalko

Modified: head/sys/arm/freescale/imx/imx51_ccmreg.h
==
--- head/sys/arm/freescale/imx/imx51_ccmreg.h   Wed May  8 08:53:55 2013
(r250356)
+++ head/sys/arm/freescale/imx/imx51_ccmreg.h   Wed May  8 09:42:50 2013
(r250357)
@@ -26,7 +26,7 @@
  */
 
 /*-
- * Copyright (c) 2012 The FreeBSD Foundation
+ * Copyright (c) 2012, 2013 The FreeBSD Foundation
  * All rights reserved.
  *
  * Portions of this software were developed by Oleksandr Rybalko

Modified: head/sys/arm/freescale/imx/imx51_ccmvar.h
==
--- head/sys/arm/freescale/imx/imx51_ccmvar.h   Wed May  8 08:53:55 2013
(r250356)
+++ head/sys/arm/freescale/imx/imx51_ccmvar.h   Wed May  8 09:42:50 2013
(r250357)
@@ -26,7 +26,7 @@
  */
 
 /*-
- * Copyright (c) 2012 The FreeBSD Foundation
+ * Copyright (c) 2012, 2013 The FreeBSD Foundation
  * All rights reserved.
  *
  * Portions of this software were developed by Oleksandr Rybalko

Modified: head/sys/arm/freescale/imx/imx51_dpllreg.h

svn commit: r250358 - stable/9/sys/amd64/amd64

2013-05-08 Thread Konstantin Belousov
Author: kib
Date: Wed May  8 10:11:31 2013
New Revision: 250358
URL: http://svnweb.freebsd.org/changeset/base/250358

Log:
  MFC r250152:
  The check to ensure that xstate_bv always has XFEATURE_ENABLED_X87 and
  XFEATURE_ENABLED_SSE bits set is not needed.  CPU correctly handles
  any bitmask which is subset of the enabled bits in %XCR0.
  
  More, CPU instructions XSAVE and XSAVEOPT could write the mask without
  e.g. XFEATURE_ENABLED_SSE, after the VZEROALL.  The check prevents the
  restoration of the otherwise valid FPU save area.

Modified:
  stable/9/sys/amd64/amd64/fpu.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/amd64/amd64/fpu.c
==
--- stable/9/sys/amd64/amd64/fpu.c  Wed May  8 09:42:50 2013
(r250357)
+++ stable/9/sys/amd64/amd64/fpu.c  Wed May  8 10:11:31 2013
(r250358)
@@ -743,9 +743,6 @@ fpusetxstate(struct thread *td, char *xf
 */
if (bv  ~xsave_mask)
return (EINVAL);
-   if ((bv  (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) !=
-   (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE))
-   return (EINVAL);
 
hdr = (struct xstate_hdr *)(get_pcb_user_save_td(td) + 1);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250359 - stable/9/sys/amd64/amd64

2013-05-08 Thread Konstantin Belousov
Author: kib
Date: Wed May  8 10:14:46 2013
New Revision: 250359
URL: http://svnweb.freebsd.org/changeset/base/250359

Log:
  MFC r250153:
  Partially saved extended state must be handled always, i.e. for both
  fpu-owned context, and for pcb-saved one.  More, the XSAVE could do
  partial save, same as XSAVEOPT, so qualifier for the handler should be
  use_xsave and not use_xsaveopt.
  
  Since xsave_area_desc is now needed regardless of the XSAVEOPT use,
  remove the write-only use_xsaveopt variable.

Modified:
  stable/9/sys/amd64/amd64/fpu.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/amd64/amd64/fpu.c
==
--- stable/9/sys/amd64/amd64/fpu.c  Wed May  8 10:11:31 2013
(r250358)
+++ stable/9/sys/amd64/amd64/fpu.c  Wed May  8 10:14:46 2013
(r250359)
@@ -132,7 +132,6 @@ static  voidfpu_clean_state(void);
 SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD,
 NULL, 1, Floating point instructions executed in hardware);
 
-static int use_xsaveopt;
 int use_xsave; /* non-static for cpu_switch.S */
 uint64_t xsave_mask;   /* the same */
 static uma_zone_t fpu_save_area_zone;
@@ -198,7 +197,6 @@ fpuinit_bsp1(void)
 * REX byte, and set the bit 4 of the r/m byte.
 */
ctx_switch_xsave[3] |= 0x10;
-   use_xsaveopt = 1;
}
 }
 
@@ -296,7 +294,7 @@ fpuinitstate(void *arg __unused)
 * Create a table describing the layout of the CPU Extended
 * Save Area.
 */
-   if (use_xsaveopt) {
+   if (use_xsave) {
max_ext_n = flsl(xsave_mask);
xsave_area_desc = malloc(max_ext_n * sizeof(struct
xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO);
@@ -661,7 +659,7 @@ fpugetregs(struct thread *td)
struct pcb *pcb;
uint64_t *xstate_bv, bit;
char *sa;
-   int max_ext_n, i;
+   int max_ext_n, i, owned;
 
pcb = td-td_pcb;
if ((pcb-pcb_flags  PCB_USERFPUINITDONE) == 0) {
@@ -675,31 +673,31 @@ fpugetregs(struct thread *td)
critical_enter();
if (td == PCPU_GET(fpcurthread)  PCB_USER_FPU(pcb)) {
fpusave(get_pcb_user_save_pcb(pcb));
-   critical_exit();
-   return (_MC_FPOWNED_FPU);
+   owned = _MC_FPOWNED_FPU;
} else {
-   critical_exit();
-   if (use_xsaveopt) {
-   /*
-* Handle partially saved state.
-*/
-   sa = (char *)get_pcb_user_save_pcb(pcb);
-   xstate_bv = (uint64_t *)(sa + sizeof(struct savefpu) +
-   offsetof(struct xstate_hdr, xstate_bv));
-   max_ext_n = flsl(xsave_mask);
-   for (i = 0; i  max_ext_n; i++) {
-   bit = 1  i;
-   if ((*xstate_bv  bit) != 0)
-   continue;
-   bcopy((char *)fpu_initialstate +
-   xsave_area_desc[i].offset,
-   sa + xsave_area_desc[i].offset,
-   xsave_area_desc[i].size);
-   *xstate_bv |= bit;
-   }
+   owned = _MC_FPOWNED_PCB;
+   }
+   critical_exit();
+   if (use_xsave) {
+   /*
+* Handle partially saved state.
+*/
+   sa = (char *)get_pcb_user_save_pcb(pcb);
+   xstate_bv = (uint64_t *)(sa + sizeof(struct savefpu) +
+   offsetof(struct xstate_hdr, xstate_bv));
+   max_ext_n = flsl(xsave_mask);
+   for (i = 0; i  max_ext_n; i++) {
+   bit = 1  i;
+   if ((*xstate_bv  bit) != 0)
+   continue;
+   bcopy((char *)fpu_initialstate +
+   xsave_area_desc[i].offset,
+   sa + xsave_area_desc[i].offset,
+   xsave_area_desc[i].size);
+   *xstate_bv |= bit;
}
-   return (_MC_FPOWNED_PCB);
}
+   return (owned);
 }
 
 void
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250361 - head/sys/vm

2013-05-08 Thread Attilio Rao
Author: attilio
Date: Wed May  8 10:55:39 2013
New Revision: 250361
URL: http://svnweb.freebsd.org/changeset/base/250361

Log:
  Fix-up r250338 by completing the removal of VM_NDOMAIN in favor of
  MAXMEMDOM.
  This unbreak builds.
  
  Sponsored by: EMC / Isilon storage division
  Reported by:  adrian, jeli

Modified:
  head/sys/vm/vm_phys.c

Modified: head/sys/vm/vm_phys.c
==
--- head/sys/vm/vm_phys.c   Wed May  8 10:53:17 2013(r250360)
+++ head/sys/vm/vm_phys.c   Wed May  8 10:55:39 2013(r250361)
@@ -464,7 +464,7 @@ vm_phys_alloc_pages(int pool, int order)
 vm_page_t
 vm_phys_alloc_freelist_pages(int flind, int pool, int order)
 {
-#if VM_NDOMAIN  1
+#if MAXMEMDOM  1
vm_page_t m;
int i, ndomains;
 #endif
@@ -477,7 +477,7 @@ vm_phys_alloc_freelist_pages(int flind, 
KASSERT(order  VM_NFREEORDER,
(vm_phys_alloc_freelist_pages: order %d is out of range, order));
 
-#if VM_NDOMAIN  1
+#if MAXMEMDOM  1
/*
 * This routine expects to be called with a VM_FREELIST_* constant.
 * On a system with multiple domains we need to adjust the flind
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r250338 - in head/sys: amd64/include arm/include conf i386/include ia64/include mips/include powerpc/include sparc64/include vm x86/acpica

2013-05-08 Thread Attilio Rao
On Wed, May 8, 2013 at 5:21 AM, Adrian Chadd adr...@freebsd.org wrote:
 Hi,

 This broke a fresh buildworld for me. sys/vm/vm_phys.c still
 references VM_NDOMAIN.

Fixed in r250361. Sorry for the breakage.

Thanks,
Attilio


--
Peace can only be achieved by understanding - A. Einstein
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250363 - in head/sys: dev/acpi_support modules/acpi/acpi_rapidstart

2013-05-08 Thread Takanori Watanabe
Author: takawata
Date: Wed May  8 12:53:21 2013
New Revision: 250363
URL: http://svnweb.freebsd.org/changeset/base/250363

Log:
  A driver for Intel Rapid Start Technology ACPI device.
  Note that it is just for 'Advanced' configuration for Rapid start technology.

Added:
  head/sys/dev/acpi_support/acpi_rapidstart.c   (contents, props changed)
  head/sys/modules/acpi/acpi_rapidstart/
  head/sys/modules/acpi/acpi_rapidstart/Makefile   (contents, props changed)

Added: head/sys/dev/acpi_support/acpi_rapidstart.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/acpi_support/acpi_rapidstart.c Wed May  8 12:53:21 2013
(r250363)
@@ -0,0 +1,133 @@
+/*-
+ * Copyright (c) 2013 Takanori Watanabe
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include opt_acpi.h
+#include sys/param.h
+#include sys/kernel.h
+#include sys/bus.h
+
+#include contrib/dev/acpica/include/acpi.h
+
+#include acpi_if.h
+#include sys/module.h
+#include dev/acpica/acpivar.h
+#include sys/sysctl.h
+static int sysctl_acpi_rapidstart_gen_handler(SYSCTL_HANDLER_ARGS);
+
+
+static struct acpi_rapidstart_name_list
+{
+   char *nodename;
+   char *getmethod;
+   char *setmethod;
+   char *comment;
+} acpi_rapidstart_oids[] ={
+   {ffs,GFFS,SFFS,Flash Fast Store Flag},
+   {ftv,GFTV,SFTV,Time value},
+   {NULL, NULL, NULL, NULL}
+};
+
+struct acpi_rapidstart_softc {
+   struct sysctl_ctx_list  *sysctl_ctx;
+   struct sysctl_oid   *sysctl_tree;
+
+};
+static char*rapidstart_ids[] = {INT3392, NULL};
+static int
+acpi_rapidstart_probe(device_t dev)
+{
+   if (acpi_disabled(rapidstart) ||
+   ACPI_ID_PROBE(device_get_parent(dev), dev, rapidstart_ids) == NULL 
||
+   device_get_unit(dev) != 0)
+   return (ENXIO);
+
+   device_set_desc(dev, Intel Rapid Start ACPI device);
+
+   return (0);
+   
+}
+
+static int
+acpi_rapidstart_attach(device_t dev)
+{
+   struct acpi_rapidstart_softc *sc;
+   int i;
+
+   sc = device_get_softc(dev);
+   
+   sc-sysctl_ctx = device_get_sysctl_ctx(dev);
+   sc-sysctl_tree = device_get_sysctl_tree(dev);
+   for (i = 0 ; acpi_rapidstart_oids[i].nodename != NULL; i++){
+   SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+   i, acpi_rapidstart_oids[i].nodename , CTLTYPE_INT |
+   ((acpi_rapidstart_oids[i].setmethod)? CTLFLAG_RW: 
CTLFLAG_RD),
+   dev, i, sysctl_acpi_rapidstart_gen_handler, I,
+   acpi_rapidstart_oids[i].comment);
+   }
+   return (0);
+}
+
+static int 
+sysctl_acpi_rapidstart_gen_handler(SYSCTL_HANDLER_ARGS)
+{
+   device_tdev = arg1;
+   int function = oidp-oid_arg2;
+   int error = 0, val;
+
+   acpi_GetInteger(acpi_get_handle(dev),
+   acpi_rapidstart_oids[function].getmethod, val);
+   error = sysctl_handle_int(oidp, val, 0, req);
+   if (error || !req-newptr || !acpi_rapidstart_oids[function].setmethod)
+   return (error);
+   acpi_SetInteger(acpi_get_handle(dev),
+   acpi_rapidstart_oids[function].setmethod, val);
+   return (0);
+}
+
+static device_method_t acpi_rapidstart_methods[] = {
+   /* Device interface */
+   DEVMETHOD(device_probe, acpi_rapidstart_probe),
+   DEVMETHOD(device_attach, acpi_rapidstart_attach),
+
+   DEVMETHOD_END
+};
+
+static driver_tacpi_rapidstart_driver = {
+   

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

2013-05-08 Thread Takanori Watanabe
Author: takawata
Date: Wed May  8 13:26:17 2013
New Revision: 250364
URL: http://svnweb.freebsd.org/changeset/base/250364

Log:
  Manual page for acpi_rapidstart(4) driver.
  
  
   Description of fields to fill in above: 76 columns --|
   PR:If a GNATS PR is affected by the change.
   Submitted by:  If someone else sent in the change.
   Reviewed by:   If someone else reviewed your modification.
   Approved by:   If you needed approval for this commit.
   Obtained from: If the change is from a third party.
   MFC after: N [day[s]|week[s]|month[s]].  Request a reminder email.
   Security:  Vulnerability reference (one per line) or description.
   Empty fields above will be automatically removed.
  
  AM   acpi_rapidstart.4

Added:
  head/share/man/man4/acpi_rapidstart.4   (contents, props changed)

Added: head/share/man/man4/acpi_rapidstart.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/acpi_rapidstart.4   Wed May  8 13:26:17 2013
(r250364)
@@ -0,0 +1,82 @@
+.\ Copyright (c) 2013 Takanori Watanabe
+.\ All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\ SUCH DAMAGE.
+.\
+.\ $FreeBSD$
+.\
+.Dd May 8, 2013
+.Dt ACPI_RAPIDSTART 4
+.Os
+.Sh NAME
+.Nm acpi_rapidstart
+.Nd Intel rapid start technology ACPI driver
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following line in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd device acpi_rapidstart
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+acpi_rapidstart_load=YES
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for Intel Rapid Start technology ACPI device interface.
+Note that this is only for ACPI device interface . This has _CID PNP0C02 so
+should be loaded in boot time to avoid attaching acpi_sysresource driver.
+
+.Sh SYSCTLS
+The following sysctl nodes are currently implemented:
+.Bl -tag -width indent
+.It Va dev.acpi_rapidstart.0.ffs
+Rapid start flag.
+It is a bitwise OR of the following:
+.Pp
+.Bl -tag -width indent-two -compact
+.It Li 1
+Enter Fast Flash Standby in RTC wake.
+.It Li 2
+Enter Fast Flash Standby in Critical Battery Wake enable
+.El
+.It Va dev.acpi_rapidstart.0.ftv
+Fast Flash Standby timer value in minutes.
+.El
+.Sh SEE ALSO
+.Xr acpi 4 ,
+.Xr sysctl 8
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 10.0 .
+.Sh AUTHORS
+The
+.Nm
+driver was written by
+.An Takanori Watanabe Aq takaw...@freebsd.org .
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250365 - head/sys/kern

2013-05-08 Thread Andre Oppermann
Author: andre
Date: Wed May  8 14:13:14 2013
New Revision: 250365
URL: http://svnweb.freebsd.org/changeset/base/250365

Log:
  When the accept queue is full print the number of already pending
  new connections instead of by how many we're over the limit, which
  is always 1.
  
  Noticed by:   jmallet
  MFC after:1 week

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==
--- head/sys/kern/uipc_socket.c Wed May  8 13:26:17 2013(r250364)
+++ head/sys/kern/uipc_socket.c Wed May  8 14:13:14 2013(r250365)
@@ -515,7 +515,7 @@ sonewconn(struct socket *head, int conns
 #endif
log(LOG_DEBUG, %s: pcb %p: Listen queue overflow: 
%i already in queue awaiting acceptance\n,
-   __func__, head-so_pcb, over);
+   __func__, head-so_pcb, head-so_qlen);
return (NULL);
}
VNET_ASSERT(head-so_vnet != NULL, (%s:%d so_vnet is NULL, head=%p,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250366 - in stable/9/sys: cam conf

2013-05-08 Thread Sean Bruno
Author: sbruno
Date: Wed May  8 15:45:52 2013
New Revision: 250366
URL: http://svnweb.freebsd.org/changeset/base/250366

Log:
  MFC r249664
  
  Expose CAM_BOOT_DELAY as a kernel conf item now.
  
  This allows users who boot without loader to adjust their environments
  around slightly buggy or slow hardware.

Modified:
  stable/9/sys/cam/cam_xpt.c
  stable/9/sys/conf/options
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/conf/   (props changed)

Modified: stable/9/sys/cam/cam_xpt.c
==
--- stable/9/sys/cam/cam_xpt.c  Wed May  8 14:13:14 2013(r250365)
+++ stable/9/sys/cam/cam_xpt.c  Wed May  8 15:45:52 2013(r250366)
@@ -908,6 +908,13 @@ xpt_init(void *dummy)
mtx_init(xsoftc.xpt_lock, XPT lock, NULL, MTX_DEF);
mtx_init(xsoftc.xpt_topo_lock, XPT topology lock, NULL, MTX_DEF);
 
+#ifdef CAM_BOOT_DELAY
+   /*
+* Override this value at compile time to assist our users
+* who don't use loader to boot a kernel.
+*/
+   xsoftc.boot_delay = CAM_BOOT_DELAY;
+#endif
/*
 * The xpt layer is, itself, the equivelent of a SIM.
 * Allow 16 ccbs in the ccb pool for it.  This should

Modified: stable/9/sys/conf/options
==
--- stable/9/sys/conf/options   Wed May  8 14:13:14 2013(r250365)
+++ stable/9/sys/conf/options   Wed May  8 15:45:52 2013(r250366)
@@ -308,6 +308,7 @@ CAM_DEBUG_BUS   opt_cam.h
 CAM_DEBUG_TARGET   opt_cam.h
 CAM_DEBUG_LUN  opt_cam.h
 CAM_DEBUG_FLAGSopt_cam.h
+CAM_BOOT_DELAY opt_cam.h
 SCSI_DELAY opt_scsi.h
 SCSI_NO_SENSE_STRINGS  opt_scsi.h
 SCSI_NO_OP_STRINGS opt_scsi.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250367 - stable/9/sys/dev/ciss

2013-05-08 Thread Sean Bruno
Author: sbruno
Date: Wed May  8 15:47:51 2013
New Revision: 250367
URL: http://svnweb.freebsd.org/changeset/base/250367

Log:
  MFC r249815
  
  Return a lun count of 1 and a lun id of 0 when CAM attempts a REPORT_LUNS
  command on a disk device.  This quieseces some noise on the console that
  recently appeared.

Modified:
  stable/9/sys/dev/ciss/ciss.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/ciss/ciss.c
==
--- stable/9/sys/dev/ciss/ciss.cWed May  8 15:45:52 2013
(r250366)
+++ stable/9/sys/dev/ciss/ciss.cWed May  8 15:47:51 2013
(r250367)
@@ -3208,6 +3208,19 @@ ciss_cam_emulate(struct ciss_softc *sc, 
}
 }
 
+/* 
+ * A CISS target can only ever have one lun per target. REPORT_LUNS 
requires
+ * at least one LUN field to be pre created for us, so snag it and fill in
+ * the least significant byte indicating 1 LUN here.  Emulate the command
+ * return to shut up warning on console of a CDB error.  swb 
+ */
+if (opcode == REPORT_LUNS  csio-dxfer_len  0) {
+   csio-data_ptr[3] = 8;
+   csio-ccb_h.status |= CAM_REQ_CMP;
+   xpt_done((union ccb *)csio);
+   return(1);
+}
+
 return(0);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250368 - stable/8/sys/dev/ciss

2013-05-08 Thread Sean Bruno
Author: sbruno
Date: Wed May  8 15:48:36 2013
New Revision: 250368
URL: http://svnweb.freebsd.org/changeset/base/250368

Log:
  MFC r249815
  
  Return a lun count of 1 and a lun id of 0 when CAM attempts a REPORT_LUNS
  command on a disk device.  This quieseces some noise on the console that
  recently appeared.

Modified:
  stable/8/sys/dev/ciss/ciss.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/ciss/   (props changed)

Modified: stable/8/sys/dev/ciss/ciss.c
==
--- stable/8/sys/dev/ciss/ciss.cWed May  8 15:47:51 2013
(r250367)
+++ stable/8/sys/dev/ciss/ciss.cWed May  8 15:48:36 2013
(r250368)
@@ -3207,6 +3207,19 @@ ciss_cam_emulate(struct ciss_softc *sc, 
}
 }
 
+/* 
+ * A CISS target can only ever have one lun per target. REPORT_LUNS 
requires
+ * at least one LUN field to be pre created for us, so snag it and fill in
+ * the least significant byte indicating 1 LUN here.  Emulate the command
+ * return to shut up warning on console of a CDB error.  swb 
+ */
+if (opcode == REPORT_LUNS  csio-dxfer_len  0) {
+   csio-data_ptr[3] = 8;
+   csio-ccb_h.status |= CAM_REQ_CMP;
+   xpt_done((union ccb *)csio);
+   return(1);
+}
+
 return(0);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250369 - stable/7/sys/dev/ciss

2013-05-08 Thread Sean Bruno
Author: sbruno
Date: Wed May  8 15:50:24 2013
New Revision: 250369
URL: http://svnweb.freebsd.org/changeset/base/250369

Log:
  MFC r249815
  
  Return a lun count of 1 and a lun id of 0 when CAM attempts a REPORT_LUNS
  command on a disk device.  This quieseces some noise on the console that
  recently appeared.

Modified:
  stable/7/sys/dev/ciss/ciss.c
Directory Properties:
  stable/7/sys/   (props changed)

Modified: stable/7/sys/dev/ciss/ciss.c
==
--- stable/7/sys/dev/ciss/ciss.cWed May  8 15:48:36 2013
(r250368)
+++ stable/7/sys/dev/ciss/ciss.cWed May  8 15:50:24 2013
(r250369)
@@ -2919,6 +2919,19 @@ ciss_cam_emulate(struct ciss_softc *sc, 
}
 }
 
+/* 
+ * A CISS target can only ever have one lun per target. REPORT_LUNS 
requires
+ * at least one LUN field to be pre created for us, so snag it and fill in
+ * the least significant byte indicating 1 LUN here.  Emulate the command
+ * return to shut up warning on console of a CDB error.  swb 
+ */
+if (opcode == REPORT_LUNS  csio-dxfer_len  0) {
+   csio-data_ptr[3] = 8;
+   csio-ccb_h.status |= CAM_REQ_CMP;
+   xpt_done((union ccb *)csio);
+   return(1);
+}
+
 return(0);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250370 - in stable/9: share/man/man4 sys/dev/e1000

2013-05-08 Thread Sean Bruno
Author: sbruno
Date: Wed May  8 15:55:29 2013
New Revision: 250370
URL: http://svnweb.freebsd.org/changeset/base/250370

Log:
  MFC r249070
  
  Update man page for igb(4) with a little bit of information about
  hw.igb.num_queues for those so inclined.

Modified:
  stable/9/share/man/man4/igb.4
  stable/9/sys/dev/e1000/if_igb.c
Directory Properties:
  stable/9/share/man/man4/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)

Modified: stable/9/share/man/man4/igb.4
==
--- stable/9/share/man/man4/igb.4   Wed May  8 15:50:24 2013
(r250369)
+++ stable/9/share/man/man4/igb.4   Wed May  8 15:55:29 2013
(r250370)
@@ -31,7 +31,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd May 12, 2012
+.Dd March 25, 2013
 .Dt IGB 4
 .Os
 .Sh NAME
@@ -160,6 +160,11 @@ The minimum is 80, and the maximum is 40
 .It Va hw.igb.enable_aim
 If set to 1, enable Adaptive Interrupt Moderation.
 The default is to enable Adaptive Interrupt Moderation.
+.It Va hw.igb.num_queues
+Numer of queues used for data transfer.
+If set to 0, number of queues will be configured
+automatically based on number of CPUs and max
+supported MSI-X messages on the device.
 .It Va kern.ipc.nmbclusters
 The maximum number of mbuf clusters allowed.
 If the system has more than one igb card or jumbo frames are

Modified: stable/9/sys/dev/e1000/if_igb.c
==
--- stable/9/sys/dev/e1000/if_igb.c Wed May  8 15:50:24 2013
(r250369)
+++ stable/9/sys/dev/e1000/if_igb.c Wed May  8 15:55:29 2013
(r250370)
@@ -375,7 +375,8 @@ SYSCTL_INT(_hw_igb, OID_AUTO, header_spl
 
 /*
 ** This will autoconfigure based on
-** the number of CPUs if left at 0.
+** the number of CPUs and max supported MSI-X messages
+** if left at 0.
 */
 static int igb_num_queues = 0;
 TUNABLE_INT(hw.igb.num_queues, igb_num_queues);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r250339 - head/sys/x86/acpica

2013-05-08 Thread John Baldwin
On Tuesday, May 07, 2013 6:49:57 pm Attilio Rao wrote:
 Author: attilio
 Date: Tue May  7 22:49:56 2013
 New Revision: 250339
 URL: http://svnweb.freebsd.org/changeset/base/250339
 
 Log:
   Add functions to do ACPI System Locality Information Table parsing
   and printing at boot.
   For reference on table informations and purposes please review ACPI specs.
   
   Sponsored by:   EMC / Isilon storage division
   Obtained from:  jeff
   Reviewed by:jhb (earlier version)

Eh, I don't recall reviewing this.  However, acpidump already dumps this 
table, and we should dump tables via acpidump, not in dmesg.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2013-05-08 Thread Sean Bruno
Author: sbruno
Date: Wed May  8 16:29:12 2013
New Revision: 250371
URL: http://svnweb.freebsd.org/changeset/base/250371

Log:
  s/Numer/Number/
  
  Submitted by: Jeremy Chadwick j...@koitsu.org

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

Modified: head/share/man/man4/igb.4
==
--- head/share/man/man4/igb.4   Wed May  8 15:55:29 2013(r250370)
+++ head/share/man/man4/igb.4   Wed May  8 16:29:12 2013(r250371)
@@ -161,7 +161,7 @@ The minimum is 80, and the maximum is 40
 If set to 1, enable Adaptive Interrupt Moderation.
 The default is to enable Adaptive Interrupt Moderation.
 .It Va hw.igb.num_queues
-Numer of queues used for data transfer.
+Number of queues used for data transfer.
 If set to 0, number of queues will be configured
 automatically based on number of CPUs and max
 supported MSI-X messages on the device.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250372 - stable/9/share/man/man4

2013-05-08 Thread Sean Bruno
Author: sbruno
Date: Wed May  8 16:31:11 2013
New Revision: 250372
URL: http://svnweb.freebsd.org/changeset/base/250372

Log:
  MFC r250371
  
  s/Numer/Number/

Modified:
  stable/9/share/man/man4/igb.4
Directory Properties:
  stable/9/share/man/man4/   (props changed)

Modified: stable/9/share/man/man4/igb.4
==
--- stable/9/share/man/man4/igb.4   Wed May  8 16:29:12 2013
(r250371)
+++ stable/9/share/man/man4/igb.4   Wed May  8 16:31:11 2013
(r250372)
@@ -161,7 +161,7 @@ The minimum is 80, and the maximum is 40
 If set to 1, enable Adaptive Interrupt Moderation.
 The default is to enable Adaptive Interrupt Moderation.
 .It Va hw.igb.num_queues
-Numer of queues used for data transfer.
+Number of queues used for data transfer.
 If set to 0, number of queues will be configured
 automatically based on number of CPUs and max
 supported MSI-X messages on the device.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250373 - stable/9/sys/dev/hwpmc

2013-05-08 Thread Hiren Panchasara
Author: hiren
Date: Wed May  8 16:43:52 2013
New Revision: 250373
URL: http://svnweb.freebsd.org/changeset/base/250373

Log:
  MFC: 233569
  
  Fix crash on VirtualBox (and probably on some real hardware):
  
  - Do not cover error returned by pmc_core_initialize with the
result of pmc_uncore_initialize, fail right away.
  - Give a user something to report instead failing silently.
  
  Submitted by: gonzo
  Reported by:  Alexandr Kovalenko ne...@nevermind.kiev.ua
  Approved by:  sbruno (mentor)

Modified:
  stable/9/sys/dev/hwpmc/hwpmc_core.c
  stable/9/sys/dev/hwpmc/hwpmc_intel.c

Modified: stable/9/sys/dev/hwpmc/hwpmc_core.c
==
--- stable/9/sys/dev/hwpmc/hwpmc_core.c Wed May  8 16:31:11 2013
(r250372)
+++ stable/9/sys/dev/hwpmc/hwpmc_core.c Wed May  8 16:43:52 2013
(r250373)
@@ -2613,8 +2613,12 @@ pmc_core_initialize(struct pmc_mdep *md,
PMCDBG(MDP,INI,1,core-init cputype=%d ncpu=%d ipa-version=%d,
md-pmd_cputype, maxcpu, ipa_version);
 
-   if (ipa_version  1 || ipa_version  3) /* Unknown PMC architecture. */
+   if (ipa_version  1 || ipa_version  3) {
+   /* Unknown PMC architecture. */
+   printf(hwpc_core: unknown PMC architecture: %d\n,
+   ipa_version);
return (EPROGMISMATCH);
+   }
 
core_cputype = md-pmd_cputype;
 

Modified: stable/9/sys/dev/hwpmc/hwpmc_intel.c
==
--- stable/9/sys/dev/hwpmc/hwpmc_intel.cWed May  8 16:31:11 2013
(r250372)
+++ stable/9/sys/dev/hwpmc/hwpmc_intel.cWed May  8 16:43:52 2013
(r250373)
@@ -250,6 +250,9 @@ pmc_intel_initialize(void)
KASSERT(0, ([intel,%d] Unknown CPU type, __LINE__));
}
 
+   if (error)
+   goto error;
+
/*
 * Init the uncore class.
 */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250374 - head/sys/ofed/include/linux

2013-05-08 Thread Xin LI
Author: delphij
Date: Wed May  8 17:45:22 2013
New Revision: 250374
URL: http://svnweb.freebsd.org/changeset/base/250374

Log:
  According to the documentation, on Linux, cancel_delayed_work() does not
  do drain (flush_workqueue() in Linux terms) but instead returns true if
  the work was removed before it is run, or false otherwise.
  
  Simulate this by removing the taskqueue_drain() and return the value
  derived from taskqueue_cancel()'s return value.
  
  This would solve a witness warning caused by calling taskqueue_drain()
  with a non-sleepable lock held, like:
  
  taskqueue_drain with the following non-sleepable locks held:
  exclusive rw lle (lle) r = 0 (0xfe001450b410) locked @
  /usr/src/sys/netinet/in.c:1484
  KDB: stack backtrace:
  db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xff848d4f7690
  kdb_backtrace() at kdb_backtrace+0x39/frame 0xff848d4f7740
  witness_warn() at witness_warn+0x4a8/frame 0xff848d4f7800
  taskqueue_drain() at taskqueue_drain+0x3a/frame 0xff848d4f7840
  set_timeout() at set_timeout+0x4a/frame 0xff848d4f7860
  netevent_callback() at netevent_callback+0x16/frame 0xff848d4f7870
  arpintr() at arpintr+0x9b5/frame 0xff848d4f7930
  
  This do not affect kernel without OFED compiled in.
  
  Reported by:  Garrett Cooper yaneurabeya gmail com
(who also tested an earlier version of this patch,
but bugs are mine)
  MFC after:2 weeks

Modified:
  head/sys/ofed/include/linux/workqueue.h

Modified: head/sys/ofed/include/linux/workqueue.h
==
--- head/sys/ofed/include/linux/workqueue.h Wed May  8 16:43:52 2013
(r250373)
+++ head/sys/ofed/include/linux/workqueue.h Wed May  8 17:45:22 2013
(r250374)
@@ -184,9 +184,9 @@ cancel_delayed_work(struct delayed_work 
 {
 
callout_stop(work-timer);
-   if (work-work.taskqueue 
-   taskqueue_cancel(work-work.taskqueue, work-work.work_task, NULL))
-   taskqueue_drain(work-work.taskqueue, work-work.work_task);
+   if (work-work.taskqueue)
+   return (taskqueue_cancel(work-work.taskqueue,
+   work-work.work_task, NULL) == 0);
return 0;
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r250339 - head/sys/x86/acpica

2013-05-08 Thread Attilio Rao
On Wed, May 8, 2013 at 6:01 PM, John Baldwin j...@freebsd.org wrote:
 On Tuesday, May 07, 2013 6:49:57 pm Attilio Rao wrote:
 Author: attilio
 Date: Tue May  7 22:49:56 2013
 New Revision: 250339
 URL: http://svnweb.freebsd.org/changeset/base/250339

 Log:
   Add functions to do ACPI System Locality Information Table parsing
   and printing at boot.
   For reference on table informations and purposes please review ACPI specs.

   Sponsored by:   EMC / Isilon storage division
   Obtained from:  jeff
   Reviewed by:jhb (earlier version)

 Eh, I don't recall reviewing this.  However, acpidump already dumps this
 table, and we should dump tables via acpidump, not in dmesg.

Now that I read better this patch is based upon a patch you submitted
originally (see the private thread NUMA WIP).
We already print some useful ACPI table information at boot really
(APIC ACPI table case) and this is only printed out when having
MAXMEMDOM  1. Finally I have also sent you this patch and you didn't
object.

However if you really dislike it I can print under bootverbose maybe?

Attilio


--
Peace can only be achieved by understanding - A. Einstein
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250375 - head/sys/dev/qlxgb

2013-05-08 Thread David C Somayajulu
Author: davidcs
Date: Wed May  8 18:25:46 2013
New Revision: 250375
URL: http://svnweb.freebsd.org/changeset/base/250375

Log:
  No need to set if_mtu since it automatically updated by ether_ifattach().
  Use  if_initbaudrate() to set baudrate.
  Add IFCAP_LINKSTATE to if_capabilities.
  
  Submitted by: David C Somayajulu davi...@freebsd.org
  Approved by:  George Neville-Neil g...@freebsd.org

Modified:
  head/sys/dev/qlxgb/qla_os.c

Modified: head/sys/dev/qlxgb/qla_os.c
==
--- head/sys/dev/qlxgb/qla_os.c Wed May  8 17:45:22 2013(r250374)
+++ head/sys/dev/qlxgb/qla_os.c Wed May  8 18:25:46 2013(r250375)
@@ -669,8 +669,7 @@ qla_init_ifnet(device_t dev, qla_host_t 
 
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
 
-   ifp-if_mtu = ETHERMTU;
-   ifp-if_baudrate = (1 * 1000 * 1000 *1000);
+   if_initbaudrate(ifp, IF_Gbps(10));
ifp-if_init = qla_init;
ifp-if_softc = ha;
ifp-if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
@@ -690,6 +689,7 @@ qla_init_ifnet(device_t dev, qla_host_t 
IFCAP_JUMBO_MTU;
 
ifp-if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
+   ifp-if_capabilities |= IFCAP_LINKSTATE;
 
 #if defined(__FreeBSD_version)  (__FreeBSD_version  92)
ifp-if_timer = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250376 - in stable/9/sys: kern sys

2013-05-08 Thread Mikolaj Golub
Author: trociny
Date: Wed May  8 18:39:12 2013
New Revision: 250376
URL: http://svnweb.freebsd.org/changeset/base/250376

Log:
  MFC r249487:
  
  Re-factor the code to provide kern_proc_filedesc_out(), kern_proc_out(),
  and kern_proc_vmmap_out() functions to output process kinfo structures
  to sbuf, to make the code reusable.
  
  The functions are going to be used in the coredump routine to store
  procstat info in the core program header notes.
  
  Reviewed by:  kib

Modified:
  stable/9/sys/kern/kern_descrip.c
  stable/9/sys/kern/kern_proc.c
  stable/9/sys/sys/user.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/9/sys/kern/kern_descrip.c
==
--- stable/9/sys/kern/kern_descrip.cWed May  8 18:25:46 2013
(r250375)
+++ stable/9/sys/kern/kern_descrip.cWed May  8 18:39:12 2013
(r250376)
@@ -71,6 +71,7 @@ __FBSDID($FreeBSD$);
 #include sys/protosw.h
 #include sys/racct.h
 #include sys/resourcevar.h
+#include sys/sbuf.h
 #include sys/signalvar.h
 #include sys/socketvar.h
 #include sys/stat.h
@@ -3226,9 +3227,9 @@ CTASSERT(sizeof(struct kinfo_file) == KI
 #endif
 
 static int
-export_fd_for_sysctl(void *data, int type, int fd, int fflags, int refcnt,
+export_fd_to_sb(void *data, int type, int fd, int fflags, int refcnt,
 int64_t offset, int fd_is_cap, cap_rights_t fd_cap_rights,
-struct kinfo_file *kif, struct sysctl_req *req)
+struct kinfo_file *kif, struct sbuf *sb, ssize_t *remainder)
 {
struct {
int fflag;
@@ -3255,6 +3256,8 @@ export_fd_for_sysctl(void *data, int typ
int error, vfslocked;
unsigned int i;
 
+   if (*remainder == 0)
+   return (0);
bzero(kif, sizeof(*kif));
switch (type) {
case KF_TYPE_FIFO:
@@ -3304,32 +3307,40 @@ export_fd_for_sysctl(void *data, int typ
kif-kf_structsize = offsetof(struct kinfo_file, kf_path) +
strlen(kif-kf_path) + 1;
kif-kf_structsize = roundup(kif-kf_structsize, sizeof(uint64_t));
-   error = SYSCTL_OUT(req, kif, kif-kf_structsize);
+   if (*remainder != -1) {
+   if (*remainder  kif-kf_structsize) {
+   /* Terminate export. */
+   *remainder = 0;
+   return (0);
+   }
+   *remainder -= kif-kf_structsize;
+   }
+   error = sbuf_bcat(sb, kif, kif-kf_structsize);
return (error);
 }
 
 /*
- * Get per-process file descriptors for use by procstat(1), et al.
+ * Store a process file descriptor information to sbuf.
+ *
+ * Takes a locked proc as argument, and returns with the proc unlocked.
  */
-static int
-sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS)
+int
+kern_proc_filedesc_out(struct proc *p,  struct sbuf *sb, ssize_t maxlen)
 {
struct file *fp;
struct filedesc *fdp;
struct kinfo_file *kif;
-   struct proc *p;
struct vnode *cttyvp, *textvp, *tracevp;
-   size_t oldidx;
int64_t offset;
void *data;
-   int error, i, *name;
+   ssize_t remainder;
+   int error, i;
int fd_is_cap, type, refcnt, fflags;
cap_rights_t fd_cap_rights;
 
-   name = (int *)arg1;
-   error = pget((pid_t)name[0], PGET_CANDEBUG, p);
-   if (error != 0)
-   return (error);
+   PROC_LOCK_ASSERT(p, MA_OWNED);
+
+   remainder = maxlen;
/* ktrace vnode */
tracevp = p-p_tracevp;
if (tracevp != NULL)
@@ -3349,14 +3360,15 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER
PROC_UNLOCK(p);
kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK);
if (tracevp != NULL)
-   export_fd_for_sysctl(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE,
-   FREAD | FWRITE, -1, -1, 0, 0, kif, req);
+   export_fd_to_sb(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE,
+   FREAD | FWRITE, -1, -1, 0, 0, kif, sb, remainder);
if (textvp != NULL)
-   export_fd_for_sysctl(textvp, KF_TYPE_VNODE, KF_FD_TYPE_TEXT,
-   FREAD, -1, -1, 0, 0, kif, req);
+   export_fd_to_sb(textvp, KF_TYPE_VNODE, KF_FD_TYPE_TEXT,
+   FREAD, -1, -1, 0, 0, kif, sb, remainder);
if (cttyvp != NULL)
-   export_fd_for_sysctl(cttyvp, KF_TYPE_VNODE, KF_FD_TYPE_CTTY,
-   FREAD | FWRITE, -1, -1, 0, 0, kif, req);
+   export_fd_to_sb(cttyvp, KF_TYPE_VNODE, KF_FD_TYPE_CTTY,
+   FREAD | FWRITE, -1, -1, 0, 0, kif, sb, remainder);
+   error = 0;
if (fdp == NULL)
goto fail;
FILEDESC_SLOCK(fdp);
@@ -3365,8 +3377,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER
vref(fdp-fd_cdir);
data = fdp-fd_cdir;
FILEDESC_SUNLOCK(fdp);
-   export_fd_for_sysctl(data, KF_TYPE_VNODE, 

svn commit: r250377 - head/sbin/growfs

2013-05-08 Thread Eitan Adler
Author: eadler
Date: Wed May  8 18:55:38 2013
New Revision: 250377
URL: http://svnweb.freebsd.org/changeset/base/250377

Log:
  Allow the use of lowercase 'yes'
  
  PR:   bin/178422
  Submitted by: Garrett Cooper yaneurab...@gmail.com

Modified:
  head/sbin/growfs/growfs.c

Modified: head/sbin/growfs/growfs.c
==
--- head/sbin/growfs/growfs.c   Wed May  8 18:39:12 2013(r250376)
+++ head/sbin/growfs/growfs.c   Wed May  8 18:55:38 2013(r250377)
@@ -1544,7 +1544,7 @@ main(int argc, char **argv)
printf( from %s to %s? [Yes/No] , oldsizebuf, newsizebuf);
fflush(stdout);
fgets(reply, (int)sizeof(reply), stdin);
-   if (strcmp(reply, Yes\n)){
+   if (strcasecmp(reply, Yes\n)){
printf(\nNothing done\n);
exit (0);
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250378 - head/lib/libprocstat

2013-05-08 Thread Mikolaj Golub
Author: trociny
Date: Wed May  8 19:11:47 2013
New Revision: 250378
URL: http://svnweb.freebsd.org/changeset/base/250378

Log:
  Make errbuf optional, so if a caller is not interested in an error
  message she can pass NULL (procstat(1) already does this).
  
  MFC after:2 weeks

Modified:
  head/lib/libprocstat/libprocstat.c

Modified: head/lib/libprocstat/libprocstat.c
==
--- head/lib/libprocstat/libprocstat.c  Wed May  8 18:55:38 2013
(r250377)
+++ head/lib/libprocstat/libprocstat.c  Wed May  8 19:11:47 2013
(r250378)
@@ -897,7 +897,8 @@ procstat_get_pipe_info(struct procstat *
return (procstat_get_pipe_info_sysctl(fst, ps, errbuf));
} else {
warnx(unknown access method: %d, procstat-type);
-   snprintf(errbuf, _POSIX2_LINE_MAX, error);
+   if (errbuf != NULL)
+   snprintf(errbuf, _POSIX2_LINE_MAX, error);
return (1);
}
 }
@@ -926,7 +927,8 @@ procstat_get_pipe_info_kvm(kvm_t *kd, st
return (0);
 
 fail:
-   snprintf(errbuf, _POSIX2_LINE_MAX, error);
+   if (errbuf != NULL)
+   snprintf(errbuf, _POSIX2_LINE_MAX, error);
return (1);
 }
 
@@ -962,7 +964,8 @@ procstat_get_pts_info(struct procstat *p
return (procstat_get_pts_info_sysctl(fst, pts, errbuf));
} else {
warnx(unknown access method: %d, procstat-type);
-   snprintf(errbuf, _POSIX2_LINE_MAX, error);
+   if (errbuf != NULL)
+   snprintf(errbuf, _POSIX2_LINE_MAX, error);
return (1);
}
 }
@@ -990,7 +993,8 @@ procstat_get_pts_info_kvm(kvm_t *kd, str
return (0);
 
 fail:
-   snprintf(errbuf, _POSIX2_LINE_MAX, error);
+   if (errbuf != NULL)
+   snprintf(errbuf, _POSIX2_LINE_MAX, error);
return (1);
 }
 
@@ -1025,7 +1029,8 @@ procstat_get_sem_info(struct procstat *p
return (procstat_get_sem_info_sysctl(fst, sem, errbuf));
} else {
warnx(unknown access method: %d, procstat-type);
-   snprintf(errbuf, _POSIX2_LINE_MAX, error);
+   if (errbuf != NULL)
+   snprintf(errbuf, _POSIX2_LINE_MAX, error);
return (1);
}
 }
@@ -1071,7 +1076,8 @@ procstat_get_sem_info_kvm(kvm_t *kd, str
return (0);
 
 fail:
-   snprintf(errbuf, _POSIX2_LINE_MAX, error);
+   if (errbuf != NULL)
+   snprintf(errbuf, _POSIX2_LINE_MAX, error);
return (1);
 }
 
@@ -1106,7 +1112,8 @@ procstat_get_shm_info(struct procstat *p
return (procstat_get_shm_info_sysctl(fst, shm, errbuf));
} else {
warnx(unknown access method: %d, procstat-type);
-   snprintf(errbuf, _POSIX2_LINE_MAX, error);
+   if (errbuf != NULL)
+   snprintf(errbuf, _POSIX2_LINE_MAX, error);
return (1);
}
 }
@@ -1152,7 +1159,8 @@ procstat_get_shm_info_kvm(kvm_t *kd, str
return (0);
 
 fail:
-   snprintf(errbuf, _POSIX2_LINE_MAX, error);
+   if (errbuf != NULL)
+   snprintf(errbuf, _POSIX2_LINE_MAX, error);
return (1);
 }
 
@@ -1187,7 +1195,8 @@ procstat_get_vnode_info(struct procstat 
return (procstat_get_vnode_info_sysctl(fst, vn, errbuf));
} else {
warnx(unknown access method: %d, procstat-type);
-   snprintf(errbuf, _POSIX2_LINE_MAX, error);
+   if (errbuf != NULL)
+   snprintf(errbuf, _POSIX2_LINE_MAX, error);
return (1);
}
 }
@@ -1254,7 +1263,8 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s
break;
}
if (i == NTYPES) {
-   snprintf(errbuf, _POSIX2_LINE_MAX, ?(%s), tagstr);
+   if (errbuf != NULL)
+   snprintf(errbuf, _POSIX2_LINE_MAX, ?(%s), tagstr);
return (1);
}
vn-vn_mntdir = getmnton(kd, vnode.v_mount);
@@ -1268,7 +1278,8 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s
return (0);
 
 fail:
-   snprintf(errbuf, _POSIX2_LINE_MAX, error);
+   if (errbuf != NULL)
+   snprintf(errbuf, _POSIX2_LINE_MAX, error);
return (1);
 }
 
@@ -1349,7 +1360,10 @@ procstat_get_vnode_info_sysctl(struct fi
if (vntype == PS_FST_VTYPE_VNON || vntype == PS_FST_VTYPE_VBAD)
return (0);
if ((status  KF_ATTR_VALID) == 0) {
-   snprintf(errbuf, _POSIX2_LINE_MAX, ? (no info available));
+   if (errbuf != NULL) {
+   snprintf(errbuf, _POSIX2_LINE_MAX,
+   ? (no info available));
+   }
return (1);
}
if (path  *path) {
@@ -1390,7 +1404,8 @@ procstat_get_socket_info(struct procstat

svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast

2013-05-08 Thread Mikolaj Golub
Author: trociny
Date: Wed May  8 20:03:37 2013
New Revision: 250379
URL: http://svnweb.freebsd.org/changeset/base/250379

Log:
  HAST module for bsnmpd(1).
  
  Reviewed by:  harti, pjd
  MFC after:2 weeks

Added:
  head/usr.sbin/bsnmpd/modules/snmp_hast/
  head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt   (contents, 
props changed)
  head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile   (contents, props changed)
  head/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c   (contents, props changed)
  head/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def   (contents, props 
changed)
  head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8   (contents, props changed)
Modified:
  head/usr.sbin/bsnmpd/modules/Makefile

Modified: head/usr.sbin/bsnmpd/modules/Makefile
==
--- head/usr.sbin/bsnmpd/modules/Makefile   Wed May  8 19:11:47 2013
(r250378)
+++ head/usr.sbin/bsnmpd/modules/Makefile   Wed May  8 20:03:37 2013
(r250379)
@@ -10,6 +10,7 @@ _snmp_atm= snmp_atm
 
 SUBDIR=${_snmp_atm} \
snmp_bridge \
+   snmp_hast \
snmp_hostres \
snmp_mibII \
snmp_pf \

Added: head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Wed May  8 
20:03:37 2013(r250379)
@@ -0,0 +1,298 @@
+--
+-- Copyright (c) 2013 Mikolaj Golub troc...@freebsd.org
+-- All rights reserved.
+--
+-- Redistribution and use in source and binary forms, with or without
+-- modification, are permitted provided that the following conditions
+-- are met:
+-- 1. Redistributions of source code must retain the above copyright
+--notice, this list of conditions and the following disclaimer.
+-- 2. Redistributions in binary form must reproduce the above copyright
+--notice, this list of conditions and the following disclaimer in the
+--documentation and/or other materials provided with the distribution.
+--
+-- THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+-- ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+-- SUCH DAMAGE.
+--
+-- $FreeBSD$
+--
+
+BEGEMOT-HAST-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
+Counter64, Integer32
+   FROM SNMPv2-SMI
+TEXTUAL-CONVENTION, RowStatus
+   FROM SNMPv2-TC
+InterfaceIndex, ifIndex
+   FROM IF-MIB
+begemot
+   FROM BEGEMOT-MIB;
+
+begemotHast MODULE-IDENTITY
+LAST-UPDATED 20130413Z
+ORGANIZATION FreeBSD
+CONTACT-INFO
+  Mikolaj Golub
+
+Postal:Bluhera 27v 11
+   61146 Kharkiv
+   Ukraine
+
+Fax:   N/A
+
+E-Mail:troc...@freebsd.org
+DESCRIPTION
+   The Begemot MIB for managing HAST.
+REVISION 20130413Z
+DESCRIPTION
+   Initial revision.
+::= { begemot 220 }
+
+begemotHastObjects OBJECT IDENTIFIER ::= { begemotHast 1 }
+
+-- -- --
+-- Configuration parameters
+-- -- --
+
+hastConfig OBJECT IDENTIFIER ::= { begemotHastObjects 1 }
+
+hastConfigFile OBJECT-TYPE
+SYNTAX OCTET STRING
+MAX-ACCESS read-only
+STATUS current
+DESCRIPTION
+   HAST configuration file location.
+::= { hastConfig 1 }
+
+-- -- --
+-- Resource Table
+-- -- --
+hastResourceTable OBJECT-TYPE
+SYNTAX SEQUENCE OF HastResourceEntry
+MAX-ACCESS not-accessible
+STATUS current
+DESCRIPTION
+   A table containing information about all HAST resources.
+::= { begemotHastObjects 2 }
+
+hastResourceEntry OBJECT-TYPE
+SYNTAX HastResourceEntry
+MAX-ACCESS not-accessible
+STATUS current
+DESCRIPTION
+   Table entry that describes one HAST resource.
+INDEX  { hastResourceIndex }
+::= { hastResourceTable 1 }
+
+HastResourceEntry ::= SEQUENCE {
+hastResourceIndex 

svn commit: r250380 - head/contrib/bsnmp

2013-05-08 Thread Mikolaj Golub
Author: trociny
Date: Wed May  8 20:04:32 2013
New Revision: 250380
URL: http://svnweb.freebsd.org/changeset/base/250380

Log:
  Register OID for HAST module.
  
  MFC after:2 weeks

Modified:
  head/contrib/bsnmp/oid-list

Modified: head/contrib/bsnmp/oid-list
==
--- head/contrib/bsnmp/oid-list Wed May  8 20:03:37 2013(r250379)
+++ head/contrib/bsnmp/oid-list Wed May  8 20:04:32 2013(r250380)
@@ -24,6 +24,7 @@ enterprises
   204  pingDatabsnmp-ping (Nate Nielsen 
niel...@memberwebs.com)
   205  begemotBridge   bridge module
   210  begemotWlan WLAN module
+  220  begemotHast HAST module
 
   300  BEGEMOT-ACM DLR ACM project
   303  BEGEMOT-WLINK   DLR WLINK simulator
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250381 - head/sys/dev/etherswitch

2013-05-08 Thread Adrian Chadd
Author: adrian
Date: Wed May  8 20:46:54 2013
New Revision: 250381
URL: http://svnweb.freebsd.org/changeset/base/250381

Log:
  Add the ability to change the vlan operation mode.
  
  This adds a vlan capability field to etherswitch_info structure and some
  definitions of ports flags.
  
  It adds the support to global config parameters which right now is used
  only to switch between the vlan modes, but it is intended to be extended
  to support the setup of others parameters (STP, mirror, etc.).
  
  Submitted by: Luiz Otavio O Souza loos...@gmail.com
  Reviewed by:  ray

Modified:
  head/sys/dev/etherswitch/etherswitch.c
  head/sys/dev/etherswitch/etherswitch.h
  head/sys/dev/etherswitch/etherswitch_if.m

Modified: head/sys/dev/etherswitch/etherswitch.c
==
--- head/sys/dev/etherswitch/etherswitch.c  Wed May  8 20:04:32 2013
(r250380)
+++ head/sys/dev/etherswitch/etherswitch.c  Wed May  8 20:46:54 2013
(r250381)
@@ -200,6 +200,7 @@ etherswitchioctl(struct cdev *cdev, u_lo
struct etherswitch_softc *sc = cdev-si_drv1;
device_t dev = sc-sc_dev;
device_t etherswitch = device_get_parent(dev);
+   etherswitch_conf_t conf;
etherswitch_info_t *info;
etherswitch_reg_t *reg;
etherswitch_phyreg_t *phyreg;
@@ -251,6 +252,16 @@ etherswitchioctl(struct cdev *cdev, u_lo
error = ETHERSWITCH_WRITEPHYREG(etherswitch, phyreg-phy, 
phyreg-reg, phyreg-val);
break;
 
+   case IOETHERSWITCHGETCONF:
+   bzero(conf, sizeof(etherswitch_conf_t));
+   error = ETHERSWITCH_GETCONF(etherswitch, conf);
+   bcopy(conf, data, sizeof(etherswitch_conf_t));
+   break;
+
+   case IOETHERSWITCHSETCONF:
+   error = ETHERSWITCH_SETCONF(etherswitch, (etherswitch_conf_t 
*)data);
+   break;
+
default:
error = ENOTTY;
}

Modified: head/sys/dev/etherswitch/etherswitch.h
==
--- head/sys/dev/etherswitch/etherswitch.h  Wed May  8 20:04:32 2013
(r250380)
+++ head/sys/dev/etherswitch/etherswitch.h  Wed May  8 20:46:54 2013
(r250381)
@@ -25,18 +25,47 @@ struct etherswitch_phyreg {
 };
 typedef struct etherswitch_phyreg etherswitch_phyreg_t;
 
-#define ETHERSWITCH_NAMEMAX64
+#defineETHERSWITCH_NAMEMAX 64
+#defineETHERSWITCH_VLAN_ISL(1  0)/* ISL */
+#defineETHERSWITCH_VLAN_PORT   (1  1)/* Port based 
vlan */
+#defineETHERSWITCH_VLAN_DOT1Q  (1  2)/* 802.1q */
+#defineETHERSWITCH_VLAN_DOT1Q_4K   (1  3)/* 4k support 
on 802.1q */
+#defineETHERSWITCH_VLAN_DOUBLE_TAG (1  4)/* Q-in-Q */
+#defineETHERSWITCH_VLAN_CAPS_BITS  \
+\020\1ISL\2PORT\3DOT1Q\4DOT1Q4K\5QinQ
 
 struct etherswitch_info {
int es_nports;
int es_nvlangroups;
chares_name[ETHERSWITCH_NAMEMAX];
+   uint32_tes_vlan_caps;
 };
 typedef struct etherswitch_info etherswitch_info_t;
 
+#defineETHERSWITCH_CONF_FLAGS  (1  0)
+#defineETHERSWITCH_CONF_MIRROR (1  1)
+#defineETHERSWITCH_CONF_VLAN_MODE  (1  2)
+
+struct etherswitch_conf {
+   uint32_tcmd;/* What to configure */
+   uint32_tvlan_mode;  /* Switch VLAN mode */
+};
+typedef struct etherswitch_conf etherswitch_conf_t;
+
+#defineETHERSWITCH_PORT_CPU(1  0)
+#defineETHERSWITCH_PORT_STRIPTAG   (1  1)
+#defineETHERSWITCH_PORT_ADDTAG (1  2)
+#defineETHERSWITCH_PORT_FIRSTLOCK  (1  3)
+#defineETHERSWITCH_PORT_DROPUNTAGGED   (1  4)
+#defineETHERSWITCH_PORT_DOUBLE_TAG (1  5)
+#defineETHERSWITCH_PORT_INGRESS(1  6)
+#defineETHERSWITCH_PORT_FLAGS_BITS \
+\020\1CPUPORT\2STRIPTAG\3ADDTAG\4FIRSTLOCK\5DROPUNTAGGED\6QinQ\7INGRESS
+
 struct etherswitch_port {
int es_port;
int es_pvid;
+   uint32_tes_flags;
union {
struct ifreqes_uifr;
struct ifmediareq   es_uifmr;
@@ -66,5 +95,7 @@ typedef struct etherswitch_vlangroup eth
 #define IOETHERSWITCHSETVLANGROUP  _IOW('i', 7, etherswitch_vlangroup_t)
 #define IOETHERSWITCHGETPHYREG _IOWR('i', 8, etherswitch_phyreg_t)
 #define IOETHERSWITCHSETPHYREG _IOW('i', 9, etherswitch_phyreg_t)
+#define IOETHERSWITCHGETCONF   _IOR('i', 10, etherswitch_conf_t)
+#define IOETHERSWITCHSETCONF   _IOW('i', 11, etherswitch_conf_t)
 
 #endif

Modified: head/sys/dev/etherswitch/etherswitch_if.m
==
--- 

svn commit: r250382 - head/sbin/etherswitchcfg

2013-05-08 Thread Adrian Chadd
Author: adrian
Date: Wed May  8 20:52:22 2013
New Revision: 250382
URL: http://svnweb.freebsd.org/changeset/base/250382

Log:
  Add vlan configuration support to etherswitchcfg.
  
  This adds the support to the config keyword (vlan operation mode), ports
  flags, prints the vlan mode and vlan capabilities. It also adds some basic
  information to usage() and support the keyword 'help' as a shortcut to
  usage(). The manual page is also updated with the new options.
  
  Submitted by: Luiz Otavio O Souza loos...@gmail.com
  Reviewed by:  ray

Modified:
  head/sbin/etherswitchcfg/etherswitchcfg.8
  head/sbin/etherswitchcfg/etherswitchcfg.c

Modified: head/sbin/etherswitchcfg/etherswitchcfg.8
==
--- head/sbin/etherswitchcfg/etherswitchcfg.8   Wed May  8 20:46:54 2013
(r250381)
+++ head/sbin/etherswitchcfg/etherswitchcfg.8   Wed May  8 20:52:22 2013
(r250382)
@@ -11,12 +11,16 @@
 .Ar info
 .Nm
 .Op Fl f control file
+.Ar config
+.Ar command parameter
+.Nm
+.Op Fl f control file
 .Ar phy
 .Ar phy.register[=value]
 .Nm
 .Op Fl f control file
 .Ar port%d
-.Ar command parameter
+.Ar [flags] command parameter
 .Nm
 .Op Fl f control file
 .Ar reg
@@ -46,6 +50,14 @@ Produce more verbose output.
 Without this flag, lines that represent inactive or empty configuration
 options are omitted.
 .El
+.Ss config
+The config command provides access to global switch configuration
+parameters.
+It support the following commands:
+.Bl -tag -width .Ar vlan_mode mode -compact
+.It Ar vlan_mode mode
+Sets the switch VLAN mode (depends on the hardware).
+.El
 .Ss phy
 The phy command provides access to the registers of the PHYs attached
 to or integrated into the switch controller.
@@ -75,6 +87,37 @@ for details on
 and
 .Ar mediaopt .
 .El
+And the following flags (please note that not all flags
+are supporterd by all switch drivers):
+.Bl -tag -width .Ar addtag -compact
+.It Ar addtag
+Add VLAN tag to each packet sent by the port.
+.It Ar -addtag
+Disable the add VLAN tag option.
+.It Ar striptag
+Strip the VLAN tags from the packets sent by the port.
+.It Ar -striptag
+Disable the strip VLAN tag option.
+.It Ar firstlock
+This options makes the switch port lock on the first MAC address it seems.
+After that, usually you need to reset the switch to learn different
+MAC addresses.
+.It Ar -firstlock
+Disable the first lock option.  Note that sometimes you need to reset the
+switch to really disable this option.
+.It Ar dropuntagged
+Drop packets without a VLAN tag.
+.It Ar -dropuntagged
+Disable the drop untagged packets option.
+.It Ar doubletag
+Enable QinQ for the port.
+.It Ar -doubletag
+Disable QinQ for the port.
+.It Ar ingress
+Enable the ingress filter on the port.
+.It Ar -ingress
+Disable the ingress filter.
+.El
 .Ss reg
 The reg command provides access to the registers of the switch controller.
 .Ss vlangroup

Modified: head/sbin/etherswitchcfg/etherswitchcfg.c
==
--- head/sbin/etherswitchcfg/etherswitchcfg.c   Wed May  8 20:46:54 2013
(r250381)
+++ head/sbin/etherswitchcfg/etherswitchcfg.c   Wed May  8 20:52:22 2013
(r250382)
@@ -58,6 +58,7 @@ voidprint_media_word_ifconfig(int);
 enum cmdmode {
MODE_NONE = 0,
MODE_PORT,
+   MODE_CONFIG,
MODE_VLANGROUP,
MODE_REGISTER,
MODE_PHYREG
@@ -68,6 +69,7 @@ struct cfg {
int verbose;
int mediatypes;
const char  *controlfile;
+   etherswitch_conf_t  conf;
etherswitch_info_t  info;
enum cmdmodemode;
int unit;
@@ -82,7 +84,37 @@ struct cmds {
 static struct cmds cmds[];
 
 
-static void usage(void);
+/*
+ * Print a value a la the %b format of the kernel's printf.
+ * Stolen from ifconfig.c.
+ */
+static void
+printb(const char *s, unsigned v, const char *bits)
+{
+   int i, any = 0;
+   char c;
+
+   if (bits  *bits == 8)
+   printf(%s=%o, s, v);
+   else
+   printf(%s=%x, s, v);
+   bits++;
+   if (bits) {
+   putchar('');
+   while ((i = *bits++) != '\0') {
+   if (v  (1  (i-1))) {
+   if (any)
+   putchar(',');
+   any = 1;
+   for (; (c = *bits)  32; bits++)
+   putchar(c);
+   } else
+   for (; *bits  32; bits++)
+   ;
+   }
+   putchar('');
+   }
+}
 
 static int
 read_register(struct cfg *cfg, int r)
@@ -150,6 +182,47 @@ set_port_vid(struct cfg *cfg, char *argv
 }
 
 static void

Re: svn commit: r250339 - head/sys/x86/acpica

2013-05-08 Thread John Baldwin
On Wednesday, May 08, 2013 2:21:12 pm Attilio Rao wrote:
 On Wed, May 8, 2013 at 6:01 PM, John Baldwin j...@freebsd.org wrote:
  On Tuesday, May 07, 2013 6:49:57 pm Attilio Rao wrote:
  Author: attilio
  Date: Tue May  7 22:49:56 2013
  New Revision: 250339
  URL: http://svnweb.freebsd.org/changeset/base/250339
 
  Log:
Add functions to do ACPI System Locality Information Table parsing
and printing at boot.
For reference on table informations and purposes please review ACPI 
  specs.
 
Sponsored by:   EMC / Isilon storage division
Obtained from:  jeff
Reviewed by:jhb (earlier version)
 
  Eh, I don't recall reviewing this.  However, acpidump already dumps this
  table, and we should dump tables via acpidump, not in dmesg.
 
 Now that I read better this patch is based upon a patch you submitted
 originally (see the private thread NUMA WIP).
 We already print some useful ACPI table information at boot really
 (APIC ACPI table case) and this is only printed out when having
 MAXMEMDOM  1. Finally I have also sent you this patch and you didn't
 object.

Humm, that was in an old thread, and I never responded to say ok to
this.

However, the patch I posted in that thread is the patch to dump the SLIT
in acpidump and it was comitted back in r241198.  That is the place to dump
these tables, not in dmesg.  We do not dump the raw contents of any other
ACPI tables in dmesg, and have actively moved other tables out to userland
(e.g. $PIR is dumped via a userland tool only).
 
 However if you really dislike it I can print under bootverbose maybe?

No, it does not belong in dmesg at all.  Code to use its contents and honor
it when setting the domain lists would be fine :), but printing it when you
can more easily get it via acpidump -t is just clutter.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250383 - head/sys/dev/etherswitch/arswitch

2013-05-08 Thread Adrian Chadd
Author: adrian
Date: Wed May  8 20:54:59 2013
New Revision: 250383
URL: http://svnweb.freebsd.org/changeset/base/250383

Log:
  Correctly mark the CPU port.
  
  Submitted by: Luiz Otavio O Souza loos...@gmail.com
  Reviewed by:  ray

Modified:
  head/sys/dev/etherswitch/arswitch/arswitch.c

Modified: head/sys/dev/etherswitch/arswitch/arswitch.c
==
--- head/sys/dev/etherswitch/arswitch/arswitch.cWed May  8 20:52:22 
2013(r250382)
+++ head/sys/dev/etherswitch/arswitch/arswitch.cWed May  8 20:54:59 
2013(r250383)
@@ -440,6 +440,7 @@ arswitch_getport(device_t dev, etherswit
mii = arswitch_miiforport(sc, p-es_port);
if (p-es_port == 0) {
/* fill in fixed values for CPU port */
+   p-es_flags |= ETHERSWITCH_PORT_CPU;
ifmr-ifm_count = 0;
ifmr-ifm_current = ifmr-ifm_active =
IFM_ETHER | IFM_1000_T | IFM_FDX;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250384 - head/sys/dev/etherswitch/ukswitch

2013-05-08 Thread Adrian Chadd
Author: adrian
Date: Wed May  8 20:56:43 2013
New Revision: 250384
URL: http://svnweb.freebsd.org/changeset/base/250384

Log:
  Fix the ukswitch code to work with the new vlan changes:
  
  * Fix API changes;
  * remove unused code;
  * Allow some switches to be used that don't expose a set of PHY
registers for the CPU facing port (eg the ADM6996 for the Ubiquiti
Routerstation.)
  
  Submitted by: Luiz Otavio O Souza loos...@gmail.com
  Reviewed by:  ray

Modified:
  head/sys/dev/etherswitch/ukswitch/ukswitch.c

Modified: head/sys/dev/etherswitch/ukswitch/ukswitch.c
==
--- head/sys/dev/etherswitch/ukswitch/ukswitch.cWed May  8 20:54:59 
2013(r250383)
+++ head/sys/dev/etherswitch/ukswitch/ukswitch.cWed May  8 20:56:43 
2013(r250384)
@@ -120,8 +120,6 @@ ukswitch_attach_phys(struct ukswitch_sof
continue;
sc-ifpport[phy] = port;
sc-portphy[port] = phy;
-// if (phy == sc-cpuport)
-// sc-info.es_cpuport = port;
sc-ifp[port] = if_alloc(IFT_ETHER);
sc-ifp[port]-if_softc = sc;
sc-ifp[port]-if_flags |= IFF_UP | IFF_BROADCAST |
@@ -166,7 +164,7 @@ ukswitch_attach(device_t dev)
/* XXX Defaults */
sc-numports = 6;
sc-phymask = 0x0f;
-   sc-cpuport = 5;
+   sc-cpuport = -1;
sc-media = 100;
 
(void) resource_int_value(device_get_name(dev), device_get_unit(dev),
@@ -182,9 +180,9 @@ ukswitch_attach(device_t dev)
if (sc-media != 100  sc-media != 1000)
sc-media = 100;
 
-   /* Always attach the cpu port. */
-   sc-phymask |= (1  sc-cpuport);
-// sc-info.es_cpuport = sc-cpuport;
+   if (sc-cpuport != -1)
+   /* Always attach the cpu port. */
+   sc-phymask |= (1  sc-cpuport);
 
/* We do not support any vlan groups. */
sc-info.es_nvlangroups = 0;
@@ -347,15 +345,17 @@ ukswitch_getport(device_t dev, etherswit
struct ukswitch_softc *sc = device_get_softc(dev);
struct mii_data *mii;
struct ifmediareq *ifmr = p-es_ifmr;
-   int err;
+   int err, phy;
 
if (p-es_port  0 || p-es_port = sc-numports)
return (ENXIO);
-   p-es_vlangroup = 0;
+   p-es_pvid = 0;
 
+   phy = sc-portphy[p-es_port];
mii = ukswitch_miiforport(sc, p-es_port);
-   if (sc-portphy[p-es_port] == sc-cpuport) {
+   if (sc-cpuport != -1  phy == sc-cpuport) {
/* fill in fixed values for CPU port */
+   p-es_flags |= ETHERSWITCH_PORT_CPU;
ifmr-ifm_count = 0;
if (sc-media == 100)
ifmr-ifm_current = ifmr-ifm_active =
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250385 - head/sys/mips/conf

2013-05-08 Thread Adrian Chadd
Author: adrian
Date: Wed May  8 20:57:37 2013
New Revision: 250385
URL: http://svnweb.freebsd.org/changeset/base/250385

Log:
  Modify the routerstation config to use ukswitch for now.
  
  Until an ADM6996 driver shows up, this allows for the two switch
  ports to be used.
  
  Submitted by: Luiz Otavio O Souza loos...@gmail.com
  Reviewed by:  ray

Modified:
  head/sys/mips/conf/ROUTERSTATION
  head/sys/mips/conf/ROUTERSTATION.hints

Modified: head/sys/mips/conf/ROUTERSTATION
==
--- head/sys/mips/conf/ROUTERSTATIONWed May  8 20:56:43 2013
(r250384)
+++ head/sys/mips/conf/ROUTERSTATIONWed May  8 20:57:37 2013
(r250385)
@@ -18,5 +18,11 @@ options  GEOM_UZIP
 # For DOS
 optionsMSDOSFS
 
+# Etherswitch support
+optionsARGE_MDIO
+device miiproxy
+device etherswitch
+device ukswitch
+
 # Boot path - redboot MFS
 optionsROOTDEVNAME=\ufs:redboot/rootfs.uzip\

Modified: head/sys/mips/conf/ROUTERSTATION.hints
==
--- head/sys/mips/conf/ROUTERSTATION.hints  Wed May  8 20:56:43 2013
(r250384)
+++ head/sys/mips/conf/ROUTERSTATION.hints  Wed May  8 20:57:37 2013
(r250385)
@@ -5,12 +5,17 @@
 # Uncomment this hint for RS (not PRO)
 # PHY20 = 1  20
 hint.arge.0.phymask=0x10
+hint.arge.0.mdio=mdioproxy1# .. off of the switch mdiobus
 
 # should be 100 for RS 
 hint.arge.1.media=100
 hint.arge.1.fduplex=1
-# Uncomment this hint for RS (not PRO)
-hint.arge.1.phymask=0x3
+hint.arge.1.phymask=0x0
+hint.arge.1.mdio=mdioproxy1# .. off of the switch mdiobus
+
+# ukswitch
+hint.ukswitch.0.at=mdio0
+hint.ukswitch.0.phymask=0x3
 
 # RF led
 hint.gpioled.0.at=gpiobus0
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250386 - in head/sys: conf dev/etherswitch/ip17x

2013-05-08 Thread Adrian Chadd
Author: adrian
Date: Wed May  8 20:58:41 2013
New Revision: 250386
URL: http://svnweb.freebsd.org/changeset/base/250386

Log:
  Bring in a basic ethernet switch driver for the IP17x series of
  switches.
  
  These are notably found on some AR71xx based Mikrotik boards.
  
  Submitted by: Luiz Otavio O Souza loos...@gmail.com
  Reviewed by:  ray

Added:
  head/sys/dev/etherswitch/ip17x/
  head/sys/dev/etherswitch/ip17x/ip175c.c   (contents, props changed)
  head/sys/dev/etherswitch/ip17x/ip175c.h   (contents, props changed)
  head/sys/dev/etherswitch/ip17x/ip175d.c   (contents, props changed)
  head/sys/dev/etherswitch/ip17x/ip175d.h   (contents, props changed)
  head/sys/dev/etherswitch/ip17x/ip17x.c   (contents, props changed)
  head/sys/dev/etherswitch/ip17x/ip17x_phy.c   (contents, props changed)
  head/sys/dev/etherswitch/ip17x/ip17x_phy.h   (contents, props changed)
  head/sys/dev/etherswitch/ip17x/ip17x_reg.h   (contents, props changed)
  head/sys/dev/etherswitch/ip17x/ip17x_var.h   (contents, props changed)
  head/sys/dev/etherswitch/ip17x/ip17x_vlans.c   (contents, props changed)
  head/sys/dev/etherswitch/ip17x/ip17x_vlans.h   (contents, props changed)
Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed May  8 20:57:37 2013(r250385)
+++ head/sys/conf/files Wed May  8 20:58:41 2013(r250386)
@@ -1331,6 +1331,11 @@ dev/etherswitch/arswitch/arswitch_8316.c
 dev/etherswitch/arswitch/arswitch_7240.c   optional arswitch
 dev/etherswitch/etherswitch.c  optional etherswitch
 dev/etherswitch/etherswitch_if.m   optional etherswitch
+dev/etherswitch/ip17x/ip17x.c  optional ip17x
+dev/etherswitch/ip17x/ip175c.c optional ip17x
+dev/etherswitch/ip17x/ip175d.c optional ip17x
+dev/etherswitch/ip17x/ip17x_phy.c  optional ip17x
+dev/etherswitch/ip17x/ip17x_vlans.coptional ip17x
 dev/etherswitch/mdio_if.m  optional miiproxy
 dev/etherswitch/mdio.c optional miiproxy
 dev/etherswitch/miiproxy.c optional miiproxy

Added: head/sys/dev/etherswitch/ip17x/ip175c.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/etherswitch/ip17x/ip175c.c Wed May  8 20:58:41 2013
(r250386)
@@ -0,0 +1,249 @@
+/*-
+ * Copyright (c) 2013 Luiz Otavio O Souza.
+ * Copyright (c) 2011-2012 Stefan Bethke.
+ * Copyright (c) 2012 Adrian Chadd.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include sys/param.h
+#include sys/bus.h
+#include sys/kernel.h
+#include sys/lock.h
+#include sys/mutex.h
+#include sys/systm.h
+#include sys/socket.h
+
+#include net/if.h
+
+#include dev/mii/mii.h
+
+#include dev/etherswitch/etherswitch.h
+#include dev/etherswitch/ip17x/ip17x_phy.h
+#include dev/etherswitch/ip17x/ip17x_reg.h
+#include dev/etherswitch/ip17x/ip17x_var.h
+#include dev/etherswitch/ip17x/ip17x_vlans.h
+#include dev/etherswitch/ip17x/ip175c.h
+
+/*
+ * IP175C specific functions.
+ */
+
+/*
+ * Reset the switch.
+ */
+static int
+ip175c_reset(struct ip17x_softc *sc)
+{
+   uint32_t data;
+
+   /* Reset all the switch settings. */
+   if (ip17x_writephy(sc-sc_dev, IP175C_RESET_PHY, IP175C_RESET_REG,
+   0x175c))
+   return (-1);
+   DELAY(2);
+
+   /* Force IP175C mode. */
+   data = ip17x_readphy(sc-sc_dev, IP175C_MODE_PHY, IP175C_MODE_REG);
+   if (data == 0x175a) {
+   if (ip17x_writephy(sc-sc_dev, IP175C_MODE_PHY, IP175C_MODE_REG,
+   0x175c))

svn commit: r250387 - head/sbin/etherswitchcfg

2013-05-08 Thread Joel Dahl
Author: joel (doc committer)
Date: Wed May  8 21:02:48 2013
New Revision: 250387
URL: http://svnweb.freebsd.org/changeset/base/250387

Log:
  mdoc: new sentence, new line.

Modified:
  head/sbin/etherswitchcfg/etherswitchcfg.8

Modified: head/sbin/etherswitchcfg/etherswitchcfg.8
==
--- head/sbin/etherswitchcfg/etherswitchcfg.8   Wed May  8 20:58:41 2013
(r250386)
+++ head/sbin/etherswitchcfg/etherswitchcfg.8   Wed May  8 21:02:48 2013
(r250387)
@@ -80,7 +80,8 @@ Sets the default port VID that is used t
 .It Ar media mediaspec
 Specifies the physical media configuration to be configured for a port.
 .It Ar mediaopt mediaoption
-Specifies a list of media options for a port. See
+Specifies a list of media options for a port.
+See
 .Xr ifconfig 8
 for details on
 .Ar media
@@ -103,7 +104,8 @@ This options makes the switch port lock 
 After that, usually you need to reset the switch to learn different
 MAC addresses.
 .It Ar -firstlock
-Disable the first lock option.  Note that sometimes you need to reset the
+Disable the first lock option.
+Note that sometimes you need to reset the
 switch to really disable this option.
 .It Ar dropuntagged
 Drop packets without a VLAN tag.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250388 - head/sbin/ping6

2013-05-08 Thread Joel Dahl
Author: joel (doc committer)
Date: Wed May  8 21:04:19 2013
New Revision: 250388
URL: http://svnweb.freebsd.org/changeset/base/250388

Log:
  Remove EOL whitespace.

Modified:
  head/sbin/ping6/ping6.8

Modified: head/sbin/ping6/ping6.8
==
--- head/sbin/ping6/ping6.8 Wed May  8 21:02:48 2013(r250387)
+++ head/sbin/ping6/ping6.8 Wed May  8 21:04:19 2013(r250388)
@@ -234,7 +234,7 @@ is used instead.
 The former is in RFC 4620, the latter is in an old Internet Draft
 draft-ietf-ipngwg-icmp-name-lookup.
 Note that KAME-derived implementations including
-.Fx 
+.Fx
 use the latter.
 .It Fl o
 Exit successfully after receiving one reply packet.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2013-05-08 Thread Joel Dahl
Author: joel (doc committer)
Date: Wed May  8 21:07:11 2013
New Revision: 250390
URL: http://svnweb.freebsd.org/changeset/base/250390

Log:
  Minor improvements.

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

Modified: head/share/man/man4/acpi_rapidstart.4
==
--- head/share/man/man4/acpi_rapidstart.4   Wed May  8 21:06:47 2013
(r250389)
+++ head/share/man/man4/acpi_rapidstart.4   Wed May  8 21:07:11 2013
(r250390)
@@ -48,11 +48,13 @@ acpi_rapidstart_load=YES
 The
 .Nm
 driver provides support for Intel Rapid Start technology ACPI device interface.
-Note that this is only for ACPI device interface . This has _CID PNP0C02 so
-should be loaded in boot time to avoid attaching acpi_sysresource driver.
-
+Note that this is only for the ACPI device interface.
+This has _CID PNP0C02 so it should be loaded at boot time to avoid attaching
+to the acpi_sysresource driver.
 .Sh SYSCTLS
-The following sysctl nodes are currently implemented:
+The following
+.Xr sysctl 8
+nodes are currently implemented:
 .Bl -tag -width indent
 .It Va dev.acpi_rapidstart.0.ffs
 Rapid start flag.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r250339 - head/sys/x86/acpica

2013-05-08 Thread Attilio Rao
On Wed, May 8, 2013 at 10:53 PM, John Baldwin j...@freebsd.org wrote:
 On Wednesday, May 08, 2013 2:21:12 pm Attilio Rao wrote:
 On Wed, May 8, 2013 at 6:01 PM, John Baldwin j...@freebsd.org wrote:
  On Tuesday, May 07, 2013 6:49:57 pm Attilio Rao wrote:
  Author: attilio
  Date: Tue May  7 22:49:56 2013
  New Revision: 250339
  URL: http://svnweb.freebsd.org/changeset/base/250339
 
  Log:
Add functions to do ACPI System Locality Information Table parsing
and printing at boot.
For reference on table informations and purposes please review ACPI 
  specs.
 
Sponsored by:   EMC / Isilon storage division
Obtained from:  jeff
Reviewed by:jhb (earlier version)
 
  Eh, I don't recall reviewing this.  However, acpidump already dumps this
  table, and we should dump tables via acpidump, not in dmesg.

 Now that I read better this patch is based upon a patch you submitted
 originally (see the private thread NUMA WIP).
 We already print some useful ACPI table information at boot really
 (APIC ACPI table case) and this is only printed out when having
 MAXMEMDOM  1. Finally I have also sent you this patch and you didn't
 object.

 Humm, that was in an old thread, and I never responded to say ok to
 this.

 However, the patch I posted in that thread is the patch to dump the SLIT
 in acpidump and it was comitted back in r241198.  That is the place to dump
 these tables, not in dmesg.  We do not dump the raw contents of any other
 ACPI tables in dmesg, and have actively moved other tables out to userland
 (e.g. $PIR is dumped via a userland tool only).

 However if you really dislike it I can print under bootverbose maybe?

 No, it does not belong in dmesg at all.  Code to use its contents and honor
 it when setting the domain lists would be fine :), but printing it when you
 can more easily get it via acpidump -t is just clutter.

Reverted in r 250389.

Attilio


--
Peace can only be achieved by understanding - A. Einstein
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250391 - head/sys/dev/ath

2013-05-08 Thread Adrian Chadd
Author: adrian
Date: Wed May  8 21:23:51 2013
New Revision: 250391
URL: http://svnweb.freebsd.org/changeset/base/250391

Log:
  Fix the holding descriptor logic to actually be right (for values
  of right.)
  
  Flip back on the always continue TX DMA using the holding descriptor
  code - by always setting ATH_BUF_BUSY and never setting axq_link to NULL.
  
  Since the holding descriptor is accessed via txq-axq_link and _that_
  is done behind the TXQ lock rather than the TX path lock, the holding
  descriptor stuff itself needs to be behind the TXQ lock.
  
  So, do the mental gymnastics needed to do this.
  
  I've not seen any of the hardware failures that I was seeing when
  I last tried to do this.
  
  Tested:
  
  * AR5416, STA mode

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   Wed May  8 21:07:11 2013(r250390)
+++ head/sys/dev/ath/if_ath.c   Wed May  8 21:23:51 2013(r250391)
@@ -3896,6 +3896,7 @@ ath_tx_process_buf_completion(struct ath
struct ath_node *an = NULL;
 
ATH_TX_UNLOCK_ASSERT(sc);
+   ATH_TXQ_UNLOCK_ASSERT(txq);
 
/* If unicast frame, update general statistics */
if (ni != NULL) {
@@ -4000,6 +4001,28 @@ ath_tx_processq(struct ath_softc *sc, st
break;
}
ATH_TXQ_REMOVE(txq, bf, bf_list);
+
+   /*
+* Sanity check.
+*/
+   if (txq-axq_qnum != bf-bf_state.bfs_tx_queue) {
+   device_printf(sc-sc_dev,
+   %s: TXQ=%d: bf=%p, bfs_tx_queue=%d\n,
+   __func__,
+   txq-axq_qnum,
+   bf,
+   bf-bf_state.bfs_tx_queue);
+   }
+   if (txq-axq_qnum != bf-bf_last-bf_state.bfs_tx_queue) {
+   device_printf(sc-sc_dev,
+   %s: TXQ=%d: bf_last=%p, bfs_tx_queue=%d\n,
+   __func__,
+   txq-axq_qnum,
+   bf-bf_last,
+   bf-bf_last-bf_state.bfs_tx_queue);
+   }
+
+#if 0
if (txq-axq_depth  0) {
/*
 * More frames follow.  Mark the buffer busy
@@ -4013,6 +4036,9 @@ ath_tx_processq(struct ath_softc *sc, st
bf-bf_last-bf_flags |= ATH_BUF_BUSY;
} else
txq-axq_link = NULL;
+#else
+   bf-bf_last-bf_flags |= ATH_BUF_BUSY;
+#endif
if (bf-bf_state.bfs_aggr)
txq-axq_aggr_depth--;
 
@@ -4288,13 +4314,18 @@ ath_returnbuf_head(struct ath_softc *sc,
 void
 ath_txq_freeholdingbuf(struct ath_softc *sc, struct ath_txq *txq)
 {
-   ATH_TXBUF_LOCK_ASSERT(sc);
+   ATH_TXBUF_UNLOCK_ASSERT(sc);
+   ATH_TXQ_LOCK_ASSERT(txq);
 
if (txq-axq_holdingbf == NULL)
return;
 
txq-axq_holdingbf-bf_flags = ~ATH_BUF_BUSY;
+
+   ATH_TXBUF_LOCK(sc);
ath_returnbuf_tail(sc, txq-axq_holdingbf);
+   ATH_TXBUF_UNLOCK(sc);
+
txq-axq_holdingbf = NULL;
 }
 
@@ -4307,7 +4338,10 @@ ath_txq_addholdingbuf(struct ath_softc *
 {
struct ath_txq *txq;
 
-   ATH_TXBUF_LOCK_ASSERT(sc);
+   txq = sc-sc_txq[bf-bf_state.bfs_tx_queue];
+
+   ATH_TXBUF_UNLOCK_ASSERT(sc);
+   ATH_TXQ_LOCK_ASSERT(txq);
 
/* XXX assert ATH_BUF_BUSY is set */
 
@@ -4321,7 +4355,6 @@ ath_txq_addholdingbuf(struct ath_softc *
ath_returnbuf_tail(sc, bf);
return;
}
-   txq = sc-sc_txq[bf-bf_state.bfs_tx_queue];
ath_txq_freeholdingbuf(sc, txq);
txq-axq_holdingbf = bf;
 }
@@ -4336,20 +4369,30 @@ ath_txq_addholdingbuf(struct ath_softc *
  * for restart (eg for TDMA.)
  *
  * The caller must free the mbuf and recycle the node reference.
+ *
+ * XXX This method of handling busy / holding buffers is insanely stupid.
+ * It requires bf_state.bfs_tx_queue to be correctly assigned.  It would
+ * be much nicer if buffers in the processq() methods would instead be
+ * always completed there (pushed onto a txq or ath_bufhead) so we knew
+ * exactly what hardware queue they came from in the first place.
  */
 void
 ath_freebuf(struct ath_softc *sc, struct ath_buf *bf)
 {
+   struct ath_txq *txq;
+
+   txq = sc-sc_txq[bf-bf_state.bfs_tx_queue];
+
KASSERT((bf-bf_node == NULL), (%s: bf-bf_node != NULL\n, __func__));
KASSERT((bf-bf_m == NULL), (%s: bf-bf_m != NULL\n, __func__));
 
/*
-* If this buffer is busy, push it onto the holding queue
+* If this buffer is busy, push it onto the holding queue.
 */
if (bf-bf_flags  ATH_BUF_BUSY) {
-   ATH_TXBUF_LOCK(sc);
+ 

svn commit: r250392 - head/contrib/gcc/config/i386

2013-05-08 Thread Dimitry Andric
Author: dim
Date: Wed May  8 22:50:36 2013
New Revision: 250392
URL: http://svnweb.freebsd.org/changeset/base/250392

Log:
  For some reason, the gcc intrinsics header tmmintrin.h was imported with
  two copies of itself pasted together.  Remove the extraneous copy.
  
  MFC after:3 days

Modified:
  head/contrib/gcc/config/i386/tmmintrin.h

Modified: head/contrib/gcc/config/i386/tmmintrin.h
==
--- head/contrib/gcc/config/i386/tmmintrin.hWed May  8 21:23:51 2013
(r250391)
+++ head/contrib/gcc/config/i386/tmmintrin.hWed May  8 22:50:36 2013
(r250392)
@@ -222,227 +222,3 @@ _mm_abs_pi32 (__m64 __X)
 #endif /* __SSSE3__ */
 
 #endif /* _TMMINTRIN_H_INCLUDED */
-/* Copyright (C) 2006 Free Software Foundation, Inc.
-
-   This file is part of GCC.
-
-   GCC is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   GCC is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with GCC; see the file COPYING.  If not, write to
-   the Free Software Foundation, 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* As a special exception, if you include this header file into source
-   files compiled by GCC, this header file does not by itself cause
-   the resulting executable to be covered by the GNU General Public
-   License.  This exception does not however invalidate any other
-   reasons why the executable file might be covered by the GNU General
-   Public License.  */
-
-/* Implemented from the specification included in the Intel C++ Compiler
-   User Guide and Reference, version 9.1.  */
-
-#ifndef _TMMINTRIN_H_INCLUDED
-#define _TMMINTRIN_H_INCLUDED
-
-#ifdef __SSSE3__
-#include pmmintrin.h
-
-static __inline __m128i __attribute__((__always_inline__))
-_mm_hadd_epi16 (__m128i __X, __m128i __Y)
-{
-  return (__m128i) __builtin_ia32_phaddw128 ((__v8hi)__X, (__v8hi)__Y);
-}
-
-static __inline __m128i __attribute__((__always_inline__))
-_mm_hadd_epi32 (__m128i __X, __m128i __Y)
-{
-  return (__m128i) __builtin_ia32_phaddd128 ((__v4si)__X, (__v4si)__Y);
-}
-
-static __inline __m128i __attribute__((__always_inline__))
-_mm_hadds_epi16 (__m128i __X, __m128i __Y)
-{
-  return (__m128i) __builtin_ia32_phaddsw128 ((__v8hi)__X, (__v8hi)__Y);
-}
-
-static __inline __m64 __attribute__((__always_inline__))
-_mm_hadd_pi16 (__m64 __X, __m64 __Y)
-{
-  return (__m64) __builtin_ia32_phaddw ((__v4hi)__X, (__v4hi)__Y);
-}
-
-static __inline __m64 __attribute__((__always_inline__))
-_mm_hadd_pi32 (__m64 __X, __m64 __Y)
-{
-  return (__m64) __builtin_ia32_phaddd ((__v2si)__X, (__v2si)__Y);
-}
-
-static __inline __m64 __attribute__((__always_inline__))
-_mm_hadds_pi16 (__m64 __X, __m64 __Y)
-{
-  return (__m64) __builtin_ia32_phaddsw ((__v4hi)__X, (__v4hi)__Y);
-}
-
-static __inline __m128i __attribute__((__always_inline__))
-_mm_hsub_epi16 (__m128i __X, __m128i __Y)
-{
-  return (__m128i) __builtin_ia32_phsubw128 ((__v8hi)__X, (__v8hi)__Y);
-}
-
-static __inline __m128i __attribute__((__always_inline__))
-_mm_hsub_epi32 (__m128i __X, __m128i __Y)
-{
-  return (__m128i) __builtin_ia32_phsubd128 ((__v4si)__X, (__v4si)__Y);
-}
-
-static __inline __m128i __attribute__((__always_inline__))
-_mm_hsubs_epi16 (__m128i __X, __m128i __Y)
-{
-  return (__m128i) __builtin_ia32_phsubsw128 ((__v8hi)__X, (__v8hi)__Y);
-}
-
-static __inline __m64 __attribute__((__always_inline__))
-_mm_hsub_pi16 (__m64 __X, __m64 __Y)
-{
-  return (__m64) __builtin_ia32_phsubw ((__v4hi)__X, (__v4hi)__Y);
-}
-
-static __inline __m64 __attribute__((__always_inline__))
-_mm_hsub_pi32 (__m64 __X, __m64 __Y)
-{
-  return (__m64) __builtin_ia32_phsubd ((__v2si)__X, (__v2si)__Y);
-}
-
-static __inline __m64 __attribute__((__always_inline__))
-_mm_hsubs_pi16 (__m64 __X, __m64 __Y)
-{
-  return (__m64) __builtin_ia32_phsubsw ((__v4hi)__X, (__v4hi)__Y);
-}
-
-static __inline __m128i __attribute__((__always_inline__))
-_mm_maddubs_epi16 (__m128i __X, __m128i __Y)
-{
-  return (__m128i) __builtin_ia32_pmaddubsw128 ((__v16qi)__X, (__v16qi)__Y);
-}
-
-static __inline __m64 __attribute__((__always_inline__))
-_mm_maddubs_pi16 (__m64 __X, __m64 __Y)
-{
-  return (__m64) __builtin_ia32_pmaddubsw ((__v8qi)__X, (__v8qi)__Y);
-}
-
-static __inline __m128i __attribute__((__always_inline__))
-_mm_mulhrs_epi16 (__m128i __X, __m128i __Y)
-{
-  return (__m128i) __builtin_ia32_pmulhrsw128 ((__v8hi)__X, (__v8hi)__Y);
-}
-
-static __inline __m64 __attribute__((__always_inline__))
-_mm_mulhrs_pi16 (__m64 __X, __m64 __Y)
-{
-  return (__m64) 

Re: svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast

2013-05-08 Thread Peter Wemm
On Wed, May 8, 2013 at 1:03 PM, Mikolaj Golub troc...@freebsd.org wrote:
 Author: trociny
 Date: Wed May  8 20:03:37 2013
 New Revision: 250379
 URL: http://svnweb.freebsd.org/changeset/base/250379

 Log:
   HAST module for bsnmpd(1).

   Reviewed by:  harti, pjd
   MFC after:2 weeks

This breaks world on just about everything other than i386, and it is
technically broken there too but doesn't actually cause a build
failure.

You cannot link a .so file against a non-pic library, libl.a in this case.

=== usr.sbin/bsnmpd/modules/snmp_hast (all)^M
/usr/obj/usr/src/tmp/usr/bin/ld: /usr/obj/usr/src/tmp/usr/lib/libl.a(libyywrap.o
): relocation R_X86_64_32 against `a local symbol' can not be used when making a
 shared object; recompile with -fPIC^M
/usr/obj/usr/src/tmp/usr/lib/libl.a: could not read symbols: Bad value^M
*** [snmp_hast.so.6] Error code 1^M

-- 
Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250394 - head/usr.sbin/bsnmpd/modules

2013-05-08 Thread Peter Wemm
Author: peter
Date: Wed May  8 23:30:24 2013
New Revision: 250394
URL: http://svnweb.freebsd.org/changeset/base/250394

Log:
  Unbreak build - this can only build on i386 as-is due to use of libl in
  a .so file, and we currently (intentionally) only build libl.a.

Modified:
  head/usr.sbin/bsnmpd/modules/Makefile

Modified: head/usr.sbin/bsnmpd/modules/Makefile
==
--- head/usr.sbin/bsnmpd/modules/Makefile   Wed May  8 22:54:53 2013
(r250393)
+++ head/usr.sbin/bsnmpd/modules/Makefile   Wed May  8 23:30:24 2013
(r250394)
@@ -10,7 +10,6 @@ _snmp_atm= snmp_atm
 
 SUBDIR=${_snmp_atm} \
snmp_bridge \
-   snmp_hast \
snmp_hostres \
snmp_mibII \
snmp_pf \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast

2013-05-08 Thread Peter Wemm
On Wed, May 8, 2013 at 4:25 PM, Peter Wemm pe...@wemm.org wrote:
 On Wed, May 8, 2013 at 1:03 PM, Mikolaj Golub troc...@freebsd.org wrote:
 Author: trociny
 Date: Wed May  8 20:03:37 2013
 New Revision: 250379
 URL: http://svnweb.freebsd.org/changeset/base/250379

 Log:
   HAST module for bsnmpd(1).

   Reviewed by:  harti, pjd
   MFC after:2 weeks

 This breaks world on just about everything other than i386, and it is
 technically broken there too but doesn't actually cause a build
 failure.

 You cannot link a .so file against a non-pic library, libl.a in this case.

 === usr.sbin/bsnmpd/modules/snmp_hast (all)^M
 /usr/obj/usr/src/tmp/usr/bin/ld: 
 /usr/obj/usr/src/tmp/usr/lib/libl.a(libyywrap.o
 ): relocation R_X86_64_32 against `a local symbol' can not be used when 
 making a
  shared object; recompile with -fPIC^M
 /usr/obj/usr/src/tmp/usr/lib/libl.a: could not read symbols: Bad value^M
 *** [snmp_hast.so.6] Error code 1^M


Hmm. It seems clang optimizes something away that gcc doesn't.  When
building with clang the problem doesn't show up.


-- 
Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast

2013-05-08 Thread Glen Barber
On Wed, May 08, 2013 at 04:44:54PM -0700, Peter Wemm wrote:
 Hmm. It seems clang optimizes something away that gcc doesn't.  When
 building with clang the problem doesn't show up.
 

This is becoming more and more common of a problem...  :(

Glen



pgp9cCONqb8UF.pgp
Description: PGP signature


svn commit: r250395 - head/sys/sys

2013-05-08 Thread Attilio Rao
Author: attilio
Date: Thu May  9 00:04:59 2013
New Revision: 250395
URL: http://svnweb.freebsd.org/changeset/base/250395

Log:
  Generalize the bitset operations, present in cpuset and offer a KPI to
  redefine such operations for different consumers.
  This will be used when NUMA support will be finished and numaset
  will need to be used.
  
  Sponsored by: EMC / Isilon storage division
  Obtained from:jeff
  Reviewed by:  alc

Added:
  head/sys/sys/_bitset.h   (contents, props changed)
  head/sys/sys/bitset.h   (contents, props changed)
Modified:
  head/sys/sys/_cpuset.h
  head/sys/sys/cpuset.h

Added: head/sys/sys/_bitset.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/sys/_bitset.h  Thu May  9 00:04:59 2013(r250395)
@@ -0,0 +1,61 @@
+/*-
+ * Copyright (c) 2008, Jeffrey Roberson j...@freebsd.org
+ * All rights reserved.
+ *
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice unmodified, this list of conditions, and the following
+ *disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS__BITSET_H_
+#define_SYS__BITSET_H_
+
+/*
+ * Macros addressing word and bit within it, tuned to make compiler
+ * optimize cases when SETSIZE fits into single machine word.
+ */
+#define_BITSET_BITS(sizeof(long) * NBBY)
+
+#define__bitset_words(_s)  (howmany(_s, _BITSET_BITS))
+
+#define__bitset_mask(_s, n)
\
+   (1L  ((__bitset_words((_s)) == 1) ?   \
+   (__size_t)(n) : ((n) % _BITSET_BITS)))
+
+#define__bitset_word(_s, n)
\
+   ((__bitset_words((_s)) == 1) ? 0 : ((n) / _BITSET_BITS))
+
+#defineBITSET_DEFINE(t, _s)
\
+struct t { \
+long__bits[__bitset_words((_s))];  \
+};
+
+#defineBITSET_T_INITIALIZER(x) 
\
+   { .__bits = { x } }
+
+#defineBITSET_FSET(n)  
\
+   [ 0 ... ((n) - 1) ] = (-1L)
+
+#endif /* !_SYS__BITSET_H_ */

Modified: head/sys/sys/_cpuset.h
==
--- head/sys/sys/_cpuset.h  Wed May  8 23:30:24 2013(r250394)
+++ head/sys/sys/_cpuset.h  Thu May  9 00:04:59 2013(r250395)
@@ -32,6 +32,8 @@
 #ifndef _SYS__CPUSET_H_
 #define_SYS__CPUSET_H_
 
+#include sys/_bitset.h
+
 #ifdef _KERNEL
 #defineCPU_SETSIZE MAXCPU
 #endif
@@ -42,17 +44,13 @@
 #defineCPU_SETSIZE CPU_MAXSIZE
 #endif
 
-#define_NCPUBITS   (sizeof(long) * NBBY)   /* bits per mask */
-#define_NCPUWORDS  howmany(CPU_SETSIZE, _NCPUBITS)
-
-typedefstruct _cpuset {
-   long__bits[howmany(CPU_SETSIZE, _NCPUBITS)];
-} cpuset_t;
+#define_NCPUBITS   _BITSET_BITS
+#define_NCPUWORDS  __bitset_words(CPU_SETSIZE)
 
-#defineCPUSET_FSET 
\
-   [ 0 ... (_NCPUWORDS - 1) ] = (-1L)
+BITSET_DEFINE(_cpuset, CPU_SETSIZE);
+typedef struct _cpuset cpuset_t;
 
-#defineCPUSET_T_INITIALIZER(x) 
\
-   { .__bits = { x } }
+#defineCPUSET_FSET BITSET_FSET(_NCPUWORDS)
+#defineCPUSET_T_INITIALIZERBITSET_T_INITIALIZER
 
 #endif /* !_SYS__CPUSET_H_ */

Added: head/sys/sys/bitset.h
==
--- /dev/null   

svn commit: r250400 - head/share/man/man3

2013-05-08 Thread Eitan Adler
Author: eadler
Date: Thu May  9 02:04:28 2013
New Revision: 250400
URL: http://svnweb.freebsd.org/changeset/base/250400

Log:
  Start sentences on new lines.

Modified:
  head/share/man/man3/queue.3

Modified: head/share/man/man3/queue.3
==
--- head/share/man/man3/queue.3 Thu May  9 00:26:20 2013(r250399)
+++ head/share/man/man3/queue.3 Thu May  9 02:04:28 2013(r250400)
@@ -404,7 +404,8 @@ The macro
 .Nm SLIST_REMOVE_AFTER
 removes the element after
 .Fa elm
-from the list. Unlike
+from the list.
+Unlike
 .Fa SLIST_REMOVE ,
 this macro does not traverse the entire list.
 .Pp
@@ -595,7 +596,8 @@ The macro
 .Nm STAILQ_REMOVE_AFTER
 removes the element after
 .Fa elm
-from the tail queue. Unlike
+from the tail queue.
+Unlike
 .Fa STAILQ_REMOVE ,
 this macro does not traverse the entire tail queue.
 .Pp
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r250402 - head/lib/libthr/thread

2013-05-08 Thread David Xu
Author: davidxu
Date: Thu May  9 04:41:03 2013
New Revision: 250402
URL: http://svnweb.freebsd.org/changeset/base/250402

Log:
  Fix return value for setcontext and swapcontext.

Modified:
  head/lib/libthr/thread/thr_sig.c

Modified: head/lib/libthr/thread/thr_sig.c
==
--- head/lib/libthr/thread/thr_sig.cThu May  9 02:23:02 2013
(r250401)
+++ head/lib/libthr/thread/thr_sig.cThu May  9 04:41:03 2013
(r250402)
@@ -725,8 +725,10 @@ _setcontext(const ucontext_t *ucp)
 {
ucontext_t uc;
 
-   if (ucp == NULL)
-   return (EINVAL);
+   if (ucp == NULL) {
+   errno = EINVAL;
+   return (-1);
+   }
if (!SIGISMEMBER(uc.uc_sigmask, SIGCANCEL))
return __sys_setcontext(ucp);
(void) memcpy(uc, ucp, sizeof(uc));
@@ -740,8 +742,10 @@ _swapcontext(ucontext_t *oucp, const uco
 {
ucontext_t uc;
 
-   if (oucp == NULL || ucp == NULL)
-   return (EINVAL);
+   if (oucp == NULL || ucp == NULL) {
+   errno = EINVAL;
+   return (-1);
+   }
if (SIGISMEMBER(ucp-uc_sigmask, SIGCANCEL)) {
(void) memcpy(uc, ucp, sizeof(uc));
SIGDELSET(uc.uc_sigmask, SIGCANCEL);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org