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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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: 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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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  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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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 
+__FBSDID("$FreeBSD$");
+
+#include "opt_acpi.h"
+#include 
+#include 
+#include 
+
+#include 
+
+#include "acpi_if.h"
+#include 
+#include 
+#include 
+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 = {
+   "acpi_rapidstart",
+   acpi_rapidstart_methods,
+   sizeof(struct acpi_rapidstart_softc),
+}

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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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 

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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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 
(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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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  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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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 
  Approved by:  George Neville-Neil 

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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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 

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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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 +14

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 
+-- 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 
)
   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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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 
  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
==
--- head/s

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 
  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
+set_port_f

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  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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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 
  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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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 
  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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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 
  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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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 
  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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * 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))
+   return (-1);
+   }
+
+   return (0);
+}
+
+static int
+ip175c_port_vlan_setup(struct ip17x_softc *sc)
+{
+   struct ip17x_vlan *v;
+   uint32_t ports[IP175X_NUM_PORTS], reg[IP175X_NUM_PORTS/2];
+   int i, err, phy;
+
+   KASSERT(sc->cpuport == 5, ("cpuport != 5 not

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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r250389 - head/sys/x86/acpica

2013-05-08 Thread Attilio Rao
Author: attilio
Date: Wed May  8 21:06:47 2013
New Revision: 250389
URL: http://svnweb.freebsd.org/changeset/base/250389

Log:
  Revert r250339 as apparently it is more clutter than help.
  
  Sponsored by: EMC / Isilon storage division
  Requested by: jhb

Modified:
  head/sys/x86/acpica/srat.c

Modified: head/sys/x86/acpica/srat.c
==
--- head/sys/x86/acpica/srat.c  Wed May  8 21:04:19 2013(r250388)
+++ head/sys/x86/acpica/srat.c  Wed May  8 21:06:47 2013(r250389)
@@ -331,48 +331,6 @@ srat_walk_table(acpi_subtable_handler *h
acpi_walk_subtables(srat + 1, (char *)srat + srat->Header.Length,
handler, arg);
 }
- 
-static void
-acpi_handle_slit(ACPI_TABLE_SLIT *slit)
-{
-   UINT64 i, j;
-
-   printf("ACPI System Locality Information Table: %ju localities\n",
-   (uintmax_t)slit->LocalityCount);
-   printf("  ");
-   for (i = 0; i < slit->LocalityCount; i++)
-   printf(" %3ju", (uintmax_t)i);
-   printf("\n +");
-   for (i = 0; i < slit->LocalityCount; i++)
-   printf("");
-   printf("\n");
-   for (i = 0; i < slit->LocalityCount; i++) {
-   printf(" %3ju |", (uintmax_t)i);
-   for (j = 0; j < slit->LocalityCount; j++)
-   printf(" %3u",
-   slit->Entry[i * slit->LocalityCount + j]);
-   printf("\n");
-   }
-}
-
-static void
-parse_slit(void *arg __unused)
-{
-   ACPI_TABLE_SLIT *slit;
-   vm_paddr_t slit_physaddr;
-
-   if (resource_disabled("slit", 0))
-   return;
-
-   slit_physaddr = acpi_find_table(ACPI_SIG_SLIT);
-   if (slit_physaddr == 0)
-   return;
-   slit = acpi_map_table(slit_physaddr, ACPI_SIG_SLIT);
-   acpi_handle_slit(slit);
-   acpi_unmap_table(slit);
-}
-
-SYSINIT(parse_slit, SI_SUB_VM - 1, SI_ORDER_SECOND, parse_slit, NULL);
 
 /*
  * Setup per-CPU ACPI IDs.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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  wrote:
> On Wednesday, May 08, 2013 2:21:12 pm Attilio Rao wrote:
>> On Wed, May 8, 2013 at 6:01 PM, John Baldwin  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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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

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 
-
-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) __builtin_ia32_pmulh

svn commit: r250393 - head/gnu/usr.bin/cc/include

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

Log:
  When gcc 4.2.0 was imported, the 3DNow intrinsics header  was
  not added to the list of intrinsics headers to install, so belatedly (5
  years :) add it.
  
  MFC after:1 week

Modified:
  head/gnu/usr.bin/cc/include/Makefile

Modified: head/gnu/usr.bin/cc/include/Makefile
==
--- head/gnu/usr.bin/cc/include/MakefileWed May  8 22:50:36 2013
(r250392)
+++ head/gnu/usr.bin/cc/include/MakefileWed May  8 22:54:53 2013
(r250393)
@@ -9,7 +9,8 @@ INCSDIR=${INCLUDEDIR}/gcc/${GCCVER}
 .PATH: ${GCCDIR}/config/${GCC_CPU}
 
 .if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64"
-INCS=  emmintrin.h mmintrin.h pmmintrin.h tmmintrin.h xmmintrin.h mm_malloc.h
+INCS=  emmintrin.h mmintrin.h mm3dnow.h pmmintrin.h tmmintrin.h xmmintrin.h \
+   mm_malloc.h
 .elif ${TARGET_ARCH} == "ia64"
 INCS=  ia64intrin.h
 .elif ${TARGET_ARCH} == "arm"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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  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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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  wrote:
> On Wed, May 8, 2013 at 1:03 PM, Mikolaj Golub  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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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



pgpG2f9xV15x2.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 
+ * 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 
+
 #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   00:00:00 1970   (empty, becaus

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

2013-05-08 Thread Petko Bordjukov
Hello,

This commit leads to a TLB miss at device_get_parent on boot on the RS.

RedBoot> load -p 6969 kernel/kernel
Using default protocol (TFTP)
Entry point: 0x80050100, address range: 0x8005-0x8056ae38
RedBoot> exec
Now booting linux kernel:
 Base address 0x8005 Entry 0x80050100
 Cmdline : console=ttyS0,115200 init=/init
CPU platform: Atheros AR7161 rev 2
CPU Frequency=680 MHz
CPU DDR Frequency=170 MHz
CPU AHB Frequency=85 MHz
platform frequency: 68000
CPU reference clock: 40 MHz
arguments:
  a0 = 0002
  a1 = 80050028
  a2 = 8005
  a3 = 001b
Cmd line:  console=ttyS0,115200 init=/init
Environment:
  memsize = 0x0400
  modetty0 = 0,n,8,1,hw
  ethaddr = ommitted
  board = Ubiquiti AR71xx-based board
Cache info:
  picache_stride= 4096
  picache_loopcount = 16
  pdcache_stride= 4096
  pdcache_loopcount = 8
cpu0: MIPS Technologies processor v116.147
  MMU: Standard TLB, 16 entries
  L1 i-cache: 4 ways of 512 sets, 32 bytes per line
  L1 d-cache: 4 ways of 256 sets, 32 bytes per line
  Config1=0x9ee3519e
  Config3=0x20
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2013 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.0-CURRENT #1 r250385: Thu May  9 04:04:12 EEST 2013
root@virtbsd10:/usr/obj/mips.mips/usr/src/sys/ROUTERSTATION mips
gcc version 4.2.1 20070831 patched [FreeBSD]
WARNING: WITNESS option enabled, expect reduced performance.
MEMGUARD DEBUGGING ALLOCATOR INITIALIZED:
MEMGUARD map base: 0xc040
MEMGUARD map limit: 0xc6a67000
MEMGUARD map size: 104860 KBytes
real memory  = 67108864 (65536K bytes)
avail memory = 56496128 (53MB)
random device not loaded; using insecure entropy
nexus0: 
clock0:  on nexus0
Timecounter "MIPS32" frequency 34000 Hz quality 800
Event timer "MIPS32" frequency 34000 Hz quality 800
apb0 at irq 4 on nexus0
uart0: <16550 or compatible> on apb0
uart0: console (115200,n,8,1)
gpio0:  on apb0
gpio0: [GIANT-LOCKED]
gpio0: gpio pinmask=0x0
gpioc0:  on gpio0
gpiobus0:  on gpio0
gpioled0:  at pin(s) 2 on gpiobus0
ehci0:  at mem 0x1b00-0x1bff
irq 1 on nexus0
usbus0: set host controller mode
usbus0: EHCI version 1.0
usbus0: set host controller mode
usbus0 on ehci0
pcib0 at irq 0 on nexus0
pcib0: ar71xx_pci_attach: missing hint 'baseslot', default to
AR71XX_PCI_BASE_SLOT
pci0:  on pcib0
ath0:  irq 1 at device 18.0 on pci0
ath0: AR2413 mac 7.8 RF2413 phy 4.5
ath0: 2GHz radio: 0x; 5GHz radio: 0x0056
ath1:  irq 2 at device 19.0 on pci0
ath1: [HT] enabling HT modes
ath1: [HT] 1 stream STBC receive enabled
ath1: [HT] 1 stream STBC transmit enabled
ath1: [HT] 2 RX streams; 2 TX streams
ath1: AR9220 mac 128.2 RF5133 phy 13.0
ath1: 2GHz radio: 0x; 5GHz radio: 0x00c0
arge0:  at mem
0x1900-0x19000fff irq 2 on nexus0
miiproxy0:  on arge0
arge0: can't attach proxy
arge0: finishing attachment, phymask 10, proxy null
arge0: unable to attach PHY 20: 6
device_attach: arge0 attach returned 6
arge1:  at mem
0x1a00-0x1a000fff irq 3 on nexus0
miiproxy1:  on arge1
Trap cause = 2 (TLB miss (load or instr. fetch) - kernel mode)
[ thread pid 0 tid 10 ]
Stopped at  device_get_parent:  jr  ra
db> where
Tracing pid 0 tid 10 td 0x80570170
db_trace_thread+30 (?,?,?,?) ra 807057b80018 sp 0 sz 0
8007b19c+114 (0,?,,?) ra 807057d00020 sp 1 sz 1
8007a4e4+388 (?,?,?,?) ra 807057f000a8 sp 0 sz 0
db_command_loop+70 (?,?,?,?) ra 807058980018 sp 0 sz 0
8007cfe0+f4 (?,?,?,?) ra 807058b001a8 sp 0 sz 0
kdb_trap+110 (?,?,?,?) ra 80705a580030 sp 0 sz 0
trap+f18 (?,?,?,?) ra 80705a8800b8 sp 0 sz 0
MipsKernGenException+134 (0,8100d880,8049ece8,fa) ra 80705b4000c8 sp
10001 sz 1
device_get_parent+0 (?,?,?,?) ra 80705c08 sp 0 sz 0
pid 0
db>
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: 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-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"