Re: svn commit: r345171 - head/usr.sbin/bhyve

2019-03-14 Thread Andrew Thompson
On Fri, 15 Mar 2019 at 15:11, Chuck Tuffli  wrote:

> Author: chuck
> Date: Fri Mar 15 02:11:28 2019
> New Revision: 345171
> URL: https://svnweb.freebsd.org/changeset/base/345171
>
> Log:
>   Fix bhyve PCIe capability emulation
>
>   PCIe devices starting with version 1.1 must set the Role-Based Error
>   Reporting bit.
>
>   And while we're in the neighborhood, generalize the code assigning the
>   device type.
>
>   Reviewed by:  imp, araujo, rgrimes
>   Approved by:  imp (mentor)
>   MFC after:1 week
>   Differential Revision: https://reviews.freebsd.org/D19580
>
> Modified:
>   head/usr.sbin/bhyve/pci_emul.c
>
> Modified: head/usr.sbin/bhyve/pci_emul.c
>
> ==
> --- head/usr.sbin/bhyve/pci_emul.c  Fri Mar 15 02:11:27 2019
> (r345170)
> +++ head/usr.sbin/bhyve/pci_emul.c  Fri Mar 15 02:11:28 2019
> (r345171)
> @@ -953,7 +953,10 @@ pci_emul_add_pciecap(struct pci_devinst *pi, int type)
> bzero(, sizeof(pciecap));
>
> pciecap.capid = PCIY_EXPRESS;
> -   pciecap.pcie_capabilities = PCIECAP_VERSION | PCIEM_TYPE_ROOT_PORT;
> +   pciecap.pcie_capabilities = PCIECAP_VERSION | type;
> +   /* Devices starting with version 1.1 must set the RBER bit */
> +   if (PCIECAP_VERSION >= 1)
> +   pciecap.dev_capabilities = PCIEM_CAP_ROLE_ERR_RPT;
> pciecap.link_capabilities = 0x411;  /* gen1, x1 */
> pciecap.link_status = 0x11; /* gen1, x1 */
>

If the message you say 'set the bit' but you are overwriting the whole
variable, is this intended?


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


Re: svn commit: r341657 - in head: etc/mtree sbin/nvmecontrol share/man/man7

2018-12-06 Thread Andrew Thompson
On Fri, 7 Dec 2018 at 11:58, Warner Losh  wrote:

> Author: imp
> Date: Thu Dec  6 22:58:26 2018
> New Revision: 341657
> URL: https://svnweb.freebsd.org/changeset/base/341657
>
> Log:
>   Dynamically load .so modules to expand functionality
>
>   o Dynamically load all the .so files found in /libexec/nvmecontrol and
> /usr/local/libexec/nvmecontrol.
>   o Link nvmecontrol -rdynamic so that its symbols are visible to the
> libraries we load.
>   o Create concatinated linker sets that we dynamically expand.
>   o Add the linked-in top and logpage linker sets to the mirrors for them
> and add those sets to the mirrors when we load a new .so.
>   o Add some macros to help hide the names of the linker sets.
>   o Update the man page.
>
...

>
> Modified: head/sbin/nvmecontrol/nvmecontrol.c
>
> ==
> --- head/sbin/nvmecontrol/nvmecontrol.c Thu Dec  6 22:35:07 2018
> (r341656)
> +++ head/sbin/nvmecontrol/nvmecontrol.c Thu Dec  6 22:58:26 2018
> (r341657)
> @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$");
>  #include 
> ...
>  int
>  main(int argc, char *argv[])
>  {
>
> +   add_to_top(NVME_CMD_BEGIN(top), NVME_CMD_LIMIT(top));
> +   add_to_logpage(NVME_LOGPAGE_BEGIN, NVME_LOGPAGE_LIMIT);
> +
> +   load_dir("/lib/nvmecontrol");
> +   load_dir("/usr/local/lib/nvmecontrol");
>
>
 You have /libexec/nvmecontrol in some places and /lib/nvmecontrol in
others. It seems it actually loads from the latter.


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


svn commit: r314935 - head/release/tools

2017-03-08 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar  9 01:26:10 2017
New Revision: 314935
URL: https://svnweb.freebsd.org/changeset/base/314935

Log:
  ec2.conf and vmimage.subr can be used from the installation livecd after
  install to prepare an AMI image. This can be used to create a ZFS AMI disk
  image using a virtual machine.
  
  Change ec2.conf to use the pkg tool from a chroot rather than trying to
  bootstrap it and fail from the livecd readonly filesystem.
  
  Reviewed by:  gjb

Modified:
  head/release/tools/ec2.conf

Modified: head/release/tools/ec2.conf
==
--- head/release/tools/ec2.conf Thu Mar  9 01:21:28 2017(r314934)
+++ head/release/tools/ec2.conf Thu Mar  9 01:26:10 2017(r314935)
@@ -32,7 +32,8 @@ vm_extra_pre_umount() {
# catalogue and install or update pkg when the instance first
# launches, so these files would just be replaced anyway; removing
# them from the image allows it to boot faster.
-   env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} delete -f -y pkg
+   chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes \
+   /usr/sbin/pkg delete -f -y pkg
rm ${DESTDIR}/var/db/pkg/repo-*.sqlite
 
# The size of the EC2 root disk can be configured at instance launch
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r298743 - in head/sys/netinet: . tcp_stacks

2016-05-03 Thread Andrew Thompson
On 29 April 2016 at 01:27, Randall Stewart  wrote:

> Author: rrs
> Date: Thu Apr 28 13:27:12 2016
> New Revision: 298743
> URL: https://svnweb.freebsd.org/changeset/base/298743
>
> Log:
>   This cleans up the timers code in TCP to start using the new
>   async_drain functionality. This as been tested in NF as well as
>   by Verisign. Still to do in here is to remove all the old flags. They
>   are currently left being maintained but probably are no longer needed.
>
>   Sponsored by: Netflix Inc.
>   Differential Revision:http://reviews.freebsd.org/D5924
>
> Modified:
>   head/sys/netinet/tcp_stacks/fastpath.c
>   head/sys/netinet/tcp_subr.c
>   head/sys/netinet/tcp_timer.c
>   head/sys/netinet/tcp_timer.h
>   head/sys/netinet/tcp_var.h
>
> Modified: head/sys/netinet/tcp_stacks/fastpath.c
>
> ==
> --- head/sys/netinet/tcp_stacks/fastpath.c  Thu Apr 28 13:00:40 2016
>   (r298742)
> +++ head/sys/netinet/tcp_stacks/fastpath.c  Thu Apr 28 13:27:12 2016
>   (r298743)
> @@ -2386,7 +2386,6 @@ struct tcp_function_block __tcp_fastslow
> NULL,
> NULL,
> NULL,
> -   NULL,
> 0,
> 0
>
> @@ -2403,7 +2402,6 @@ struct tcp_function_block __tcp_fastack
> NULL,
> NULL,
> NULL,
> -   NULL,
> 0,
> 0
>  };
>


Is there a reason not to use named struct initialisers here? It is
self-describing and also does not require the nulls to be set.  ie {
.tfb_tcp_output
= tcp_output , ... }

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


svn commit: r293712 - svnadmin/conf

2016-01-11 Thread Andrew Thompson
Author: thompsa
Date: Mon Jan 11 23:42:00 2016
New Revision: 293712
URL: https://svnweb.freebsd.org/changeset/base/293712

Log:
  Remove myself.
  
  Prodded by:   glebius

Modified:
  svnadmin/conf/sizelimit.conf

Modified: svnadmin/conf/sizelimit.conf
==
--- svnadmin/conf/sizelimit.confMon Jan 11 23:37:31 2016
(r293711)
+++ svnadmin/conf/sizelimit.confMon Jan 11 23:42:00 2016
(r293712)
@@ -26,5 +26,4 @@ lstewart
 obrien
 peter
 rwatson
-thompsa
 rpaulo
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r273331 - in head: sbin/ifconfig share/man/man4 sys/conf sys/modules sys/modules/if_vxlan sys/net sys/sys

2014-10-20 Thread Andrew Thompson
On 21 October 2014 03:42, Bryan Venteicher bry...@freebsd.org wrote:

 Author: bryanv
 Date: Mon Oct 20 14:42:42 2014
 New Revision: 273331
 URL: https://svnweb.freebsd.org/changeset/base/273331

 Log:
   Add vxlan interface

   vxlan creates a virtual LAN by encapsulating the inner Ethernet frame in
   a UDP packet. This implementation is based on RFC7348.

   Currently, the IPv6 support is not fully compliant with the
 specification:
   we should be able to receive UPDv6 packets with a zero checksum, but we
   need to support RFC6935 first. Patches for this should come soon.



Given it is self contained new code is it a 10.1 MFC candidate?


Andrew
___
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: r270644 - stable/10/usr.sbin/bsdinstall/scripts

2014-08-25 Thread Andrew Thompson
Author: thompsa
Date: Tue Aug 26 02:31:37 2014
New Revision: 270644
URL: http://svnweb.freebsd.org/changeset/base/270644

Log:
  MFH (r269653): Give a brief error message

Modified:
  stable/10/usr.sbin/bsdinstall/scripts/auto
  stable/10/usr.sbin/bsdinstall/scripts/jail
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bsdinstall/scripts/auto
==
--- stable/10/usr.sbin/bsdinstall/scripts/auto  Tue Aug 26 02:20:37 2014
(r270643)
+++ stable/10/usr.sbin/bsdinstall/scripts/auto  Tue Aug 26 02:31:37 2014
(r270644)
@@ -35,11 +35,15 @@ BSDCFG_SHARE=/usr/share/bsdconfig
  FUNCTIONS
 
 error() {
+   local msg
+   if [ -n $1 ]; then
+   msg=$1\n\n
+   fi
test -n $DISTDIR_IS_UNIONFS  umount -f $BSDINSTALL_DISTDIR
test -f $PATH_FSTAB  bsdinstall umount
dialog --backtitle FreeBSD Installer --title Abort \
--no-label Exit --yes-label Restart --yesno \
-   An installation step has been aborted. Would you like to restart 
the installation or exit the installer? 0 0
+   ${msg}An installation step has been aborted. Would you like to 
restart the installation or exit the installer? 0 0
if [ $? -ne 0 ]; then
exit 1
else
@@ -58,7 +62,7 @@ trap true SIGINT  # This section is optio
 bsdinstall keymap
 
 trap error SIGINT  # Catch cntrl-C here
-bsdinstall hostname || error
+bsdinstall hostname || error Set hostname failed
 
 export DISTRIBUTIONS=base.txz kernel.txz
 if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then
@@ -95,7 +99,7 @@ if [ -n $FETCH_DISTRIBUTIONS ]; then
BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 21 13)
MIRROR_BUTTON=$?
exec 3-
-   test $MIRROR_BUTTON -eq 0 || error
+   test $MIRROR_BUTTON -eq 0 || error No mirror selected
export BSDINSTALL_DISTSITE
 fi
 
@@ -125,8 +129,8 @@ exec 3-
 
 case $PARTMODE in
 Guided)  # Guided
-   bsdinstall autopart || error
-   bsdinstall mount || error
+   bsdinstall autopart || error Partitioning error
+   bsdinstall mount || error Failed to mount filesystem
;;
 Shell)   # Shell
clear
@@ -136,18 +140,18 @@ case $PARTMODE in
 Manual)  # Manual
if f_isset debugFile; then
# Give partedit the path to our logfile so it can append
-   BSDINSTALL_LOG=${debugFile#+} bsdinstall partedit || error
+   BSDINSTALL_LOG=${debugFile#+} bsdinstall partedit || error 
Partitioning error
else
-   bsdinstall partedit || error
+   bsdinstall partedit || error Partitioning error
fi
-   bsdinstall mount || error
+   bsdinstall mount || error Failed to mount filesystem
;;
 ZFS) # ZFS
-   bsdinstall zfsboot || error
-   bsdinstall mount || error
+   bsdinstall zfsboot || error ZFS setup failed
+   bsdinstall mount || error Failed to mount filesystem
;;
 *)
-   error
+   error Unknown partitioning mode
;;
 esac
 
@@ -156,7 +160,7 @@ if [ ! -z $FETCH_DISTRIBUTIONS ]; then
 
# Download to a directory in the new system as scratch space
BSDINSTALL_FETCHDEST=$BSDINSTALL_CHROOT/usr/freebsd-dist
-   mkdir -p $BSDINSTALL_FETCHDEST || error
+   mkdir -p $BSDINSTALL_FETCHDEST || error Could not create directory 
$BSDINSTALL_FETCHDEST
 
export DISTRIBUTIONS=$FETCH_DISTRIBUTIONS
# Try to use any existing distfiles
@@ -169,13 +173,13 @@ if [ ! -z $FETCH_DISTRIBUTIONS ]; then
fi

export FTP_PASSIVE_MODE=YES
-   bsdinstall distfetch || error
+   bsdinstall distfetch || error Failed to fetch distribution
export DISTRIBUTIONS=$ALL_DISTRIBUTIONS
 fi
 
-bsdinstall checksum || error
-bsdinstall distextract || error
-bsdinstall rootpass || error
+bsdinstall checksum || error Distribution checksum failed
+bsdinstall distextract || error Distribution extract failed
+bsdinstall rootpass || error Could not set root password
 
 trap true SIGINT   # This section is optional
 if [ $NETCONFIG_DONE != yes ]; then
@@ -239,7 +243,7 @@ finalconfig() {
 finalconfig
 
 trap error SIGINT  # SIGINT is bad again
-bsdinstall config  || error
+bsdinstall config  || error Failed to save config
 
 if [ ! -z $BSDINSTALL_FETCHDEST ]; then
[ $BSDINSTALL_FETCHDEST != $BSDINSTALL_DISTDIR ]  \

Modified: stable/10/usr.sbin/bsdinstall/scripts/jail
==
--- stable/10/usr.sbin/bsdinstall/scripts/jail  Tue Aug 26 02:20:37 2014
(r270643)
+++ stable/10/usr.sbin/bsdinstall/scripts/jail  Tue Aug 26 02:31:37 2014
(r270644)
@@ -38,9 +38,13 @@ f_dprintf Began Installation at %s $(
 export BSDINSTALL_CHROOT=$1
 
 error() {
+   local msg
+   if [ -n 

svn commit: r269653 - head/usr.sbin/bsdinstall/scripts

2014-08-06 Thread Andrew Thompson
Author: thompsa
Date: Thu Aug  7 01:51:01 2014
New Revision: 269653
URL: http://svnweb.freebsd.org/changeset/base/269653

Log:
  Give a brief message as to what error was encountered to help the user along.
  
  Reviewed by:  nwhitehorn
  MFC after:2 weeks

Modified:
  head/usr.sbin/bsdinstall/scripts/auto
  head/usr.sbin/bsdinstall/scripts/jail

Modified: head/usr.sbin/bsdinstall/scripts/auto
==
--- head/usr.sbin/bsdinstall/scripts/auto   Thu Aug  7 00:32:23 2014
(r269652)
+++ head/usr.sbin/bsdinstall/scripts/auto   Thu Aug  7 01:51:01 2014
(r269653)
@@ -35,11 +35,15 @@ BSDCFG_SHARE=/usr/share/bsdconfig
  FUNCTIONS
 
 error() {
+   local msg
+   if [ -n $1 ]; then
+   msg=$1\n\n
+   fi
test -n $DISTDIR_IS_UNIONFS  umount -f $BSDINSTALL_DISTDIR
test -f $PATH_FSTAB  bsdinstall umount
dialog --backtitle FreeBSD Installer --title Abort \
--no-label Exit --yes-label Restart --yesno \
-   An installation step has been aborted. Would you like to restart 
the installation or exit the installer? 0 0
+   ${msg}An installation step has been aborted. Would you like to 
restart the installation or exit the installer? 0 0
if [ $? -ne 0 ]; then
exit 1
else
@@ -58,7 +62,7 @@ trap true SIGINT  # This section is optio
 bsdinstall keymap
 
 trap error SIGINT  # Catch cntrl-C here
-bsdinstall hostname || error
+bsdinstall hostname || error Set hostname failed
 
 export DISTRIBUTIONS=base.txz kernel.txz
 if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then
@@ -95,7 +99,7 @@ if [ -n $FETCH_DISTRIBUTIONS ]; then
BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 21 13)
MIRROR_BUTTON=$?
exec 3-
-   test $MIRROR_BUTTON -eq 0 || error
+   test $MIRROR_BUTTON -eq 0 || error No mirror selected
export BSDINSTALL_DISTSITE
 fi
 
@@ -125,8 +129,8 @@ exec 3-
 
 case $PARTMODE in
 Guided)  # Guided
-   bsdinstall autopart || error
-   bsdinstall mount || error
+   bsdinstall autopart || error Partitioning error
+   bsdinstall mount || error Failed to mount filesystem
;;
 Shell)   # Shell
clear
@@ -136,18 +140,18 @@ case $PARTMODE in
 Manual)  # Manual
if f_isset debugFile; then
# Give partedit the path to our logfile so it can append
-   BSDINSTALL_LOG=${debugFile#+} bsdinstall partedit || error
+   BSDINSTALL_LOG=${debugFile#+} bsdinstall partedit || error 
Partitioning error
else
-   bsdinstall partedit || error
+   bsdinstall partedit || error Partitioning error
fi
-   bsdinstall mount || error
+   bsdinstall mount || error Failed to mount filesystem
;;
 ZFS) # ZFS
-   bsdinstall zfsboot || error
-   bsdinstall mount || error
+   bsdinstall zfsboot || error ZFS setup failed
+   bsdinstall mount || error Failed to mount filesystem
;;
 *)
-   error
+   error Unknown partitioning mode
;;
 esac
 
@@ -156,7 +160,7 @@ if [ ! -z $FETCH_DISTRIBUTIONS ]; then
 
# Download to a directory in the new system as scratch space
BSDINSTALL_FETCHDEST=$BSDINSTALL_CHROOT/usr/freebsd-dist
-   mkdir -p $BSDINSTALL_FETCHDEST || error
+   mkdir -p $BSDINSTALL_FETCHDEST || error Could not create directory 
$BSDINSTALL_FETCHDEST
 
export DISTRIBUTIONS=$FETCH_DISTRIBUTIONS
# Try to use any existing distfiles
@@ -169,13 +173,13 @@ if [ ! -z $FETCH_DISTRIBUTIONS ]; then
fi

export FTP_PASSIVE_MODE=YES
-   bsdinstall distfetch || error
+   bsdinstall distfetch || error Failed to fetch distribution
export DISTRIBUTIONS=$ALL_DISTRIBUTIONS
 fi
 
-bsdinstall checksum || error
-bsdinstall distextract || error
-bsdinstall rootpass || error
+bsdinstall checksum || error Distribution checksum failed
+bsdinstall distextract || error Distribution extract failed
+bsdinstall rootpass || error Could not set root password
 
 trap true SIGINT   # This section is optional
 if [ $NETCONFIG_DONE != yes ]; then
@@ -239,7 +243,7 @@ finalconfig() {
 finalconfig
 
 trap error SIGINT  # SIGINT is bad again
-bsdinstall config  || error
+bsdinstall config  || error Failed to save config
 
 if [ ! -z $BSDINSTALL_FETCHDEST ]; then
[ $BSDINSTALL_FETCHDEST != $BSDINSTALL_DISTDIR ]  \

Modified: head/usr.sbin/bsdinstall/scripts/jail
==
--- head/usr.sbin/bsdinstall/scripts/jail   Thu Aug  7 00:32:23 2014
(r269652)
+++ head/usr.sbin/bsdinstall/scripts/jail   Thu Aug  7 01:51:01 2014
(r269653)
@@ -38,9 +38,13 @@ f_dprintf Began Installation at %s $(
 export BSDINSTALL_CHROOT=$1
 
 error() {
+   local msg

Re: svn commit: r249589 - head/sys/mips/malta

2013-04-17 Thread Andrew Thompson
On 18 April 2013 06:26, Adrian Chadd adr...@freebsd.org wrote:

 Author: adrian
 Date: Wed Apr 17 18:26:01 2013
 New Revision: 249589
 URL: http://svnweb.freebsd.org/changeset/base/249589

 Log:
   Add the static kernel boot environment, needed to actually boot this
 thing.

   (Wasting 4k just as a temporary placeholder for a boot environment seems
   a bit ridiculous, but hey.)


This isnt needed anymore, see r249570.
___
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: r240075 - in head: crypto/openssh crypto/openssh/openbsd-compat secure/lib/libssh

2013-02-21 Thread Andrew Thompson
On 4 September 2012 04:51, Dag-Erling Smørgrav d...@freebsd.org wrote:
 Author: des
 Date: Mon Sep  3 16:51:41 2012
 New Revision: 240075
 URL: http://svn.freebsd.org/changeset/base/240075

 Log:
   Upgrade OpenSSH to 6.1p1.

MFC?
___
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: r240075 - in head: crypto/openssh crypto/openssh/openbsd-compat secure/lib/libssh

2013-02-21 Thread Andrew Thompson
On 22 February 2013 01:29, Dag-Erling Smørgrav d...@des.no wrote:
 Andrew Thompson thom...@freebsd.org writes:
 Dag-Erling Smørgrav d...@freebsd.org writes:
  Log:
Upgrade OpenSSH to 6.1p1.
 MFC?

 Not sure, it's a fairly large change.  I assume you're asking because of
 the upcoming 8.4?

I found myself wanting the new Match LocalPort options and saw 6.1 was
only in head, I had assumed openssh was always merged back but if its
a disruptive change then thats ok.


Andrew
___
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: r245329 - head/sys/mips/beri

2013-01-12 Thread Andrew Thompson
On 13 January 2013 01:35, Robert Watson rwat...@freebsd.org wrote:
 Author: rwatson
 Date: Sat Jan 12 12:34:59 2013
 New Revision: 245329
 URL: http://svnweb.freebsd.org/changeset/base/245329

 Log:
   Merge Perforce change @219935 to head:

 Initialise Openfirmware/FDT code earlier in the FreeBSD/beri boot,
 so that the results will be available for configuring the console
 UART (eventually).

 Suggested by:   thompsa

Two Andrew Ts down south, we always get mixed up.
___
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: r241970 - head/sys/mips/conf

2012-10-23 Thread Andrew Thompson
Author: thompsa
Date: Tue Oct 23 22:58:25 2012
New Revision: 241970
URL: http://svn.freebsd.org/changeset/base/241970

Log:
  Fix spelling of NFSCL option.

Modified:
  head/sys/mips/conf/AR71XX_BASE
  head/sys/mips/conf/AR724X_BASE

Modified: head/sys/mips/conf/AR71XX_BASE
==
--- head/sys/mips/conf/AR71XX_BASE  Tue Oct 23 21:20:05 2012
(r241969)
+++ head/sys/mips/conf/AR71XX_BASE  Tue Oct 23 22:58:25 2012
(r241970)
@@ -33,7 +33,7 @@ options   SCHED_4BSD  #4BSD scheduler
 optionsINET#InterNETworking
 optionsINET6   # IPv6
 
-# options  NFS_CL  #Network Filesystem Client
+# options  NFSCL   #Network Filesystem Client
 
 optionsPSEUDOFS#Pseudo-filesystem framework
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time 
extensions

Modified: head/sys/mips/conf/AR724X_BASE
==
--- head/sys/mips/conf/AR724X_BASE  Tue Oct 23 21:20:05 2012
(r241969)
+++ head/sys/mips/conf/AR724X_BASE  Tue Oct 23 22:58:25 2012
(r241970)
@@ -33,7 +33,7 @@ options   KDB
 optionsSCHED_4BSD  #4BSD scheduler
 optionsINET#InterNETworking
 #options   INET6   # IPv6
-#options   NFS_CL  #Network Filesystem Client
+#options   NFSCL   #Network Filesystem Client
 optionsPSEUDOFS#Pseudo-filesystem framework
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time 
extensions
 
___
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: r241183 - head/sys/net

2012-10-04 Thread Andrew Thompson
Author: thompsa
Date: Thu Oct  4 07:40:55 2012
New Revision: 241183
URL: http://svn.freebsd.org/changeset/base/241183

Log:
  Remove the M_NOWAIT from bridge_rtable_init as it isn't needed. The function
  return value is not even checked and could lead to a panic on a null 
sc_rthash.
  
  MFC after:2 weeks

Modified:
  head/sys/net/if_bridge.c

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cThu Oct  4 06:33:03 2012(r241182)
+++ head/sys/net/if_bridge.cThu Oct  4 07:40:55 2012(r241183)
@@ -270,7 +270,7 @@ static void bridge_rtflush(struct bridge
 static int bridge_rtdaddr(struct bridge_softc *, const uint8_t *,
uint16_t);
 
-static int bridge_rtable_init(struct bridge_softc *);
+static voidbridge_rtable_init(struct bridge_softc *);
 static voidbridge_rtable_fini(struct bridge_softc *);
 
 static int bridge_rtnode_addr_cmp(const uint8_t *, const uint8_t *);
@@ -2736,24 +2736,19 @@ bridge_rtdelete(struct bridge_softc *sc,
  *
  * Initialize the route table for this bridge.
  */
-static int
+static void
 bridge_rtable_init(struct bridge_softc *sc)
 {
int i;
 
sc-sc_rthash = malloc(sizeof(*sc-sc_rthash) * BRIDGE_RTHASH_SIZE,
-   M_DEVBUF, M_NOWAIT);
-   if (sc-sc_rthash == NULL)
-   return (ENOMEM);
+   M_DEVBUF, M_WAITOK);
 
for (i = 0; i  BRIDGE_RTHASH_SIZE; i++)
LIST_INIT(sc-sc_rthash[i]);
 
sc-sc_rthash_key = arc4random();
-
LIST_INIT(sc-sc_rtlist);
-
-   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: r238361 - head/sys/dev/usb

2012-07-11 Thread Andrew Thompson
On 12 July 2012 10:15, Adrian Chadd adr...@freebsd.org wrote:
 Again, that just touched usb. So, how'd that affect non-USB wifi cloning?

I guess cloning is first match wins and usb was incorrectly matching wlan*


Andrew
___
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: r238047 - stable/9/sys/net

2012-07-02 Thread Andrew Thompson
Author: thompsa
Date: Tue Jul  3 01:45:28 2012
New Revision: 238047
URL: http://svn.freebsd.org/changeset/base/238047

Log:
  MFC r237852
  
   Add the same check as vlan(4) where we ignore the ifnet departure event if 
the
   interface is just being renamed.
  
  PR:   kern/169557

Modified:
  stable/9/sys/net/if_lagg.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/isp/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/net/if_lagg.c
==
--- stable/9/sys/net/if_lagg.c  Tue Jul  3 01:00:29 2012(r238046)
+++ stable/9/sys/net/if_lagg.c  Tue Jul  3 01:45:28 2012(r238047)
@@ -797,6 +797,9 @@ lagg_port_ifdetach(void *arg __unused, s
 
if ((lp = ifp-if_lagg) == NULL)
return;
+   /* If the ifnet is just being renamed, don't do anything. */
+   if (ifp-if_flags  IFF_RENAMING)
+   return;
 
sc = lp-lp_softc;
 
___
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: r238048 - stable/8/sys/net

2012-07-02 Thread Andrew Thompson
Author: thompsa
Date: Tue Jul  3 01:45:38 2012
New Revision: 238048
URL: http://svn.freebsd.org/changeset/base/238048

Log:
  MFC r237852
  
   Add the same check as vlan(4) where we ignore the ifnet departure event if 
the
   interface is just being renamed.
  
  PR:   kern/169557

Modified:
  stable/8/sys/net/if_lagg.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/net/if_lagg.c
==
--- stable/8/sys/net/if_lagg.c  Tue Jul  3 01:45:28 2012(r238047)
+++ stable/8/sys/net/if_lagg.c  Tue Jul  3 01:45:38 2012(r238048)
@@ -784,6 +784,9 @@ lagg_port_ifdetach(void *arg __unused, s
 
if ((lp = ifp-if_lagg) == NULL)
return;
+   /* If the ifnet is just being renamed, don't do anything. */
+   if (ifp-if_flags  IFF_RENAMING)
+   return;
 
sc = lp-lp_softc;
 
___
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: r237850 - stable/9/usr.bin/sockstat

2012-06-30 Thread Andrew Thompson
Author: thompsa
Date: Sat Jun 30 18:57:55 2012
New Revision: 237850
URL: http://svn.freebsd.org/changeset/base/237850

Log:
  MFC r237674
  
   Update the usage with the new jail option.

Modified:
  stable/9/usr.bin/sockstat/sockstat.c
Directory Properties:
  stable/9/usr.bin/sockstat/   (props changed)

Modified: stable/9/usr.bin/sockstat/sockstat.c
==
--- stable/9/usr.bin/sockstat/sockstat.cSat Jun 30 18:56:08 2012
(r237849)
+++ stable/9/usr.bin/sockstat/sockstat.cSat Jun 30 18:57:55 2012
(r237850)
@@ -732,7 +732,7 @@ static void
 usage(void)
 {
fprintf(stderr,
-   Usage: sockstat [-46cLlu] [-p ports] [-P protocols]\n);
+   Usage: sockstat [-46cLlu] [-j jid] [-p ports] [-P protocols]\n);
exit(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: r237851 - stable/8/usr.bin/sockstat

2012-06-30 Thread Andrew Thompson
Author: thompsa
Date: Sat Jun 30 18:58:21 2012
New Revision: 237851
URL: http://svn.freebsd.org/changeset/base/237851

Log:
  MFC r237674
  
   Update the usage with the new jail option.

Modified:
  stable/8/usr.bin/sockstat/sockstat.c
Directory Properties:
  stable/8/usr.bin/sockstat/   (props changed)

Modified: stable/8/usr.bin/sockstat/sockstat.c
==
--- stable/8/usr.bin/sockstat/sockstat.cSat Jun 30 18:57:55 2012
(r237850)
+++ stable/8/usr.bin/sockstat/sockstat.cSat Jun 30 18:58:21 2012
(r237851)
@@ -732,7 +732,7 @@ static void
 usage(void)
 {
fprintf(stderr,
-   Usage: sockstat [-46cLlu] [-p ports] [-P protocols]\n);
+   Usage: sockstat [-46cLlu] [-j jid] [-p ports] [-P protocols]\n);
exit(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: r237852 - head/sys/net

2012-06-30 Thread Andrew Thompson
Author: thompsa
Date: Sat Jun 30 19:09:02 2012
New Revision: 237852
URL: http://svn.freebsd.org/changeset/base/237852

Log:
  Add the same check as vlan(4) where we ignore the ifnet departure event if the
  interface is just being renamed.
  
  PR:   kern/169557
  Submitted by: Mark Johnston
  MFC after:3 days

Modified:
  head/sys/net/if_lagg.c

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Sat Jun 30 18:58:21 2012(r237851)
+++ head/sys/net/if_lagg.c  Sat Jun 30 19:09:02 2012(r237852)
@@ -797,6 +797,9 @@ lagg_port_ifdetach(void *arg __unused, s
 
if ((lp = ifp-if_lagg) == NULL)
return;
+   /* If the ifnet is just being renamed, don't do anything. */
+   if (ifp-if_flags  IFF_RENAMING)
+   return;
 
sc = lp-lp_softc;
 
___
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: r237669 - stable/9/sys/net

2012-06-27 Thread Andrew Thompson
Author: thompsa
Date: Wed Jun 27 22:06:42 2012
New Revision: 237669
URL: http://svn.freebsd.org/changeset/base/237669

Log:
  MFC r236062
  
   Turn LACP debugging from a compile time option to a sysctl, it is very handy 
to
   be able to turn it on when negotiation to a switch misbehaves.

Modified:
  stable/9/sys/net/ieee8023ad_lacp.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/isp/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/net/ieee8023ad_lacp.c
==
--- stable/9/sys/net/ieee8023ad_lacp.c  Wed Jun 27 21:48:56 2012
(r237668)
+++ stable/9/sys/net/ieee8023ad_lacp.c  Wed Jun 27 22:06:42 2012
(r237669)
@@ -38,6 +38,7 @@ __FBSDID($FreeBSD$);
 #include sys/kernel.h /* hz */
 #include sys/socket.h /* for net/if.h */
 #include sys/sockio.h
+#include sys/sysctl.h
 #include machine/stdarg.h
 #include sys/lock.h
 #include sys/rwlock.h
@@ -168,7 +169,8 @@ static void lacp_enable_distributing(str
 static int lacp_xmit_lacpdu(struct lacp_port *);
 static int lacp_xmit_marker(struct lacp_port *);
 
-#if defined(LACP_DEBUG)
+/* Debugging */
+
 static voidlacp_dump_lacpdu(const struct lacpdu *);
 static const char *lacp_format_partner(const struct lacp_peerinfo *, char *,
size_t);
@@ -184,10 +186,14 @@ static const char *lacp_format_portid(co
size_t);
 static voidlacp_dprintf(const struct lacp_port *, const char *, ...)
__attribute__((__format__(__printf__, 2, 3)));
-#defineLACP_DPRINTF(a) lacp_dprintf a
-#else
-#define LACP_DPRINTF(a) /* nothing */
-#endif
+
+static int lacp_debug = 0;
+SYSCTL_INT(_net, OID_AUTO, lacp_debug, CTLFLAG_RW | CTLFLAG_TUN,
+lacp_debug, 0, Enable LACP debug logging (1=debug, 2=trace));
+TUNABLE_INT(net.lacp_debug, lacp_debug);
+
+#define LACP_DPRINTF(a) if (lacp_debug  0) { lacp_dprintf a ; }
+#define LACP_TRACE(a) if (lacp_debug  1) { lacp_dprintf(a,%s\n,__func__); }
 
 /*
  * partner administration variables.
@@ -290,10 +296,10 @@ lacp_pdu_input(struct lacp_port *lp, str
goto bad;
}
 
-#if defined(LACP_DEBUG)
-   LACP_DPRINTF((lp, lacpdu receive\n));
-   lacp_dump_lacpdu(du);
-#endif /* defined(LACP_DEBUG) */
+if (lacp_debug  0) {
+   lacp_dprintf(lp, lacpdu receive\n);
+   lacp_dump_lacpdu(du);
+   }
 
LACP_LOCK(lsc);
lacp_sm_rx(lp, du);
@@ -370,10 +376,10 @@ lacp_xmit_lacpdu(struct lacp_port *lp)
sizeof(du-ldu_collector));
du-ldu_collector.lci_maxdelay = 0;
 
-#if defined(LACP_DEBUG)
-   LACP_DPRINTF((lp, lacpdu transmit\n));
-   lacp_dump_lacpdu(du);
-#endif /* defined(LACP_DEBUG) */
+   if (lacp_debug  0) {
+   lacp_dprintf(lp, lacpdu transmit\n);
+   lacp_dump_lacpdu(du);
+   }
 
m-m_flags |= M_MCAST;
 
@@ -647,9 +653,7 @@ lacp_disable_distributing(struct lacp_po
 {
struct lacp_aggregator *la = lp-lp_aggregator;
struct lacp_softc *lsc = lp-lp_lsc;
-#if defined(LACP_DEBUG)
char buf[LACP_LAGIDSTR_MAX+1];
-#endif /* defined(LACP_DEBUG) */
 
LACP_LOCK_ASSERT(lsc);
 
@@ -684,9 +688,7 @@ lacp_enable_distributing(struct lacp_por
 {
struct lacp_aggregator *la = lp-lp_aggregator;
struct lacp_softc *lsc = lp-lp_lsc;
-#if defined(LACP_DEBUG)
char buf[LACP_LAGIDSTR_MAX+1];
-#endif /* defined(LACP_DEBUG) */
 
LACP_LOCK_ASSERT(lsc);
 
@@ -720,7 +722,8 @@ lacp_transit_expire(void *vp)
 
LACP_LOCK_ASSERT(lsc);
 
-   LACP_DPRINTF((NULL, %s\n, __func__));
+   LACP_TRACE(NULL);
+
lsc-lsc_suppress_distributing = FALSE;
 }
 
@@ -838,7 +841,8 @@ lacp_suppress_distributing(struct lacp_s
return;
}
 
-   LACP_DPRINTF((NULL, %s\n, __func__));
+   LACP_TRACE(NULL);
+
lsc-lsc_suppress_distributing = TRUE;
 
/* send a marker frame down each port to verify the queues are empty */
@@ -908,11 +912,9 @@ lacp_select_active_aggregator(struct lac
struct 

svn commit: r237670 - in stable/9: sbin/ifconfig sys/net

2012-06-27 Thread Andrew Thompson
Author: thompsa
Date: Wed Jun 27 22:09:04 2012
New Revision: 237670
URL: http://svn.freebsd.org/changeset/base/237670

Log:
  MFC r236178
  
   if_lagg: allow to invoke SIOCSLAGGPORT multiple times in a row

Modified:
  stable/9/sbin/ifconfig/iflagg.c
  stable/9/sys/net/if_lagg.c
Directory Properties:
  stable/9/sbin/ifconfig/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/isp/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sbin/ifconfig/iflagg.c
==
--- stable/9/sbin/ifconfig/iflagg.c Wed Jun 27 22:06:42 2012
(r237669)
+++ stable/9/sbin/ifconfig/iflagg.c Wed Jun 27 22:09:04 2012
(r237670)
@@ -40,7 +40,8 @@ setlaggport(const char *val, int d, int 
strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname));
strlcpy(rp.rp_portname, val, sizeof(rp.rp_portname));
 
-   if (ioctl(s, SIOCSLAGGPORT, rp))
+   /* Don't choke if the port is already in this lagg. */
+   if (ioctl(s, SIOCSLAGGPORT, rp)  errno != EEXIST)
err(1, SIOCSLAGGPORT);
 }
 

Modified: stable/9/sys/net/if_lagg.c
==
--- stable/9/sys/net/if_lagg.c  Wed Jun 27 22:06:42 2012(r237669)
+++ stable/9/sys/net/if_lagg.c  Wed Jun 27 22:09:04 2012(r237670)
@@ -516,8 +516,13 @@ lagg_port_create(struct lagg_softc *sc, 
return (ENOSPC);
 
/* Check if port has already been associated to a lagg */
-   if (ifp-if_lagg != NULL)
+   if (ifp-if_lagg != NULL) {
+   /* Port is already in the current lagg? */
+   lp = (struct lagg_port *)ifp-if_lagg;
+   if (lp-lp_softc == sc)
+   return (EEXIST);
return (EBUSY);
+   }
 
/* XXX Disallow non-ethernet interfaces (this should be any of 802) */
if (ifp-if_type != IFT_ETHER)
___
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: r237671 - stable/9/usr.bin/sockstat

2012-06-27 Thread Andrew Thompson
Author: thompsa
Date: Wed Jun 27 22:11:31 2012
New Revision: 237671
URL: http://svn.freebsd.org/changeset/base/237671

Log:
  MFC r235870
  
   Allow the socket list to be limited to a specific jail id.

Modified:
  stable/9/usr.bin/sockstat/sockstat.1
  stable/9/usr.bin/sockstat/sockstat.c
Directory Properties:
  stable/9/usr.bin/sockstat/   (props changed)

Modified: stable/9/usr.bin/sockstat/sockstat.1
==
--- stable/9/usr.bin/sockstat/sockstat.1Wed Jun 27 22:09:04 2012
(r237670)
+++ stable/9/usr.bin/sockstat/sockstat.1Wed Jun 27 22:11:31 2012
(r237671)
@@ -27,7 +27,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd January 24, 2012
+.Dd May 16, 2012
 .Dt SOCKSTAT 1
 .Os
 .Sh NAME
@@ -36,6 +36,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl 46cLlu
+.Op Fl j Ar jid
 .Op Fl p Ar ports
 .Op Fl P Ar protocols
 .Sh DESCRIPTION
@@ -57,6 +58,8 @@ Show
 (IPv6) sockets.
 .It Fl c
 Show connected sockets.
+.It Fl j Ar jid
+Show only sockets belonging to the specified jail ID.
 .It Fl L
 Only show Internet sockets if the local or foreign addresses are not
 in the loopback network prefix

Modified: stable/9/usr.bin/sockstat/sockstat.c
==
--- stable/9/usr.bin/sockstat/sockstat.cWed Jun 27 22:09:04 2012
(r237670)
+++ stable/9/usr.bin/sockstat/sockstat.cWed Jun 27 22:11:31 2012
(r237671)
@@ -62,6 +62,7 @@ __FBSDID($FreeBSD$);
 static int  opt_4; /* Show IPv4 sockets */
 static int  opt_6; /* Show IPv6 sockets */
 static int  opt_c; /* Show connected sockets */
+static int  opt_j; /* Show specified jail */
 static int  opt_L; /* Don't show IPv4 or IPv6 loopback sockets */
 static int  opt_l; /* Show listening sockets */
 static int  opt_u; /* Show Unix domain sockets */
@@ -549,6 +550,27 @@ getprocname(pid_t pid)
 }
 
 static int
+getprocjid(pid_t pid)
+{
+   static struct kinfo_proc proc;
+   size_t len;
+   int mib[4];
+
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_PROC;
+   mib[2] = KERN_PROC_PID;
+   mib[3] = (int)pid;
+   len = sizeof proc;
+   if (sysctl(mib, 4, proc, len, NULL, 0) == -1) {
+   /* Do not warn if the process exits before we get its jid. */
+   if (errno != ESRCH)
+   warn(sysctl());
+   return (-1);
+   }
+   return (proc.ki_jid);
+}
+
+static int
 check_ports(struct sock *s)
 {
int port;
@@ -643,6 +665,8 @@ display(void)
for (xf = xfiles, n = 0; n  nxfiles; ++n, ++xf) {
if (xf-xf_data == NULL)
continue;
+   if (opt_j = 0  opt_j != getprocjid(xf-xf_pid))
+   continue;
hash = (int)((uintptr_t)xf-xf_data % HASHSIZE);
for (s = sockhash[hash]; s != NULL; s = s-next)
if ((void *)s-socket == xf-xf_data)
@@ -668,6 +692,8 @@ display(void)
pos += xprintf(%d , xf-xf_fd);
displaysock(s, pos);
}
+   if (opt_j = 0)
+   return;
for (hash = 0; hash  HASHSIZE; hash++) {
for (s = sockhash[hash]; s != NULL; s = s-next) {
if (s-shown)
@@ -716,7 +742,8 @@ main(int argc, char *argv[])
int protos_defined = -1;
int o, i;
 
-   while ((o = getopt(argc, argv, 46cLlp:P:uv)) != -1)
+   opt_j = -1;
+   while ((o = getopt(argc, argv, 46cj:Llp:P:uv)) != -1)
switch (o) {
case '4':
opt_4 = 1;
@@ -727,6 +754,9 @@ main(int argc, char *argv[])
case 'c':
opt_c = 1;
break;
+   case 'j':
+   opt_j = atoi(optarg);
+   break;
case 'L':
opt_L = 1;
break;
___
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: r237672 - stable/8/usr.bin/sockstat

2012-06-27 Thread Andrew Thompson
Author: thompsa
Date: Wed Jun 27 22:13:40 2012
New Revision: 237672
URL: http://svn.freebsd.org/changeset/base/237672

Log:
  MFC r235870
  
   Allow the socket list to be limited to a specific jail id.

Modified:
  stable/8/usr.bin/sockstat/sockstat.1
  stable/8/usr.bin/sockstat/sockstat.c
Directory Properties:
  stable/8/usr.bin/sockstat/   (props changed)

Modified: stable/8/usr.bin/sockstat/sockstat.1
==
--- stable/8/usr.bin/sockstat/sockstat.1Wed Jun 27 22:11:31 2012
(r237671)
+++ stable/8/usr.bin/sockstat/sockstat.1Wed Jun 27 22:13:40 2012
(r237672)
@@ -27,7 +27,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd January 24, 2012
+.Dd May 16, 2012
 .Dt SOCKSTAT 1
 .Os
 .Sh NAME
@@ -36,6 +36,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl 46cLlu
+.Op Fl j Ar jid
 .Op Fl p Ar ports
 .Op Fl P Ar protocols
 .Sh DESCRIPTION
@@ -57,6 +58,8 @@ Show
 (IPv6) sockets.
 .It Fl c
 Show connected sockets.
+.It Fl j Ar jid
+Show only sockets belonging to the specified jail ID.
 .It Fl L
 Only show Internet sockets if the local or foreign addresses are not
 in the loopback network prefix

Modified: stable/8/usr.bin/sockstat/sockstat.c
==
--- stable/8/usr.bin/sockstat/sockstat.cWed Jun 27 22:11:31 2012
(r237671)
+++ stable/8/usr.bin/sockstat/sockstat.cWed Jun 27 22:13:40 2012
(r237672)
@@ -62,6 +62,7 @@ __FBSDID($FreeBSD$);
 static int  opt_4; /* Show IPv4 sockets */
 static int  opt_6; /* Show IPv6 sockets */
 static int  opt_c; /* Show connected sockets */
+static int  opt_j; /* Show specified jail */
 static int  opt_L; /* Don't show IPv4 or IPv6 loopback sockets */
 static int  opt_l; /* Show listening sockets */
 static int  opt_u; /* Show Unix domain sockets */
@@ -549,6 +550,27 @@ getprocname(pid_t pid)
 }
 
 static int
+getprocjid(pid_t pid)
+{
+   static struct kinfo_proc proc;
+   size_t len;
+   int mib[4];
+
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_PROC;
+   mib[2] = KERN_PROC_PID;
+   mib[3] = (int)pid;
+   len = sizeof proc;
+   if (sysctl(mib, 4, proc, len, NULL, 0) == -1) {
+   /* Do not warn if the process exits before we get its jid. */
+   if (errno != ESRCH)
+   warn(sysctl());
+   return (-1);
+   }
+   return (proc.ki_jid);
+}
+
+static int
 check_ports(struct sock *s)
 {
int port;
@@ -643,6 +665,8 @@ display(void)
for (xf = xfiles, n = 0; n  nxfiles; ++n, ++xf) {
if (xf-xf_data == NULL)
continue;
+   if (opt_j = 0  opt_j != getprocjid(xf-xf_pid))
+   continue;
hash = (int)((uintptr_t)xf-xf_data % HASHSIZE);
for (s = sockhash[hash]; s != NULL; s = s-next)
if ((void *)s-socket == xf-xf_data)
@@ -668,6 +692,8 @@ display(void)
pos += xprintf(%d , xf-xf_fd);
displaysock(s, pos);
}
+   if (opt_j = 0)
+   return;
for (hash = 0; hash  HASHSIZE; hash++) {
for (s = sockhash[hash]; s != NULL; s = s-next) {
if (s-shown)
@@ -716,7 +742,8 @@ main(int argc, char *argv[])
int protos_defined = -1;
int o, i;
 
-   while ((o = getopt(argc, argv, 46cLlp:P:uv)) != -1)
+   opt_j = -1;
+   while ((o = getopt(argc, argv, 46cj:Llp:P:uv)) != -1)
switch (o) {
case '4':
opt_4 = 1;
@@ -727,6 +754,9 @@ main(int argc, char *argv[])
case 'c':
opt_c = 1;
break;
+   case 'j':
+   opt_j = atoi(optarg);
+   break;
case 'L':
opt_L = 1;
break;
___
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: r237103 - stable/9/sys/net

2012-06-14 Thread Andrew Thompson
Author: thompsa
Date: Thu Jun 14 21:35:20 2012
New Revision: 237103
URL: http://svn.freebsd.org/changeset/base/237103

Log:
  MFC r236916
  
   Fix a panic I introduced in r234487, the bridge softc pointer is set to null
   early in the detach so rearrange things not to explode.
  
  Reported by:  David Roffiaen, Gustau Perez Querol

Modified:
  stable/9/sys/net/if_bridge.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/net/if_bridge.c
==
--- stable/9/sys/net/if_bridge.cThu Jun 14 21:16:19 2012
(r237102)
+++ stable/9/sys/net/if_bridge.cThu Jun 14 21:35:20 2012
(r237103)
@@ -334,6 +334,7 @@ static int  bridge_ip6_checkbasic(struct 
 static int bridge_fragment(struct ifnet *, struct mbuf *,
struct ether_header *, int, struct llc *);
 static voidbridge_linkstate(struct ifnet *ifp);
+static voidbridge_linkcheck(struct bridge_softc *sc);
 
 extern void (*bridge_linkstate_p)(struct ifnet *ifp);
 
@@ -964,6 +965,7 @@ bridge_delete_member(struct bridge_softc
EVENTHANDLER_INVOKE(iflladdr_event, sc-sc_ifp);
}
 
+   bridge_linkcheck(sc);
bridge_mutecaps(sc);/* recalcuate now this interface is removed */
bridge_rtdelete(sc, ifs, IFBF_FLUSHALL);
KASSERT(bif-bif_addrcnt == 0,
@@ -993,7 +995,6 @@ bridge_delete_member(struct bridge_softc
bridge_set_ifcap(sc, bif, bif-bif_savedcaps);
}
bstp_destroy(bif-bif_stp);/* prepare to free */
-   bridge_linkstate(ifs);
BRIDGE_LOCK(sc);
free(bif, M_DEVBUF);
 }
@@ -1092,18 +1093,17 @@ bridge_ioctl_add(struct bridge_softc *sc
 
/* Set interface capabilities to the intersection set of all members */
bridge_mutecaps(sc);
+   bridge_linkcheck(sc);
 
-   BRIDGE_UNLOCK(sc);
-   /* Update the linkstate for the bridge */
-   bridge_linkstate(ifs);
/* Place the interface into promiscuous mode */
switch (ifs-if_type) {
case IFT_ETHER:
case IFT_L2VLAN:
+   BRIDGE_UNLOCK(sc);
error = ifpromisc(ifs, 1);
+   BRIDGE_LOCK(sc);
break;
}
-   BRIDGE_LOCK(sc);
if (error)
bridge_delete_member(sc, bif, 0);
 out:
@@ -3486,8 +3486,7 @@ static void
 bridge_linkstate(struct ifnet *ifp)
 {
struct bridge_softc *sc = ifp-if_bridge;
-   struct bridge_iflist *bif, *bif2;
-   int new_link, hasls;
+   struct bridge_iflist *bif;
 
BRIDGE_LOCK(sc);
bif = bridge_lookup_member_if(sc, ifp);
@@ -3495,13 +3494,26 @@ bridge_linkstate(struct ifnet *ifp)
BRIDGE_UNLOCK(sc);
return;
}
+   bridge_linkcheck(sc);
+   BRIDGE_UNLOCK(sc);
+
+   bstp_linkstate(bif-bif_stp);
+}
+
+static void
+bridge_linkcheck(struct bridge_softc *sc)
+{
+   struct bridge_iflist *bif;
+   int new_link, hasls;
+
+   BRIDGE_LOCK_ASSERT(sc);
new_link = LINK_STATE_DOWN;
hasls = 0;
/* Our link is considered up if at least one of our ports is active */
-   LIST_FOREACH(bif2, sc-sc_iflist, bif_next) {
-   if (bif2-bif_ifp-if_capabilities  IFCAP_LINKSTATE)
+   LIST_FOREACH(bif, sc-sc_iflist, bif_next) {
+   if (bif-bif_ifp-if_capabilities  IFCAP_LINKSTATE)
hasls++;
-   if (bif2-bif_ifp-if_link_state == LINK_STATE_UP) {
+   if (bif-bif_ifp-if_link_state == LINK_STATE_UP) {
new_link = LINK_STATE_UP;
break;
}
@@ -3511,8 +3523,4 @@ bridge_linkstate(struct ifnet *ifp)
new_link = LINK_STATE_UP;
}
if_link_state_change(sc-sc_ifp, new_link);
-   BRIDGE_UNLOCK(sc);
-
-   bstp_linkstate(bif-bif_stp);
 }
-
___
svn-src-all@freebsd.org mailing list

svn commit: r237104 - in stable/8/sys: net netinet

2012-06-14 Thread Andrew Thompson
Author: thompsa
Date: Thu Jun 14 21:36:16 2012
New Revision: 237104
URL: http://svn.freebsd.org/changeset/base/237104

Log:
  MFC r236916
  
   Fix a panic I introduced in r234487, the bridge softc pointer is set to null
   early in the detach so rearrange things not to explode.
  
  Reported by:  David Roffiaen, Gustau Perez Querol

Modified:
  stable/8/sys/net/if_bridge.c
  stable/8/sys/netinet/ip_carp.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/net/if_bridge.c
==
--- stable/8/sys/net/if_bridge.cThu Jun 14 21:35:20 2012
(r237103)
+++ stable/8/sys/net/if_bridge.cThu Jun 14 21:36:16 2012
(r237104)
@@ -334,6 +334,7 @@ static int  bridge_ip6_checkbasic(struct 
 static int bridge_fragment(struct ifnet *, struct mbuf *,
struct ether_header *, int, struct llc *);
 static voidbridge_linkstate(struct ifnet *ifp);
+static voidbridge_linkcheck(struct bridge_softc *sc);
 
 extern void (*bridge_linkstate_p)(struct ifnet *ifp);
 
@@ -964,6 +965,7 @@ bridge_delete_member(struct bridge_softc
EVENTHANDLER_INVOKE(iflladdr_event, sc-sc_ifp);
}
 
+   bridge_linkcheck(sc);
bridge_mutecaps(sc);/* recalcuate now this interface is removed */
bridge_rtdelete(sc, ifs, IFBF_FLUSHALL);
KASSERT(bif-bif_addrcnt == 0,
@@ -993,7 +995,6 @@ bridge_delete_member(struct bridge_softc
bridge_set_ifcap(sc, bif, bif-bif_savedcaps);
}
bstp_destroy(bif-bif_stp);/* prepare to free */
-   bridge_linkstate(ifs);
BRIDGE_LOCK(sc);
free(bif, M_DEVBUF);
 }
@@ -1092,18 +1093,17 @@ bridge_ioctl_add(struct bridge_softc *sc
 
/* Set interface capabilities to the intersection set of all members */
bridge_mutecaps(sc);
+   bridge_linkcheck(sc);
 
-   BRIDGE_UNLOCK(sc);
-   /* Update the linkstate for the bridge */
-   bridge_linkstate(ifs);
/* Place the interface into promiscuous mode */
switch (ifs-if_type) {
case IFT_ETHER:
case IFT_L2VLAN:
+   BRIDGE_UNLOCK(sc);
error = ifpromisc(ifs, 1);
+   BRIDGE_LOCK(sc);
break;
}
-   BRIDGE_LOCK(sc);
if (error)
bridge_delete_member(sc, bif, 0);
 out:
@@ -3485,8 +3485,7 @@ static void
 bridge_linkstate(struct ifnet *ifp)
 {
struct bridge_softc *sc = ifp-if_bridge;
-   struct bridge_iflist *bif, *bif2;
-   int new_link, hasls;
+   struct bridge_iflist *bif;
 
BRIDGE_LOCK(sc);
bif = bridge_lookup_member_if(sc, ifp);
@@ -3494,13 +3493,26 @@ bridge_linkstate(struct ifnet *ifp)
BRIDGE_UNLOCK(sc);
return;
}
+   bridge_linkcheck(sc);
+   BRIDGE_UNLOCK(sc);
+
+   bstp_linkstate(bif-bif_stp);
+}
+
+static void
+bridge_linkcheck(struct bridge_softc *sc)
+{
+   struct bridge_iflist *bif;
+   int new_link, hasls;
+
+   BRIDGE_LOCK_ASSERT(sc);
new_link = LINK_STATE_DOWN;
hasls = 0;
/* Our link is considered up if at least one of our ports is active */
-   LIST_FOREACH(bif2, sc-sc_iflist, bif_next) {
-   if (bif2-bif_ifp-if_capabilities  IFCAP_LINKSTATE)
+   LIST_FOREACH(bif, sc-sc_iflist, bif_next) {
+   if (bif-bif_ifp-if_capabilities  IFCAP_LINKSTATE)
hasls++;
-   if (bif2-bif_ifp-if_link_state == LINK_STATE_UP) {
+   if (bif-bif_ifp-if_link_state == LINK_STATE_UP) {
new_link = LINK_STATE_UP;
break;
}
@@ -3510,8 +3522,4 @@ bridge_linkstate(struct ifnet *ifp)
new_link = LINK_STATE_UP;
}
if_link_state_change(sc-sc_ifp, new_link);
-   BRIDGE_UNLOCK(sc);
-
-   bstp_linkstate(bif-bif_stp);
 }
-

Modified: stable/8/sys/netinet/ip_carp.c
==
--- stable/8/sys/netinet/ip_carp.c  Thu Jun 14 21:35:20 2012
(r237103)
+++ stable/8/sys/netinet/ip_carp.c  Thu Jun 14 21:36:16 2012
(r237104)
@@ -100,6 +100,7 @@ struct carp_softc {
 #ifdef INET6
struct in6_ifaddr   *sc_ia6;/* primary iface address v6 */
struct ip6_moptions  sc_im6o;
+   struct in6_ifaddr   *sc_llia;
 #endif /* INET6 */
TAILQ_ENTRY(carp_softc)  sc_list;
 
@@ -1239,6 +1240,16 @@ carp_iamatch6(struct ifnet *ifp, struct 
cif = ifp-if_carp;

svn commit: r237105 - stable/8/sys/netinet

2012-06-14 Thread Andrew Thompson
Author: thompsa
Date: Thu Jun 14 21:40:14 2012
New Revision: 237105
URL: http://svn.freebsd.org/changeset/base/237105

Log:
  Revert an inintended change in r237104

Modified:
  stable/8/sys/netinet/ip_carp.c

Modified: stable/8/sys/netinet/ip_carp.c
==
--- stable/8/sys/netinet/ip_carp.c  Thu Jun 14 21:36:16 2012
(r237104)
+++ stable/8/sys/netinet/ip_carp.c  Thu Jun 14 21:40:14 2012
(r237105)
@@ -100,7 +100,6 @@ struct carp_softc {
 #ifdef INET6
struct in6_ifaddr   *sc_ia6;/* primary iface address v6 */
struct ip6_moptions  sc_im6o;
-   struct in6_ifaddr   *sc_llia;
 #endif /* INET6 */
TAILQ_ENTRY(carp_softc)  sc_list;
 
@@ -1240,16 +1239,6 @@ carp_iamatch6(struct ifnet *ifp, struct 
cif = ifp-if_carp;
CARP_LOCK(cif);
TAILQ_FOREACH(vh, cif-vhif_vrs, sc_list) {
-   if (IN6_ARE_ADDR_EQUAL(taddr,
-   vh-sc_llia-ia_addr.sin6_addr) 
-   (SC2IFP(vh)-if_flags  IFF_UP) 
-   (SC2IFP(vh)-if_drv_flags  IFF_DRV_RUNNING) 
-   vh-sc_state == MASTER) {
-   ifa = vh-sc_llia-ia_addr;
-   ifa_ref(ifa);
-   CARP_UNLOCK(cif);
-   return (ifa);
-   }
IF_ADDR_RLOCK(SC2IFP(vh));
TAILQ_FOREACH(ifa, SC2IFP(vh)-if_addrlist, ifa_list) {
if (IN6_ARE_ADDR_EQUAL(taddr,
@@ -1281,28 +1270,6 @@ carp_macmatch6(struct ifnet *ifp, struct
cif = ifp-if_carp;
CARP_LOCK(cif);
TAILQ_FOREACH(sc, cif-vhif_vrs, sc_list) {
-   if (IN6_ARE_ADDR_EQUAL(taddr,
-   sc-sc_llia-ia_addr.sin6_addr) 
-   (SC2IFP(sc)-if_flags  IFF_UP) 
-   (SC2IFP(sc)-if_drv_flags  IFF_DRV_RUNNING) 
-   sc-sc_state == MASTER) {
-   struct ifnet *ifp = SC2IFP(sc);
-   mtag = m_tag_get(PACKET_TAG_CARP,
-   sizeof(struct ifnet *), M_NOWAIT);
-   if (mtag == NULL) {
-   /* better a bit than nothing */
-   IF_ADDR_RUNLOCK(SC2IFP(sc));
-   CARP_UNLOCK(cif);
-   return (IF_LLADDR(sc-sc_ifp));
-   }
-   bcopy(ifp, (caddr_t)(mtag + 1),
-   sizeof(struct ifnet *));
-   m_tag_prepend(m, mtag);
-
-   IF_ADDR_RUNLOCK(SC2IFP(sc));
-   CARP_UNLOCK(cif);
-   return (IF_LLADDR(sc-sc_ifp));
-   }
IF_ADDR_RLOCK(SC2IFP(sc));
TAILQ_FOREACH(ifa, SC2IFP(sc)-if_addrlist, ifa_list) {
if (IN6_ARE_ADDR_EQUAL(taddr,
@@ -1782,33 +1749,6 @@ carp_set_addr6(struct carp_softc *sc, st
goto cleanup;
im6o-im6o_membership[1] = in6m;
im6o-im6o_num_memberships++;
-
-   /* Add link local */
-   bzero(ifra, sizeof(ifra));
-   ifra.ifra_addr.sin6_family = AF_INET6;
-   ifra.ifra_addr.sin6_len = sizeof(struct sockaddr_in6);
-   ifra.ifra_addr.sin6_addr.s6_addr32[0] = htonl(0xfe80);
-   ifra.ifra_addr.sin6_addr.s6_addr32[1] = 0;
-   if ((error = in6_get_hw_ifid(sc-sc_ifp, NULL, 
ifra.ifra_addr.sin6_addr)) != 0)
-   goto cleanup;
-   if ((error = in6_setscope(ifra.ifra_addr.sin6_addr, ifp, 
NULL)))
-   goto cleanup;
-   ifra.ifra_prefixmask.sin6_len = sizeof(struct sockaddr_in6);
-   ifra.ifra_prefixmask.sin6_family = AF_INET6;
-   ifra.ifra_prefixmask.sin6_addr = in6mask64;
-   /* link-local addresses should NEVER expire. */
-   ifra.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;
-   ifra.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
-
-   if ((error = in6_update_ifa(ifp, ifra, NULL,
-   IN6_IFAUPDATE_DADDELAY)) != 0)
-   goto cleanup;
-   sc-sc_llia = in6ifa_ifpwithaddr(ifp, 
ifra-ifra_addr.sin6_addr);
-   if (sc-sc_llia == NULL) {
-   error = ESRCH;
-   goto cleanup;
-   }
-   ifa_free(sc-sc_llia-ia_ifa);
}
 
if (!ifp-if_carp) {
___
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: r236916 - head/sys/net

2012-06-11 Thread Andrew Thompson
Author: thompsa
Date: Mon Jun 11 20:12:13 2012
New Revision: 236916
URL: http://svn.freebsd.org/changeset/base/236916

Log:
  Fix a panic I introduced in r234487, the bridge softc pointer is set to null
  early in the detach so rearrange things not to explode.
  
  Reported by:  David Roffiaen, Gustau Perez Querol
  Tested by:David Roffiaen
  MFC after:3 days

Modified:
  head/sys/net/if_bridge.c

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cMon Jun 11 20:01:50 2012(r236915)
+++ head/sys/net/if_bridge.cMon Jun 11 20:12:13 2012(r236916)
@@ -334,6 +334,7 @@ static int  bridge_ip6_checkbasic(struct 
 static int bridge_fragment(struct ifnet *, struct mbuf *,
struct ether_header *, int, struct llc *);
 static voidbridge_linkstate(struct ifnet *ifp);
+static voidbridge_linkcheck(struct bridge_softc *sc);
 
 extern void (*bridge_linkstate_p)(struct ifnet *ifp);
 
@@ -964,6 +965,7 @@ bridge_delete_member(struct bridge_softc
EVENTHANDLER_INVOKE(iflladdr_event, sc-sc_ifp);
}
 
+   bridge_linkcheck(sc);
bridge_mutecaps(sc);/* recalcuate now this interface is removed */
bridge_rtdelete(sc, ifs, IFBF_FLUSHALL);
KASSERT(bif-bif_addrcnt == 0,
@@ -993,7 +995,6 @@ bridge_delete_member(struct bridge_softc
bridge_set_ifcap(sc, bif, bif-bif_savedcaps);
}
bstp_destroy(bif-bif_stp);/* prepare to free */
-   bridge_linkstate(ifs);
BRIDGE_LOCK(sc);
free(bif, M_DEVBUF);
 }
@@ -1092,18 +1093,17 @@ bridge_ioctl_add(struct bridge_softc *sc
 
/* Set interface capabilities to the intersection set of all members */
bridge_mutecaps(sc);
+   bridge_linkcheck(sc);
 
-   BRIDGE_UNLOCK(sc);
-   /* Update the linkstate for the bridge */
-   bridge_linkstate(ifs);
/* Place the interface into promiscuous mode */
switch (ifs-if_type) {
case IFT_ETHER:
case IFT_L2VLAN:
+   BRIDGE_UNLOCK(sc);
error = ifpromisc(ifs, 1);
+   BRIDGE_LOCK(sc);
break;
}
-   BRIDGE_LOCK(sc);
if (error)
bridge_delete_member(sc, bif, 0);
 out:
@@ -3486,8 +3486,7 @@ static void
 bridge_linkstate(struct ifnet *ifp)
 {
struct bridge_softc *sc = ifp-if_bridge;
-   struct bridge_iflist *bif, *bif2;
-   int new_link, hasls;
+   struct bridge_iflist *bif;
 
BRIDGE_LOCK(sc);
bif = bridge_lookup_member_if(sc, ifp);
@@ -3495,13 +3494,26 @@ bridge_linkstate(struct ifnet *ifp)
BRIDGE_UNLOCK(sc);
return;
}
+   bridge_linkcheck(sc);
+   BRIDGE_UNLOCK(sc);
+
+   bstp_linkstate(bif-bif_stp);
+}
+
+static void
+bridge_linkcheck(struct bridge_softc *sc)
+{
+   struct bridge_iflist *bif;
+   int new_link, hasls;
+
+   BRIDGE_LOCK_ASSERT(sc);
new_link = LINK_STATE_DOWN;
hasls = 0;
/* Our link is considered up if at least one of our ports is active */
-   LIST_FOREACH(bif2, sc-sc_iflist, bif_next) {
-   if (bif2-bif_ifp-if_capabilities  IFCAP_LINKSTATE)
+   LIST_FOREACH(bif, sc-sc_iflist, bif_next) {
+   if (bif-bif_ifp-if_capabilities  IFCAP_LINKSTATE)
hasls++;
-   if (bif2-bif_ifp-if_link_state == LINK_STATE_UP) {
+   if (bif-bif_ifp-if_link_state == LINK_STATE_UP) {
new_link = LINK_STATE_UP;
break;
}
@@ -3511,8 +3523,4 @@ bridge_linkstate(struct ifnet *ifp)
new_link = LINK_STATE_UP;
}
if_link_state_change(sc-sc_ifp, new_link);
-   BRIDGE_UNLOCK(sc);
-
-   bstp_linkstate(bif-bif_stp);
 }
-
___
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: r234712 - in head: lib/libc/sys usr.sbin/jail

2012-06-06 Thread Andrew Thompson
On 27 April 2012 05:36, Jamie Gritton ja...@freebsd.org wrote:
 Author: jamie
 Date: Thu Apr 26 17:36:05 2012
 New Revision: 234712
 URL: http://svn.freebsd.org/changeset/base/234712

 Log:
  A new jail(8) with a configuration file, ultimately to replace the work
  currently done by /etc/rc.d/jail.


Is there any further information about this? Is this going to be
hooked in to rc.conf?

regards,
Andrew
___
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: r236593 - head/share/man/man4

2012-06-04 Thread Andrew Thompson
On 5 June 2012 10:59, David E. O'Brien obr...@freebsd.org wrote:
 Author: obrien
 Date: Mon Jun  4 22:59:06 2012
 New Revision: 236593
 URL: http://svn.freebsd.org/changeset/base/236593

 Log:
  Add a man page for filemon(4) [r236592].

 +static void
 +open_filemon(void)
 +{
 +
 +       if ((child = fork()) == 0) {
 +               /* Do something here. */
 +               return 0;
 +       } else {
 +               if (ioctl(fm_fd, FILEMON_SET_PID, child)  0)
 +                       err(1, Cannot set filemon PID);
 +               wait(child);
 +               close(fm_fd);
 +       }
 +       return 0;

Does the race have to be managed between the parent SET_PID ioctl and
the child doing something?


Andrew
___
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: r228571 - in head: . lib/libc/net sbin/ifconfig share/man/man4 sys/net sys/netinet sys/netinet6 sys/sys

2012-05-29 Thread Andrew Thompson
On 17 December 2011 01:16, Gleb Smirnoff gleb...@freebsd.org wrote:
 Author: glebius
 Date: Fri Dec 16 12:16:56 2011
 New Revision: 228571
 URL: http://svn.freebsd.org/changeset/base/228571

 Log:
  A major overhaul of the CARP implementation. The ip_carp.c was started
  from scratch, copying needed functionality from the old implemenation
  on demand, with a thorough review of all code. The main change is that
  interface layer has been removed from the CARP. Now redundant addresses
  are configured exactly on the interfaces, they run on.

This commit seems to have a mistake in the PACKET_TAG_CARP mtag
handling. carp_macmatch6() places the ifp pointer on the tag while
carp_output() dereferences it as a softc.


Andrew
___
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: r236047 - stable/9/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 07:34:46 2012
New Revision: 236047
URL: http://svn.freebsd.org/changeset/base/236047

Log:
  MFC r232014,r232030,r232070
  
  - bstp_input() always consumes the packet so remove the mbuf handling dance
around it.
  - Now that network interfaces advertise if they support linkstate 
notifications
we do not need to perform a media ioctl every 15 seconds.
  - Indicate this function decrements the timer as well as testing for expiry.

Modified:
  stable/9/sys/net/bridgestp.c
  stable/9/sys/net/bridgestp.h
  stable/9/sys/net/if_bridge.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/net/bridgestp.c
==
--- stable/9/sys/net/bridgestp.cSat May 26 06:31:54 2012
(r236046)
+++ stable/9/sys/net/bridgestp.cSat May 26 07:34:46 2012
(r236047)
@@ -134,7 +134,7 @@ static void bstp_tick(void *);
 static voidbstp_timer_start(struct bstp_timer *, uint16_t);
 static voidbstp_timer_stop(struct bstp_timer *);
 static voidbstp_timer_latch(struct bstp_timer *);
-static int bstp_timer_expired(struct bstp_timer *);
+static int bstp_timer_dectest(struct bstp_timer *);
 static voidbstp_hello_timer_expiry(struct bstp_state *,
struct bstp_port *);
 static voidbstp_message_age_expiry(struct bstp_state *,
@@ -446,7 +446,7 @@ bstp_pdu_flags(struct bstp_port *bp)
return (flags);
 }
 
-struct mbuf *
+void
 bstp_input(struct bstp_port *bp, struct ifnet *ifp, struct mbuf *m)
 {
struct bstp_state *bs = bp-bp_bs;
@@ -456,7 +456,7 @@ bstp_input(struct bstp_port *bp, struct 
 
if (bp-bp_active == 0) {
m_freem(m);
-   return (NULL);
+   return;
}
 
BSTP_LOCK(bs);
@@ -521,7 +521,6 @@ out:
BSTP_UNLOCK(bs);
if (m)
m_freem(m);
-   return (NULL);
 }
 
 static void
@@ -1862,30 +1861,32 @@ bstp_tick(void *arg)
 
CURVNET_SET(bs-bs_vnet);
 
-   /* slow timer to catch missed link events */
-   if (bstp_timer_expired(bs-bs_link_timer)) {
-   LIST_FOREACH(bp, bs-bs_bplist, bp_next)
-   bstp_ifupdstatus(bs, bp);
+   /* poll link events on interfaces that do not support linkstate */
+   if (bstp_timer_dectest(bs-bs_link_timer)) {
+   LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
+   if (!(bp-bp_ifp-if_capabilities  IFCAP_LINKSTATE))
+   bstp_ifupdstatus(bs, bp);
+   }
bstp_timer_start(bs-bs_link_timer, BSTP_LINK_TIMER);
}
 
LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
/* no events need to happen for these */
-   bstp_timer_expired(bp-bp_tc_timer);
-   bstp_timer_expired(bp-bp_recent_root_timer);
-   bstp_timer_expired(bp-bp_forward_delay_timer);
-   bstp_timer_expired(bp-bp_recent_backup_timer);
+   bstp_timer_dectest(bp-bp_tc_timer);
+   bstp_timer_dectest(bp-bp_recent_root_timer);
+   bstp_timer_dectest(bp-bp_forward_delay_timer);
+   bstp_timer_dectest(bp-bp_recent_backup_timer);
 
-   if (bstp_timer_expired(bp-bp_hello_timer))
+   if (bstp_timer_dectest(bp-bp_hello_timer))
bstp_hello_timer_expiry(bs, bp);
 
-   if (bstp_timer_expired(bp-bp_message_age_timer))
+   if (bstp_timer_dectest(bp-bp_message_age_timer))
bstp_message_age_expiry(bs, bp);
 
-   if (bstp_timer_expired(bp-bp_migrate_delay_timer))
+   if (bstp_timer_dectest(bp-bp_migrate_delay_timer))
bstp_migrate_delay_expiry(bs, bp);
 
-   if (bstp_timer_expired(bp-bp_edge_delay_timer))
+   if (bstp_timer_dectest(bp-bp_edge_delay_timer))
bstp_edge_delay_expiry(bs, bp);
 
/* update the various state machines for the port */
@@ 

svn commit: r236048 - stable/9/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 07:35:44 2012
New Revision: 236048
URL: http://svn.freebsd.org/changeset/base/236048

Log:
  MFC r232118
  
   Only look for a usable MAC address for the bridge ID from ports within our
   bridge, this allows us to have more than one independent bridge in the same
   STP domain.
  
  PR:   kern/164369
  Submitted by: Nikos Vassiliadis (earlier version)

Modified:
  stable/9/sys/net/bridgestp.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/net/bridgestp.c
==
--- stable/9/sys/net/bridgestp.cSat May 26 07:34:46 2012
(r236047)
+++ stable/9/sys/net/bridgestp.cSat May 26 07:35:44 2012
(r236048)
@@ -2013,24 +2013,33 @@ bstp_reinit(struct bstp_state *bs)
struct bstp_port *bp;
struct ifnet *ifp, *mif;
u_char *e_addr;
+   void *bridgeptr;
static const u_char llzero[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */
 
BSTP_LOCK_ASSERT(bs);
 
+   if (LIST_EMPTY(bs-bs_bplist))
+   goto disablestp;
+
mif = NULL;
+   bridgeptr = LIST_FIRST(bs-bs_bplist)-bp_ifp-if_bridge;
+   KASSERT(bridgeptr != NULL, (Invalid bridge pointer));
/*
 * Search through the Ethernet adapters and find the one with the
-* lowest value. The adapter which we take the MAC address from does
-* not need to be part of the bridge, it just needs to be a unique
-* value.
+* lowest value. Make sure the adapter which we take the MAC address
+* from is part of this bridge, so we can have more than one independent
+* bridges in the same STP domain.
 */
IFNET_RLOCK_NOSLEEP();
TAILQ_FOREACH(ifp, V_ifnet, if_link) {
if (ifp-if_type != IFT_ETHER)
-   continue;
+   continue;   /* Not Ethernet */
+
+   if (ifp-if_bridge != bridgeptr)
+   continue;   /* Not part of our bridge */
 
if (bstp_addr_cmp(IF_LLADDR(ifp), llzero) == 0)
-   continue;
+   continue;   /* No mac address set */
 
if (mif == NULL) {
mif = ifp;
@@ -2042,21 +2051,8 @@ bstp_reinit(struct bstp_state *bs)
}
}
IFNET_RUNLOCK_NOSLEEP();
-
-   if (LIST_EMPTY(bs-bs_bplist) || mif == NULL) {
-   /* Set the bridge and root id (lower bits) to zero */
-   bs-bs_bridge_pv.pv_dbridge_id =
-   ((uint64_t)bs-bs_bridge_priority)  48;
-   bs-bs_bridge_pv.pv_root_id = bs-bs_bridge_pv.pv_dbridge_id;
-   bs-bs_root_pv = bs-bs_bridge_pv;
-   /* Disable any remaining ports, they will have no MAC address */
-   LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
-   bp-bp_infois = BSTP_INFO_DISABLED;
-   bstp_set_port_role(bp, BSTP_ROLE_DISABLED);
-   }
-   callout_stop(bs-bs_bstpcallout);
-   return;
-   }
+   if (mif == NULL)
+   goto disablestp;
 
e_addr = IF_LLADDR(mif);
bs-bs_bridge_pv.pv_dbridge_id =
@@ -2084,6 +2080,20 @@ bstp_reinit(struct bstp_state *bs)
 
bstp_assign_roles(bs);
bstp_timer_start(bs-bs_link_timer, BSTP_LINK_TIMER);
+   return;
+
+disablestp:
+   /* Set the bridge and root id (lower bits) to zero */
+   bs-bs_bridge_pv.pv_dbridge_id =
+   ((uint64_t)bs-bs_bridge_priority)  48;
+   bs-bs_bridge_pv.pv_root_id = bs-bs_bridge_pv.pv_dbridge_id;
+   bs-bs_root_pv = bs-bs_bridge_pv;
+   /* Disable any remaining ports, they will have no MAC address */
+   LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
+   bp-bp_infois = BSTP_INFO_DISABLED;
+   bstp_set_port_role(bp, BSTP_ROLE_DISABLED);
+   }
+   callout_stop(bs-bs_bstpcallout);
 }
 
 static int
___

svn commit: r236049 - in stable/9: sbin/ifconfig sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 07:39:52 2012
New Revision: 236049
URL: http://svn.freebsd.org/changeset/base/236049

Log:
  MFC r232629,r232640
  
   Add the ability to set which packet layers are used for the load balance hash
   calculation.

Modified:
  stable/9/sbin/ifconfig/ifconfig.8
  stable/9/sbin/ifconfig/iflagg.c
  stable/9/sys/net/ieee8023ad_lacp.c
  stable/9/sys/net/if_lagg.c
  stable/9/sys/net/if_lagg.h
Directory Properties:
  stable/9/sbin/ifconfig/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sbin/ifconfig/ifconfig.8
==
--- stable/9/sbin/ifconfig/ifconfig.8   Sat May 26 07:35:44 2012
(r236048)
+++ stable/9/sbin/ifconfig/ifconfig.8   Sat May 26 07:39:52 2012
(r236049)
@@ -2277,6 +2277,21 @@ Set the aggregation protocol.
 The default is failover.
 The available options are failover, fec, lacp, loadbalance, roundrobin and
 none.
+.It Cm lagghash Ar option Ns Oo , Ns Ar option Oc
+Set the packet layers to hash for aggregation protocols which load balance.
+The default is
+.Dq l2,l3,l4 .
+The options can be combined using commas.
+.Pp
+.Bl -tag -width .Cm l2 -compact
+.It Cm l2
+src/dst mac address and optional vlan number.
+.It Cm l3
+src/dst address for IPv4 or IPv6.
+.It Cm l4
+src/dst port for TCP/UCP/SCTP.
+.El
+.Pp
 .El
 .Pp
 The following parameters are specific to IP tunnel interfaces,

Modified: stable/9/sbin/ifconfig/iflagg.c
==
--- stable/9/sbin/ifconfig/iflagg.c Sat May 26 07:35:44 2012
(r236048)
+++ stable/9/sbin/ifconfig/iflagg.c Sat May 26 07:39:52 2012
(r236049)
@@ -81,6 +81,36 @@ setlaggproto(const char *val, int d, int
err(1, SIOCSLAGG);
 }
 
+static void
+setlagghash(const char *val, int d, int s, const struct afswtch *afp)
+{
+   struct lagg_reqflags rf;
+   char *str, *tmp, *tok;
+
+
+   rf.rf_flags = 0;
+   str = tmp = strdup(val);
+   while ((tok = strsep(tmp, ,)) != NULL) {
+   if (strcmp(tok, l2) == 0)
+   rf.rf_flags |= LAGG_F_HASHL2;
+   else if (strcmp(tok, l3) == 0)
+   rf.rf_flags |= LAGG_F_HASHL3;
+   else if (strcmp(tok, l4) == 0)
+   rf.rf_flags |= LAGG_F_HASHL4;
+   else  {
+   free(str);
+   errx(1, Invalid lagghash option: %s, tok);
+   }
+   }
+   free(str);
+   if (rf.rf_flags == 0)
+   errx(1, No lagghash options supplied);
+
+   strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname));
+   if (ioctl(s, SIOCSLAGGHASH, rf))
+   err(1, SIOCSLAGGHASH);
+}
+
 static char *
 lacp_format_mac(const uint8_t *mac, char *buf, size_t buflen)
 {
@@ -115,6 +145,7 @@ lagg_status(int s)
struct lagg_protos lpr[] = LAGG_PROTOS;
struct lagg_reqport rp, rpbuf[LAGG_MAX_PORTS];
struct lagg_reqall ra;
+   struct lagg_reqflags rf;
struct lacp_opreq *lp;
const char *proto = unknown;
int i, isport = 0;
@@ -132,6 +163,10 @@ lagg_status(int s)
ra.ra_size = sizeof(rpbuf);
ra.ra_port = rpbuf;
 
+   strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname));
+   if (ioctl(s, SIOCGLAGGFLAGS, rf) != 0)
+   rf.rf_flags = 0;
+
if (ioctl(s, SIOCGLAGG, ra) == 0) {
lp = (struct lacp_opreq *)ra.ra_lacpreq;
 
@@ -143,6 +178,23 @@ lagg_status(int s)
}
 
printf(\tlaggproto %s, proto);
+   if (rf.rf_flags  LAGG_F_HASHMASK) {
+   const char *sep = ;
+
+   printf( lagghash );
+   if (rf.rf_flags  LAGG_F_HASHL2) {
+   printf(%sl2, sep);
+   sep = ,;
+   }
+   if (rf.rf_flags  LAGG_F_HASHL3) {
+   printf(%sl3, sep);
+   sep = ,;
+

svn commit: r236050 - stable/9/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 07:41:05 2012
New Revision: 236050
URL: http://svn.freebsd.org/changeset/base/236050

Log:
  MFC r234163
  
   Set the proto to LAGG_PROTO_NONE before calling the detach routine so packets
   are discarded, this is an issue because lacp drops the lock which may allow
   network threads to access freed memory. Expand the lock coverage so the
   detach/attach happen atomically.
  
  Submitted by: Andrew Boyer (earlier version)

Modified:
  stable/9/sys/net/if_lagg.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/net/if_lagg.c
==
--- stable/9/sys/net/if_lagg.c  Sat May 26 07:39:52 2012(r236049)
+++ stable/9/sys/net/if_lagg.c  Sat May 26 07:41:05 2012(r236050)
@@ -950,11 +950,11 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
error = EPROTONOSUPPORT;
break;
}
+   LAGG_WLOCK(sc);
if (sc-sc_proto != LAGG_PROTO_NONE) {
-   LAGG_WLOCK(sc);
-   error = sc-sc_detach(sc);
-   /* Reset protocol and pointers */
+   /* Reset protocol first in case detach unlocks */
sc-sc_proto = LAGG_PROTO_NONE;
+   error = sc-sc_detach(sc);
sc-sc_detach = NULL;
sc-sc_start = NULL;
sc-sc_input = NULL;
@@ -966,10 +966,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
sc-sc_lladdr = NULL;
sc-sc_req = NULL;
sc-sc_portreq = NULL;
-   LAGG_WUNLOCK(sc);
+   } else if (sc-sc_input != NULL) {
+   /* Still detaching */
+   error = EBUSY;
}
-   if (error != 0)
+   if (error != 0) {
+   LAGG_WUNLOCK(sc);
break;
+   }
for (int i = 0; i  (sizeof(lagg_protos) /
sizeof(lagg_protos[0])); i++) {
if (lagg_protos[i].ti_proto == ra-ra_proto) {
@@ -977,7 +981,6 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
printf(%s: using proto %u\n,
sc-sc_ifname,
lagg_protos[i].ti_proto);
-   LAGG_WLOCK(sc);
sc-sc_proto = lagg_protos[i].ti_proto;
if (sc-sc_proto != LAGG_PROTO_NONE)
error = lagg_protos[i].ti_attach(sc);
@@ -985,6 +988,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
return (error);
}
}
+   LAGG_WUNLOCK(sc);
error = EPROTONOSUPPORT;
break;
case SIOCGLAGGFLAGS:
___
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: r236051 - stable/9/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 07:42:32 2012
New Revision: 236051
URL: http://svn.freebsd.org/changeset/base/236051

Log:
  MFC r234487
  
   Add linkstate to bridge(4), set the link to up when at least one underlying
   interface is up, otherwise the link is down.
  
   This, among other things, allows carp to work on a bridge.

Modified:
  stable/9/sys/net/bridgestp.c
  stable/9/sys/net/bridgestp.h
  stable/9/sys/net/if.c
  stable/9/sys/net/if_bridge.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/net/bridgestp.c
==
--- stable/9/sys/net/bridgestp.cSat May 26 07:41:05 2012
(r236050)
+++ stable/9/sys/net/bridgestp.cSat May 26 07:42:32 2012
(r236051)
@@ -1767,28 +1767,16 @@ bstp_notify_rtage(void *arg, int pending
 }
 
 void
-bstp_linkstate(struct ifnet *ifp, int state)
+bstp_linkstate(struct bstp_port *bp)
 {
-   struct bstp_state *bs;
-   struct bstp_port *bp;
+   struct bstp_state *bs = bp-bp_bs;
 
-   /* search for the stp port */
-   mtx_lock(bstp_list_mtx);
-   LIST_FOREACH(bs, bstp_list, bs_list) {
-   BSTP_LOCK(bs);
-   LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
-   if (bp-bp_ifp == ifp) {
-   bstp_ifupdstatus(bs, bp);
-   bstp_update_state(bs, bp);
-   /* it only exists once so return */
-   BSTP_UNLOCK(bs);
-   mtx_unlock(bstp_list_mtx);
-   return;
-   }
-   }
-   BSTP_UNLOCK(bs);
+   BSTP_LOCK(bs);
+   if (bp-bp_active) {
+   bstp_ifupdstatus(bs, bp);
+   bstp_update_state(bs, bp);
}
-   mtx_unlock(bstp_list_mtx);
+   BSTP_UNLOCK(bs);
 }
 
 static void
@@ -2103,10 +2091,8 @@ bstp_modevent(module_t mod, int type, vo
case MOD_LOAD:
mtx_init(bstp_list_mtx, bridgestp list, NULL, MTX_DEF);
LIST_INIT(bstp_list);
-   bstp_linkstate_p = bstp_linkstate;
break;
case MOD_UNLOAD:
-   bstp_linkstate_p = NULL;
mtx_destroy(bstp_list_mtx);
break;
default:

Modified: stable/9/sys/net/bridgestp.h
==
--- stable/9/sys/net/bridgestp.hSat May 26 07:41:05 2012
(r236050)
+++ stable/9/sys/net/bridgestp.hSat May 26 07:42:32 2012
(r236051)
@@ -369,8 +369,6 @@ struct bstp_state {
 
 extern const uint8_t bstp_etheraddr[];
 
-extern void (*bstp_linkstate_p)(struct ifnet *ifp, int state);
-
 void   bstp_attach(struct bstp_state *, struct bstp_cb_ops *);
 void   bstp_detach(struct bstp_state *);
 void   bstp_init(struct bstp_state *);
@@ -379,7 +377,7 @@ int bstp_create(struct bstp_state *, str
 intbstp_enable(struct bstp_port *);
 void   bstp_disable(struct bstp_port *);
 void   bstp_destroy(struct bstp_port *);
-void   bstp_linkstate(struct ifnet *, int);
+void   bstp_linkstate(struct bstp_port *);
 intbstp_set_htime(struct bstp_state *, int);
 intbstp_set_fdelay(struct bstp_state *, int);
 intbstp_set_maxage(struct bstp_state *, int);

Modified: stable/9/sys/net/if.c
==
--- stable/9/sys/net/if.c   Sat May 26 07:41:05 2012(r236050)
+++ stable/9/sys/net/if.c   Sat May 26 07:42:32 2012(r236051)
@@ -124,7 +124,7 @@ MALLOC_DEFINE(M_IFDESCR, ifdescr, ifn
 static struct sx ifdescr_sx;
 SX_SYSINIT(ifdescr_sx, ifdescr_sx, ifnet descr);
 
-void   (*bstp_linkstate_p)(struct ifnet *ifp, int state);
+void   (*bridge_linkstate_p)(struct ifnet *ifp);
 void   (*ng_ether_link_state_p)(struct ifnet *ifp, int state);
 void   (*lagg_linkstate_p)(struct ifnet *ifp, int state);
 /* These are external hooks for CARP. */
@@ -1925,14 +1925,10 @@ 

svn commit: r236052 - stable/9/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 07:43:17 2012
New Revision: 236052
URL: http://svn.freebsd.org/changeset/base/236052

Log:
  MFC r234488
  
   Move the interface media check to a taskqueue, some interfaces (usb) sleep
   during SIOCGIFMEDIA and we were holding locks.

Modified:
  stable/9/sys/net/bridgestp.c
  stable/9/sys/net/bridgestp.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/net/bridgestp.c
==
--- stable/9/sys/net/bridgestp.cSat May 26 07:42:32 2012
(r236051)
+++ stable/9/sys/net/bridgestp.cSat May 26 07:43:17 2012
(r236052)
@@ -127,7 +127,7 @@ static int  bstp_rerooted(struct bstp_sta
 static uint32_tbstp_calc_path_cost(struct bstp_port *);
 static voidbstp_notify_state(void *, int);
 static voidbstp_notify_rtage(void *, int);
-static voidbstp_ifupdstatus(struct bstp_state *, struct bstp_port *);
+static voidbstp_ifupdstatus(void *, int);
 static voidbstp_enable_port(struct bstp_state *, struct bstp_port *);
 static voidbstp_disable_port(struct bstp_state *, struct bstp_port *);
 static voidbstp_tick(void *);
@@ -1677,7 +1677,7 @@ bstp_set_autoptp(struct bstp_port *bp, i
if (set) {
bp-bp_flags |= BSTP_PORT_AUTOPTP;
if (bp-bp_role != BSTP_ROLE_DISABLED)
-   bstp_ifupdstatus(bs, bp);
+   taskqueue_enqueue(taskqueue_swi, bp-bp_mediatask);
} else
bp-bp_flags = ~BSTP_PORT_AUTOPTP;
BSTP_UNLOCK(bs);
@@ -1771,69 +1771,89 @@ bstp_linkstate(struct bstp_port *bp)
 {
struct bstp_state *bs = bp-bp_bs;
 
+   if (!bp-bp_active)
+   return;
+
+   bstp_ifupdstatus(bp, 0);
BSTP_LOCK(bs);
-   if (bp-bp_active) {
-   bstp_ifupdstatus(bs, bp);
-   bstp_update_state(bs, bp);
-   }
+   bstp_update_state(bs, bp);
BSTP_UNLOCK(bs);
 }
 
 static void
-bstp_ifupdstatus(struct bstp_state *bs, struct bstp_port *bp)
+bstp_ifupdstatus(void *arg, int pending)
 {
+   struct bstp_port *bp = (struct bstp_port *)arg;
+   struct bstp_state *bs = bp-bp_bs;
struct ifnet *ifp = bp-bp_ifp;
struct ifmediareq ifmr;
-   int error = 0;
+   int error, changed;
 
-   BSTP_LOCK_ASSERT(bs);
+   if (!bp-bp_active)
+   return;
 
bzero((char *)ifmr, sizeof(ifmr));
error = (*ifp-if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)ifmr);
 
+   BSTP_LOCK(bs);
+   changed = 0;
if ((error == 0)  (ifp-if_flags  IFF_UP)) {
if (ifmr.ifm_status  IFM_ACTIVE) {
/* A full-duplex link is assumed to be point to point */
if (bp-bp_flags  BSTP_PORT_AUTOPTP) {
-   bp-bp_ptp_link =
-   ifmr.ifm_active  IFM_FDX ? 1 : 0;
+   int fdx;
+
+   fdx = ifmr.ifm_active  IFM_FDX ? 1 : 0;
+   if (bp-bp_ptp_link ^ fdx) {
+   bp-bp_ptp_link = fdx;
+   changed = 1;
+   }
}
 
/* Calc the cost if the link was down previously */
if (bp-bp_flags  BSTP_PORT_PNDCOST) {
-   bp-bp_path_cost = bstp_calc_path_cost(bp);
+   uint32_t cost;
+
+   cost = bstp_calc_path_cost(bp);
+   if (bp-bp_path_cost != cost) {
+   bp-bp_path_cost = cost;
+   changed = 1;
+   }
bp-bp_flags = ~BSTP_PORT_PNDCOST;
}
 
-   if (bp-bp_role == BSTP_ROLE_DISABLED)
+   if (bp-bp_role == BSTP_ROLE_DISABLED) {
   

svn commit: r236053 - stable/9/sys/dev/tsec

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 07:44:00 2012
New Revision: 236053
URL: http://svn.freebsd.org/changeset/base/236053

Log:
  MFC r235144
  
   The DEVICE_POLLING dereference of sc-tsec_ifp needs to be checked for null
   first or this will panic. Condense three blocks that check sc-tsec_ifp into
   one while I am here.

Modified:
  stable/9/sys/dev/tsec/if_tsec.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/dev/tsec/if_tsec.c
==
--- stable/9/sys/dev/tsec/if_tsec.c Sat May 26 07:43:17 2012
(r236052)
+++ stable/9/sys/dev/tsec/if_tsec.c Sat May 26 07:44:00 2012
(r236053)
@@ -290,17 +290,17 @@ int
 tsec_detach(struct tsec_softc *sc)
 {
 
+   if (sc-tsec_ifp != NULL) {
 #ifdef DEVICE_POLLING
-   if (sc-tsec_ifp-if_capenable  IFCAP_POLLING)
-   ether_poll_deregister(sc-tsec_ifp);
+   if (sc-tsec_ifp-if_capenable  IFCAP_POLLING)
+   ether_poll_deregister(sc-tsec_ifp);
 #endif
 
-   /* Stop TSEC controller and free TX queue */
-   if (sc-sc_rres  sc-tsec_ifp)
-   tsec_shutdown(sc-dev);
+   /* Stop TSEC controller and free TX queue */
+   if (sc-sc_rres)
+   tsec_shutdown(sc-dev);
 
-   /* Detach network interface */
-   if (sc-tsec_ifp) {
+   /* Detach network interface */
ether_ifdetach(sc-tsec_ifp);
if_free(sc-tsec_ifp);
sc-tsec_ifp = NULL;
___
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: r236055 - stable/8/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 07:58:12 2012
New Revision: 236055
URL: http://svn.freebsd.org/changeset/base/236055

Log:
  MFC r232014,r232030,r232070
  
  - bstp_input() always consumes the packet so remove the mbuf handling dance
around it.
  - Now that network interfaces advertise if they support linkstate 
notifications
we do not need to perform a media ioctl every 15 seconds.
  - Indicate this function decrements the timer as well as testing for expiry.

Modified:
  stable/8/sys/net/bridgestp.c
  stable/8/sys/net/bridgestp.h
  stable/8/sys/net/if_bridge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/net/bridgestp.c
==
--- stable/8/sys/net/bridgestp.cSat May 26 07:44:35 2012
(r236054)
+++ stable/8/sys/net/bridgestp.cSat May 26 07:58:12 2012
(r236055)
@@ -134,7 +134,7 @@ static void bstp_tick(void *);
 static voidbstp_timer_start(struct bstp_timer *, uint16_t);
 static voidbstp_timer_stop(struct bstp_timer *);
 static voidbstp_timer_latch(struct bstp_timer *);
-static int bstp_timer_expired(struct bstp_timer *);
+static int bstp_timer_dectest(struct bstp_timer *);
 static voidbstp_hello_timer_expiry(struct bstp_state *,
struct bstp_port *);
 static voidbstp_message_age_expiry(struct bstp_state *,
@@ -446,7 +446,7 @@ bstp_pdu_flags(struct bstp_port *bp)
return (flags);
 }
 
-struct mbuf *
+void
 bstp_input(struct bstp_port *bp, struct ifnet *ifp, struct mbuf *m)
 {
struct bstp_state *bs = bp-bp_bs;
@@ -456,7 +456,7 @@ bstp_input(struct bstp_port *bp, struct 
 
if (bp-bp_active == 0) {
m_freem(m);
-   return (NULL);
+   return;
}
 
BSTP_LOCK(bs);
@@ -521,7 +521,6 @@ out:
BSTP_UNLOCK(bs);
if (m)
m_freem(m);
-   return (NULL);
 }
 
 static void
@@ -1862,30 +1861,32 @@ bstp_tick(void *arg)
 
CURVNET_SET(bs-bs_vnet);
 
-   /* slow timer to catch missed link events */
-   if (bstp_timer_expired(bs-bs_link_timer)) {
-   LIST_FOREACH(bp, bs-bs_bplist, bp_next)
-   bstp_ifupdstatus(bs, bp);
+   /* poll link events on interfaces that do not support linkstate */
+   if (bstp_timer_dectest(bs-bs_link_timer)) {
+   LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
+   if (!(bp-bp_ifp-if_capabilities  IFCAP_LINKSTATE))
+   bstp_ifupdstatus(bs, bp);
+   }
bstp_timer_start(bs-bs_link_timer, BSTP_LINK_TIMER);
}
 
LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
/* no events need to happen for these */
-   bstp_timer_expired(bp-bp_tc_timer);
-   bstp_timer_expired(bp-bp_recent_root_timer);
-   bstp_timer_expired(bp-bp_forward_delay_timer);
-   bstp_timer_expired(bp-bp_recent_backup_timer);
+   bstp_timer_dectest(bp-bp_tc_timer);
+   bstp_timer_dectest(bp-bp_recent_root_timer);
+   bstp_timer_dectest(bp-bp_forward_delay_timer);
+   bstp_timer_dectest(bp-bp_recent_backup_timer);
 
-   if (bstp_timer_expired(bp-bp_hello_timer))
+   if (bstp_timer_dectest(bp-bp_hello_timer))
bstp_hello_timer_expiry(bs, bp);
 
-   if (bstp_timer_expired(bp-bp_message_age_timer))
+   if (bstp_timer_dectest(bp-bp_message_age_timer))
bstp_message_age_expiry(bs, bp);
 
-   if (bstp_timer_expired(bp-bp_migrate_delay_timer))
+   if (bstp_timer_dectest(bp-bp_migrate_delay_timer))
bstp_migrate_delay_expiry(bs, bp);
 
-   if (bstp_timer_expired(bp-bp_edge_delay_timer))
+   if (bstp_timer_dectest(bp-bp_edge_delay_timer))
bstp_edge_delay_expiry(bs, bp);
 
/* update the various state machines for the port */
@@ -1924,7 +1925,7 @@ bstp_timer_latch(struct bstp_timer *t)
 }
 
 static int
-bstp_timer_expired(struct bstp_timer *t)
+bstp_timer_dectest(struct bstp_timer *t)
 {
if (t-active == 0 || t-latched)
return (0);

Modified: stable/8/sys/net/bridgestp.h
==
--- stable/8/sys/net/bridgestp.hSat May 26 07:44:35 2012
(r236054)
+++ stable/8/sys/net/bridgestp.hSat May 26 07:58:12 2012
(r236055)
@@ -392,6 +392,6 @@ int bstp_set_edge(struct bstp_port *, in
 int

svn commit: r236056 - stable/8/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 07:58:58 2012
New Revision: 236056
URL: http://svn.freebsd.org/changeset/base/236056

Log:
  MFC r232118
  
   Only look for a usable MAC address for the bridge ID from ports within our
   bridge, this allows us to have more than one independent bridge in the same
   STP domain.
  
  PR:   kern/164369
  Submitted by: Nikos Vassiliadis (earlier version)

Modified:
  stable/8/sys/net/bridgestp.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/net/bridgestp.c
==
--- stable/8/sys/net/bridgestp.cSat May 26 07:58:12 2012
(r236055)
+++ stable/8/sys/net/bridgestp.cSat May 26 07:58:58 2012
(r236056)
@@ -2013,24 +2013,33 @@ bstp_reinit(struct bstp_state *bs)
struct bstp_port *bp;
struct ifnet *ifp, *mif;
u_char *e_addr;
+   void *bridgeptr;
static const u_char llzero[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */
 
BSTP_LOCK_ASSERT(bs);
 
+   if (LIST_EMPTY(bs-bs_bplist))
+   goto disablestp;
+
mif = NULL;
+   bridgeptr = LIST_FIRST(bs-bs_bplist)-bp_ifp-if_bridge;
+   KASSERT(bridgeptr != NULL, (Invalid bridge pointer));
/*
 * Search through the Ethernet adapters and find the one with the
-* lowest value. The adapter which we take the MAC address from does
-* not need to be part of the bridge, it just needs to be a unique
-* value.
+* lowest value. Make sure the adapter which we take the MAC address
+* from is part of this bridge, so we can have more than one independent
+* bridges in the same STP domain.
 */
IFNET_RLOCK_NOSLEEP();
TAILQ_FOREACH(ifp, V_ifnet, if_link) {
if (ifp-if_type != IFT_ETHER)
-   continue;
+   continue;   /* Not Ethernet */
+
+   if (ifp-if_bridge != bridgeptr)
+   continue;   /* Not part of our bridge */
 
if (bstp_addr_cmp(IF_LLADDR(ifp), llzero) == 0)
-   continue;
+   continue;   /* No mac address set */
 
if (mif == NULL) {
mif = ifp;
@@ -2042,21 +2051,8 @@ bstp_reinit(struct bstp_state *bs)
}
}
IFNET_RUNLOCK_NOSLEEP();
-
-   if (LIST_EMPTY(bs-bs_bplist) || mif == NULL) {
-   /* Set the bridge and root id (lower bits) to zero */
-   bs-bs_bridge_pv.pv_dbridge_id =
-   ((uint64_t)bs-bs_bridge_priority)  48;
-   bs-bs_bridge_pv.pv_root_id = bs-bs_bridge_pv.pv_dbridge_id;
-   bs-bs_root_pv = bs-bs_bridge_pv;
-   /* Disable any remaining ports, they will have no MAC address */
-   LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
-   bp-bp_infois = BSTP_INFO_DISABLED;
-   bstp_set_port_role(bp, BSTP_ROLE_DISABLED);
-   }
-   callout_stop(bs-bs_bstpcallout);
-   return;
-   }
+   if (mif == NULL)
+   goto disablestp;
 
e_addr = IF_LLADDR(mif);
bs-bs_bridge_pv.pv_dbridge_id =
@@ -2084,6 +2080,20 @@ bstp_reinit(struct bstp_state *bs)
 
bstp_assign_roles(bs);
bstp_timer_start(bs-bs_link_timer, BSTP_LINK_TIMER);
+   return;
+
+disablestp:
+   /* Set the bridge and root id (lower bits) to zero */
+   bs-bs_bridge_pv.pv_dbridge_id =
+   ((uint64_t)bs-bs_bridge_priority)  48;
+   bs-bs_bridge_pv.pv_root_id = bs-bs_bridge_pv.pv_dbridge_id;
+   bs-bs_root_pv = bs-bs_bridge_pv;
+   /* Disable any remaining ports, they will have no MAC address */
+   LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
+   bp-bp_infois = BSTP_INFO_DISABLED;
+   bstp_set_port_role(bp, BSTP_ROLE_DISABLED);
+   }
+   callout_stop(bs-bs_bstpcallout);
 }
 
 static int
___
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: r236057 - in stable/8: sbin/ifconfig sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 07:59:56 2012
New Revision: 236057
URL: http://svn.freebsd.org/changeset/base/236057

Log:
  MFC r232629,r232640
  
Add the ability to set which packet layers are used for the load balance 
hash
calculation.

Modified:
  stable/8/sbin/ifconfig/ifconfig.8
  stable/8/sbin/ifconfig/iflagg.c
  stable/8/sys/net/ieee8023ad_lacp.c
  stable/8/sys/net/if_lagg.c
  stable/8/sys/net/if_lagg.h
Directory Properties:
  stable/8/sbin/ifconfig/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sbin/ifconfig/ifconfig.8
==
--- stable/8/sbin/ifconfig/ifconfig.8   Sat May 26 07:58:58 2012
(r236056)
+++ stable/8/sbin/ifconfig/ifconfig.8   Sat May 26 07:59:56 2012
(r236057)
@@ -2234,6 +2234,21 @@ Set the aggregation protocol.
 The default is failover.
 The available options are failover, fec, lacp, loadbalance, roundrobin and
 none.
+.It Cm lagghash Ar option Ns Oo , Ns Ar option Oc
+Set the packet layers to hash for aggregation protocols which load balance.
+The default is
+.Dq l2,l3,l4 .
+The options can be combined using commas.
+.Pp
+.Bl -tag -width .Cm l2 -compact
+.It Cm l2
+src/dst mac address and optional vlan number.
+.It Cm l3
+src/dst address for IPv4 or IPv6.
+.It Cm l4
+src/dst port for TCP/UCP/SCTP.
+.El
+.Pp
 .El
 .Pp
 The following parameters are specific to IP tunnel interfaces,

Modified: stable/8/sbin/ifconfig/iflagg.c
==
--- stable/8/sbin/ifconfig/iflagg.c Sat May 26 07:58:58 2012
(r236056)
+++ stable/8/sbin/ifconfig/iflagg.c Sat May 26 07:59:56 2012
(r236057)
@@ -81,6 +81,36 @@ setlaggproto(const char *val, int d, int
err(1, SIOCSLAGG);
 }
 
+static void
+setlagghash(const char *val, int d, int s, const struct afswtch *afp)
+{
+   struct lagg_reqflags rf;
+   char *str, *tmp, *tok;
+
+
+   rf.rf_flags = 0;
+   str = tmp = strdup(val);
+   while ((tok = strsep(tmp, ,)) != NULL) {
+   if (strcmp(tok, l2) == 0)
+   rf.rf_flags |= LAGG_F_HASHL2;
+   else if (strcmp(tok, l3) == 0)
+   rf.rf_flags |= LAGG_F_HASHL3;
+   else if (strcmp(tok, l4) == 0)
+   rf.rf_flags |= LAGG_F_HASHL4;
+   else  {
+   free(str);
+   errx(1, Invalid lagghash option: %s, tok);
+   }
+   }
+   free(str);
+   if (rf.rf_flags == 0)
+   errx(1, No lagghash options supplied);
+
+   strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname));
+   if (ioctl(s, SIOCSLAGGHASH, rf))
+   err(1, SIOCSLAGGHASH);
+}
+
 static char *
 lacp_format_mac(const uint8_t *mac, char *buf, size_t buflen)
 {
@@ -115,6 +145,7 @@ lagg_status(int s)
struct lagg_protos lpr[] = LAGG_PROTOS;
struct lagg_reqport rp, rpbuf[LAGG_MAX_PORTS];
struct lagg_reqall ra;
+   struct lagg_reqflags rf;
struct lacp_opreq *lp;
const char *proto = unknown;
int i, isport = 0;
@@ -132,6 +163,10 @@ lagg_status(int s)
ra.ra_size = sizeof(rpbuf);
ra.ra_port = rpbuf;
 
+   strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname));
+   if (ioctl(s, SIOCGLAGGFLAGS, rf) != 0)
+   rf.rf_flags = 0;
+
if (ioctl(s, SIOCGLAGG, ra) == 0) {
lp = (struct lacp_opreq *)ra.ra_lacpreq;
 
@@ -143,6 +178,23 @@ lagg_status(int s)
}
 
printf(\tlaggproto %s, proto);
+   if (rf.rf_flags  LAGG_F_HASHMASK) {
+   const char *sep = ;
+
+   printf( lagghash );
+   if (rf.rf_flags  LAGG_F_HASHL2) {
+   printf(%sl2, sep);
+   sep = ,;
+   }
+   if (rf.rf_flags  LAGG_F_HASHL3) {
+   printf(%sl3, sep);
+   sep = ,;
+   }
+   if (rf.rf_flags  LAGG_F_HASHL4) {
+   printf(%sl4, sep);
+   sep = ,;
+   }
+   }
if (isport)
printf( laggdev %s, rp.rp_ifname);
putchar('\n');
@@ -174,6 +226,7 @@ static struct cmd lagg_cmds[] = {
DEF_CMD_ARG(laggport, setlaggport),
DEF_CMD_ARG(-laggport,unsetlaggport),
DEF_CMD_ARG(laggproto,setlaggproto),
+   DEF_CMD_ARG(lagghash, 

svn commit: r236058 - stable/8/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:00:34 2012
New Revision: 236058
URL: http://svn.freebsd.org/changeset/base/236058

Log:
  MFC r234163
  
   Set the proto to LAGG_PROTO_NONE before calling the detach routine so packets
   are discarded, this is an issue because lacp drops the lock which may allow
   network threads to access freed memory. Expand the lock coverage so the
   detach/attach happen atomically.
  
  Submitted by: Andrew Boyer (earlier version)

Modified:
  stable/8/sys/net/if_lagg.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/net/if_lagg.c
==
--- stable/8/sys/net/if_lagg.c  Sat May 26 07:59:56 2012(r236057)
+++ stable/8/sys/net/if_lagg.c  Sat May 26 08:00:34 2012(r236058)
@@ -942,11 +942,11 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
error = EPROTONOSUPPORT;
break;
}
+   LAGG_WLOCK(sc);
if (sc-sc_proto != LAGG_PROTO_NONE) {
-   LAGG_WLOCK(sc);
-   error = sc-sc_detach(sc);
-   /* Reset protocol and pointers */
+   /* Reset protocol first in case detach unlocks */
sc-sc_proto = LAGG_PROTO_NONE;
+   error = sc-sc_detach(sc);
sc-sc_detach = NULL;
sc-sc_start = NULL;
sc-sc_input = NULL;
@@ -958,10 +958,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
sc-sc_lladdr = NULL;
sc-sc_req = NULL;
sc-sc_portreq = NULL;
-   LAGG_WUNLOCK(sc);
+   } else if (sc-sc_input != NULL) {
+   /* Still detaching */
+   error = EBUSY;
}
-   if (error != 0)
+   if (error != 0) {
+   LAGG_WUNLOCK(sc);
break;
+   }
for (int i = 0; i  (sizeof(lagg_protos) /
sizeof(lagg_protos[0])); i++) {
if (lagg_protos[i].ti_proto == ra-ra_proto) {
@@ -969,7 +973,6 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
printf(%s: using proto %u\n,
sc-sc_ifname,
lagg_protos[i].ti_proto);
-   LAGG_WLOCK(sc);
sc-sc_proto = lagg_protos[i].ti_proto;
if (sc-sc_proto != LAGG_PROTO_NONE)
error = lagg_protos[i].ti_attach(sc);
@@ -977,6 +980,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
return (error);
}
}
+   LAGG_WUNLOCK(sc);
error = EPROTONOSUPPORT;
break;
case SIOCGLAGGFLAGS:
___
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: r236059 - stable/8/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:02:13 2012
New Revision: 236059
URL: http://svn.freebsd.org/changeset/base/236059

Log:
  MFC r234487
  
   Add linkstate to bridge(4), set the link to up when at least one underlying
   interface is up, otherwise the link is down.
  
   This, among other things, allows carp to work on a bridge.

Modified:
  stable/8/sys/net/bridgestp.c
  stable/8/sys/net/bridgestp.h
  stable/8/sys/net/if.c
  stable/8/sys/net/if_bridge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/net/bridgestp.c
==
--- stable/8/sys/net/bridgestp.cSat May 26 08:00:34 2012
(r236058)
+++ stable/8/sys/net/bridgestp.cSat May 26 08:02:13 2012
(r236059)
@@ -1767,28 +1767,16 @@ bstp_notify_rtage(void *arg, int pending
 }
 
 void
-bstp_linkstate(struct ifnet *ifp, int state)
+bstp_linkstate(struct bstp_port *bp)
 {
-   struct bstp_state *bs;
-   struct bstp_port *bp;
+   struct bstp_state *bs = bp-bp_bs;
 
-   /* search for the stp port */
-   mtx_lock(bstp_list_mtx);
-   LIST_FOREACH(bs, bstp_list, bs_list) {
-   BSTP_LOCK(bs);
-   LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
-   if (bp-bp_ifp == ifp) {
-   bstp_ifupdstatus(bs, bp);
-   bstp_update_state(bs, bp);
-   /* it only exists once so return */
-   BSTP_UNLOCK(bs);
-   mtx_unlock(bstp_list_mtx);
-   return;
-   }
-   }
-   BSTP_UNLOCK(bs);
+   BSTP_LOCK(bs);
+   if (bp-bp_active) {
+   bstp_ifupdstatus(bs, bp);
+   bstp_update_state(bs, bp);
}
-   mtx_unlock(bstp_list_mtx);
+   BSTP_UNLOCK(bs);
 }
 
 static void
@@ -2103,10 +2091,8 @@ bstp_modevent(module_t mod, int type, vo
case MOD_LOAD:
mtx_init(bstp_list_mtx, bridgestp list, NULL, MTX_DEF);
LIST_INIT(bstp_list);
-   bstp_linkstate_p = bstp_linkstate;
break;
case MOD_UNLOAD:
-   bstp_linkstate_p = NULL;
mtx_destroy(bstp_list_mtx);
break;
default:

Modified: stable/8/sys/net/bridgestp.h
==
--- stable/8/sys/net/bridgestp.hSat May 26 08:00:34 2012
(r236058)
+++ stable/8/sys/net/bridgestp.hSat May 26 08:02:13 2012
(r236059)
@@ -369,8 +369,6 @@ struct bstp_state {
 
 extern const uint8_t bstp_etheraddr[];
 
-extern void (*bstp_linkstate_p)(struct ifnet *ifp, int state);
-
 void   bstp_attach(struct bstp_state *, struct bstp_cb_ops *);
 void   bstp_detach(struct bstp_state *);
 void   bstp_init(struct bstp_state *);
@@ -379,7 +377,7 @@ int bstp_create(struct bstp_state *, str
 intbstp_enable(struct bstp_port *);
 void   bstp_disable(struct bstp_port *);
 void   bstp_destroy(struct bstp_port *);
-void   bstp_linkstate(struct ifnet *, int);
+void   bstp_linkstate(struct bstp_port *);
 intbstp_set_htime(struct bstp_state *, int);
 intbstp_set_fdelay(struct bstp_state *, int);
 intbstp_set_maxage(struct bstp_state *, int);

Modified: stable/8/sys/net/if.c
==
--- stable/8/sys/net/if.c   Sat May 26 08:00:34 2012(r236058)
+++ stable/8/sys/net/if.c   Sat May 26 08:02:13 2012(r236059)
@@ -126,7 +126,7 @@ MALLOC_DEFINE(M_IFDESCR, ifdescr, ifn
 static struct sx ifdescr_sx;
 SX_SYSINIT(ifdescr_sx, ifdescr_sx, ifnet descr);
 
-void   (*bstp_linkstate_p)(struct ifnet *ifp, int state);
+void   (*bridge_linkstate_p)(struct ifnet *ifp);
 void   (*ng_ether_link_state_p)(struct ifnet *ifp, int state);
 void   (*lagg_linkstate_p)(struct ifnet *ifp, int state);
 /* These are external hooks for CARP. */
@@ -1953,14 +1953,10 @@ do_link_state_change(void *arg, int pend
(*ng_ether_link_state_p)(ifp, link_state);
if (ifp-if_carp)
(*carp_linkstate_p)(ifp);
-   if (ifp-if_bridge) {
-   KASSERT(bstp_linkstate_p != NULL,(if_bridge bstp not 
loaded!));
-   (*bstp_linkstate_p)(ifp, link_state);
-   }
-   if (ifp-if_lagg) {
-   KASSERT(lagg_linkstate_p != NULL,(if_lagg not loaded!));
+   if (ifp-if_bridge)
+   (*bridge_linkstate_p)(ifp);
+   if (ifp-if_lagg)
(*lagg_linkstate_p)(ifp, link_state);
-   }
 
if 

svn commit: r236060 - stable/8/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:02:45 2012
New Revision: 236060
URL: http://svn.freebsd.org/changeset/base/236060

Log:
  MFC r234488
  
   Move the interface media check to a taskqueue, some interfaces (usb) sleep
   during SIOCGIFMEDIA and we were holding locks.

Modified:
  stable/8/sys/net/bridgestp.c
  stable/8/sys/net/bridgestp.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/net/bridgestp.c
==
--- stable/8/sys/net/bridgestp.cSat May 26 08:02:13 2012
(r236059)
+++ stable/8/sys/net/bridgestp.cSat May 26 08:02:45 2012
(r236060)
@@ -127,7 +127,7 @@ static int  bstp_rerooted(struct bstp_sta
 static uint32_tbstp_calc_path_cost(struct bstp_port *);
 static voidbstp_notify_state(void *, int);
 static voidbstp_notify_rtage(void *, int);
-static voidbstp_ifupdstatus(struct bstp_state *, struct bstp_port *);
+static voidbstp_ifupdstatus(void *, int);
 static voidbstp_enable_port(struct bstp_state *, struct bstp_port *);
 static voidbstp_disable_port(struct bstp_state *, struct bstp_port *);
 static voidbstp_tick(void *);
@@ -1677,7 +1677,7 @@ bstp_set_autoptp(struct bstp_port *bp, i
if (set) {
bp-bp_flags |= BSTP_PORT_AUTOPTP;
if (bp-bp_role != BSTP_ROLE_DISABLED)
-   bstp_ifupdstatus(bs, bp);
+   taskqueue_enqueue(taskqueue_swi, bp-bp_mediatask);
} else
bp-bp_flags = ~BSTP_PORT_AUTOPTP;
BSTP_UNLOCK(bs);
@@ -1771,69 +1771,89 @@ bstp_linkstate(struct bstp_port *bp)
 {
struct bstp_state *bs = bp-bp_bs;
 
+   if (!bp-bp_active)
+   return;
+
+   bstp_ifupdstatus(bp, 0);
BSTP_LOCK(bs);
-   if (bp-bp_active) {
-   bstp_ifupdstatus(bs, bp);
-   bstp_update_state(bs, bp);
-   }
+   bstp_update_state(bs, bp);
BSTP_UNLOCK(bs);
 }
 
 static void
-bstp_ifupdstatus(struct bstp_state *bs, struct bstp_port *bp)
+bstp_ifupdstatus(void *arg, int pending)
 {
+   struct bstp_port *bp = (struct bstp_port *)arg;
+   struct bstp_state *bs = bp-bp_bs;
struct ifnet *ifp = bp-bp_ifp;
struct ifmediareq ifmr;
-   int error = 0;
+   int error, changed;
 
-   BSTP_LOCK_ASSERT(bs);
+   if (!bp-bp_active)
+   return;
 
bzero((char *)ifmr, sizeof(ifmr));
error = (*ifp-if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)ifmr);
 
+   BSTP_LOCK(bs);
+   changed = 0;
if ((error == 0)  (ifp-if_flags  IFF_UP)) {
if (ifmr.ifm_status  IFM_ACTIVE) {
/* A full-duplex link is assumed to be point to point */
if (bp-bp_flags  BSTP_PORT_AUTOPTP) {
-   bp-bp_ptp_link =
-   ifmr.ifm_active  IFM_FDX ? 1 : 0;
+   int fdx;
+
+   fdx = ifmr.ifm_active  IFM_FDX ? 1 : 0;
+   if (bp-bp_ptp_link ^ fdx) {
+   bp-bp_ptp_link = fdx;
+   changed = 1;
+   }
}
 
/* Calc the cost if the link was down previously */
if (bp-bp_flags  BSTP_PORT_PNDCOST) {
-   bp-bp_path_cost = bstp_calc_path_cost(bp);
+   uint32_t cost;
+
+   cost = bstp_calc_path_cost(bp);
+   if (bp-bp_path_cost != cost) {
+   bp-bp_path_cost = cost;
+   changed = 1;
+   }
bp-bp_flags = ~BSTP_PORT_PNDCOST;
}
 
-   if (bp-bp_role == BSTP_ROLE_DISABLED)
+   if (bp-bp_role == BSTP_ROLE_DISABLED) {
bstp_enable_port(bs, bp);
+   changed = 1;
+   }
} else {
if (bp-bp_role != BSTP_ROLE_DISABLED) {
bstp_disable_port(bs, bp);
+   changed = 1;
if ((bp-bp_flags  BSTP_PORT_ADMEDGE) 
bp-bp_protover == BSTP_PROTO_RSTP)
bp-bp_operedge = 1;
}
}
-   return;
-   }
-
-   if (bp-bp_infois 

svn commit: r236062 - head/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:09:01 2012
New Revision: 236062
URL: http://svn.freebsd.org/changeset/base/236062

Log:
  Turn LACP debugging from a compile time option to a sysctl, it is very handy 
to
  be able to turn it on when negotiation to a switch misbehaves.
  
  Submitted by: Andrew Boyer
  MFC after:3 days

Modified:
  head/sys/net/ieee8023ad_lacp.c

Modified: head/sys/net/ieee8023ad_lacp.c
==
--- head/sys/net/ieee8023ad_lacp.c  Sat May 26 08:03:42 2012
(r236061)
+++ head/sys/net/ieee8023ad_lacp.c  Sat May 26 08:09:01 2012
(r236062)
@@ -38,6 +38,7 @@ __FBSDID($FreeBSD$);
 #include sys/kernel.h /* hz */
 #include sys/socket.h /* for net/if.h */
 #include sys/sockio.h
+#include sys/sysctl.h
 #include machine/stdarg.h
 #include sys/lock.h
 #include sys/rwlock.h
@@ -168,7 +169,8 @@ static void lacp_enable_distributing(str
 static int lacp_xmit_lacpdu(struct lacp_port *);
 static int lacp_xmit_marker(struct lacp_port *);
 
-#if defined(LACP_DEBUG)
+/* Debugging */
+
 static voidlacp_dump_lacpdu(const struct lacpdu *);
 static const char *lacp_format_partner(const struct lacp_peerinfo *, char *,
size_t);
@@ -184,10 +186,14 @@ static const char *lacp_format_portid(co
size_t);
 static voidlacp_dprintf(const struct lacp_port *, const char *, ...)
__attribute__((__format__(__printf__, 2, 3)));
-#defineLACP_DPRINTF(a) lacp_dprintf a
-#else
-#define LACP_DPRINTF(a) /* nothing */
-#endif
+
+static int lacp_debug = 0;
+SYSCTL_INT(_net, OID_AUTO, lacp_debug, CTLFLAG_RW | CTLFLAG_TUN,
+lacp_debug, 0, Enable LACP debug logging (1=debug, 2=trace));
+TUNABLE_INT(net.lacp_debug, lacp_debug);
+
+#define LACP_DPRINTF(a) if (lacp_debug  0) { lacp_dprintf a ; }
+#define LACP_TRACE(a) if (lacp_debug  1) { lacp_dprintf(a,%s\n,__func__); }
 
 /*
  * partner administration variables.
@@ -290,10 +296,10 @@ lacp_pdu_input(struct lacp_port *lp, str
goto bad;
}
 
-#if defined(LACP_DEBUG)
-   LACP_DPRINTF((lp, lacpdu receive\n));
-   lacp_dump_lacpdu(du);
-#endif /* defined(LACP_DEBUG) */
+if (lacp_debug  0) {
+   lacp_dprintf(lp, lacpdu receive\n);
+   lacp_dump_lacpdu(du);
+   }
 
LACP_LOCK(lsc);
lacp_sm_rx(lp, du);
@@ -370,10 +376,10 @@ lacp_xmit_lacpdu(struct lacp_port *lp)
sizeof(du-ldu_collector));
du-ldu_collector.lci_maxdelay = 0;
 
-#if defined(LACP_DEBUG)
-   LACP_DPRINTF((lp, lacpdu transmit\n));
-   lacp_dump_lacpdu(du);
-#endif /* defined(LACP_DEBUG) */
+   if (lacp_debug  0) {
+   lacp_dprintf(lp, lacpdu transmit\n);
+   lacp_dump_lacpdu(du);
+   }
 
m-m_flags |= M_MCAST;
 
@@ -647,9 +653,7 @@ lacp_disable_distributing(struct lacp_po
 {
struct lacp_aggregator *la = lp-lp_aggregator;
struct lacp_softc *lsc = lp-lp_lsc;
-#if defined(LACP_DEBUG)
char buf[LACP_LAGIDSTR_MAX+1];
-#endif /* defined(LACP_DEBUG) */
 
LACP_LOCK_ASSERT(lsc);
 
@@ -684,9 +688,7 @@ lacp_enable_distributing(struct lacp_por
 {
struct lacp_aggregator *la = lp-lp_aggregator;
struct lacp_softc *lsc = lp-lp_lsc;
-#if defined(LACP_DEBUG)
char buf[LACP_LAGIDSTR_MAX+1];
-#endif /* defined(LACP_DEBUG) */
 
LACP_LOCK_ASSERT(lsc);
 
@@ -720,7 +722,8 @@ lacp_transit_expire(void *vp)
 
LACP_LOCK_ASSERT(lsc);
 
-   LACP_DPRINTF((NULL, %s\n, __func__));
+   LACP_TRACE(NULL);
+
lsc-lsc_suppress_distributing = FALSE;
 }
 
@@ -838,7 +841,8 @@ lacp_suppress_distributing(struct lacp_s
return;
}
 
-   LACP_DPRINTF((NULL, %s\n, __func__));
+   LACP_TRACE(NULL);
+
lsc-lsc_suppress_distributing = TRUE;
 
/* send a marker frame down each port to verify the queues are empty */
@@ -908,11 +912,9 @@ lacp_select_active_aggregator(struct lac
struct lacp_aggregator *la;
struct lacp_aggregator *best_la = NULL;
uint64_t best_speed = 0;
-#if defined(LACP_DEBUG)
char buf[LACP_LAGIDSTR_MAX+1];
-#endif /* defined(LACP_DEBUG) */
 
-   LACP_DPRINTF((NULL, %s:\n, __func__));
+   LACP_TRACE(NULL);
 
TAILQ_FOREACH(la, lsc-lsc_aggregators, la_q) {
uint64_t speed;
@@ -946,7 +948,6 @@ lacp_select_active_aggregator(struct lac
KASSERT(best_la == NULL || !TAILQ_EMPTY(best_la-la_ports),
(invalid aggregator list));
 
-#if defined(LACP_DEBUG)
if (lsc-lsc_active_aggregator != best_la) {
LACP_DPRINTF((NULL, active aggregator changed\n));
LACP_DPRINTF((NULL, old %s\n,
@@ -957,7 +958,6 @@ lacp_select_active_aggregator(struct lac
}
LACP_DPRINTF((NULL, new %s\n,
lacp_format_lagid_aggregator(best_la, buf, sizeof(buf;
-#endif /* defined(LACP_DEBUG) */
 
if 

svn commit: r236064 - stable/9/sbin/ifconfig

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:18:46 2012
New Revision: 236064
URL: http://svn.freebsd.org/changeset/base/236064

Log:
  MFC r232638
  
   Fix typo in lagg options.

Modified:
  stable/9/sbin/ifconfig/ifconfig.8
Directory Properties:
  stable/9/sbin/ifconfig/   (props changed)

Modified: stable/9/sbin/ifconfig/ifconfig.8
==
--- stable/9/sbin/ifconfig/ifconfig.8   Sat May 26 08:17:30 2012
(r236063)
+++ stable/9/sbin/ifconfig/ifconfig.8   Sat May 26 08:18:46 2012
(r236064)
@@ -28,7 +28,7 @@
 .\ From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\ $FreeBSD$
 .\
-.Dd March 4, 2012
+.Dd March 7, 2012
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -2289,7 +2289,7 @@ src/dst mac address and optional vlan nu
 .It Cm l3
 src/dst address for IPv4 or IPv6.
 .It Cm l4
-src/dst port for TCP/UCP/SCTP.
+src/dst port for TCP/UDP/SCTP.
 .El
 .Pp
 .El
___
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: r236065 - stable/9/share/man/man4

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:21:11 2012
New Revision: 236065
URL: http://svn.freebsd.org/changeset/base/236065

Log:
  MFC r232009
  
   Make it clear that fec is just an alias

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

Modified: stable/9/share/man/man4/lagg.4
==
--- stable/9/share/man/man4/lagg.4  Sat May 26 08:18:46 2012
(r236064)
+++ stable/9/share/man/man4/lagg.4  Sat May 26 08:21:11 2012
(r236065)
@@ -88,8 +88,9 @@ variable to a nonzero value,
 which is useful for certain bridged network setups.
 .It Ic fec
 Supports Cisco EtherChannel.
-This is a static setup and does not negotiate aggregation with the peer or
-exchange frames to monitor the link.
+This is an alias for
+.Ic loadbalance
+mode.
 .It Ic lacp
 Supports the IEEE 802.3ad Link Aggregation Control Protocol (LACP) and the
 Marker Protocol.
___
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: r236066 - stable/8/sbin/ifconfig

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:23:26 2012
New Revision: 236066
URL: http://svn.freebsd.org/changeset/base/236066

Log:
  MFC r232638
  
Fix typo in lagg options.

Modified:
  stable/8/sbin/ifconfig/ifconfig.8
Directory Properties:
  stable/8/sbin/ifconfig/   (props changed)

Modified: stable/8/sbin/ifconfig/ifconfig.8
==
--- stable/8/sbin/ifconfig/ifconfig.8   Sat May 26 08:21:11 2012
(r236065)
+++ stable/8/sbin/ifconfig/ifconfig.8   Sat May 26 08:23:26 2012
(r236066)
@@ -28,7 +28,7 @@
 .\ From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\ $FreeBSD$
 .\
-.Dd February 29, 2012
+.Dd March 7, 2012
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -2246,7 +2246,7 @@ src/dst mac address and optional vlan nu
 .It Cm l3
 src/dst address for IPv4 or IPv6.
 .It Cm l4
-src/dst port for TCP/UCP/SCTP.
+src/dst port for TCP/UDP/SCTP.
 .El
 .Pp
 .El
___
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: r236067 - stable/9/share/man/man9

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:25:25 2012
New Revision: 236067
URL: http://svn.freebsd.org/changeset/base/236067

Log:
  MFC r232321
  
   Correct the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a
   system tunable has never been implemented. This flag is only used by 
sysctl(8)
   to provide a helpful error message.

Modified:
  stable/9/share/man/man9/sysctl.9
Directory Properties:
  stable/9/share/man/man9/   (props changed)

Modified: stable/9/share/man/man9/sysctl.9
==
--- stable/9/share/man/man9/sysctl.9Sat May 26 08:23:26 2012
(r236066)
+++ stable/9/share/man/man9/sysctl.9Sat May 26 08:25:25 2012
(r236067)
@@ -138,9 +138,9 @@ This sysctl can be written to by process
 .It Dv CTLFLAG_SKIP
 When iterating the sysctl name space, do not list this sysctl.
 .It Dv CTLFLAG_TUN
-Also declare a system tunable with the same name to initialize this variable.
+Advisory flag that a system tunable also exists for this variable.
 .It Dv CTLFLAG_RDTUN
-Also declare a system tunable with the same name to initialize this variable;
+Advisory flag that a system tunable also exists for this variable;
 however, the run-time variable is read-only.
 .El
 .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: r236068 - stable/8/share/man/man9

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:25:41 2012
New Revision: 236068
URL: http://svn.freebsd.org/changeset/base/236068

Log:
  MFC r232321
  
   Correct the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a
   system tunable has never been implemented. This flag is only used by 
sysctl(8)
   to provide a helpful error message.

Modified:
  stable/8/share/man/man9/sysctl.9
Directory Properties:
  stable/8/share/man/man9/   (props changed)

Modified: stable/8/share/man/man9/sysctl.9
==
--- stable/8/share/man/man9/sysctl.9Sat May 26 08:25:25 2012
(r236067)
+++ stable/8/share/man/man9/sysctl.9Sat May 26 08:25:41 2012
(r236068)
@@ -142,9 +142,9 @@ This sysctl can be written to by process
 .It Dv CTLFLAG_SKIP
 When iterating the sysctl name space, do not list this sysctl.
 .It Dv CTLFLAG_TUN
-Also declare a system tunable with the same name to initialize this variable.
+Advisory flag that a system tunable also exists for this variable.
 .It Dv CTLFLAG_RDTUN
-Also declare a system tunable with the same name to initialize this variable;
+Advisory flag that a system tunable also exists for this variable;
 however, the run-time variable is read-only.
 .El
 .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: r236071 - stable/9/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:41:17 2012
New Revision: 236071
URL: http://svn.freebsd.org/changeset/base/236071

Log:
  MFC r231130 (pjd)
  
   Allow to set if_bridge(4) sysctls from /boot/loader.conf.

Modified:
  stable/9/sys/net/if_bridge.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/net/if_bridge.c
==
--- stable/9/sys/net/if_bridge.cSat May 26 08:33:53 2012
(r236070)
+++ stable/9/sys/net/if_bridge.cSat May 26 08:41:17 2012
(r236071)
@@ -358,19 +358,26 @@ static int pfil_local_phys = 0; /* run p
locally destined packets */
 static int log_stp   = 0;   /* log STP state changes */
 static int bridge_inherit_mac = 0;   /* share MAC with first bridge member */
+TUNABLE_INT(net.link.bridge.pfil_onlyip, pfil_onlyip);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, CTLFLAG_RW,
 pfil_onlyip, 0, Only pass IP packets when pfil is enabled);
+TUNABLE_INT(net.link.bridge.ipfw_arp, pfil_ipfw_arp);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, CTLFLAG_RW,
 pfil_ipfw_arp, 0, Filter ARP packets through IPFW layer2);
+TUNABLE_INT(net.link.bridge.pfil_bridge, pfil_bridge);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge, CTLFLAG_RW,
 pfil_bridge, 0, Packet filter on the bridge interface);
+TUNABLE_INT(net.link.bridge.pfil_member, pfil_member);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member, CTLFLAG_RW,
 pfil_member, 0, Packet filter on the member interface);
+TUNABLE_INT(net.link.bridge.pfil_local_phys, pfil_local_phys);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys, CTLFLAG_RW,
 pfil_local_phys, 0,
 Packet filter on the physical interface for locally destined packets);
+TUNABLE_INT(net.link.bridge.log_stp, log_stp);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, CTLFLAG_RW,
 log_stp, 0, Log STP state changes);
+TUNABLE_INT(net.link.bridge.inherit_mac, bridge_inherit_mac);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RW,
 bridge_inherit_mac, 0,
 Inherit MAC address from the first bridge member);
___
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: r236072 - stable/8/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:41:48 2012
New Revision: 236072
URL: http://svn.freebsd.org/changeset/base/236072

Log:
  MFC r231130 (pjd)
  
   Allow to set if_bridge(4) sysctls from /boot/loader.conf.

Modified:
  stable/8/sys/net/if_bridge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/net/if_bridge.c
==
--- stable/8/sys/net/if_bridge.cSat May 26 08:41:17 2012
(r236071)
+++ stable/8/sys/net/if_bridge.cSat May 26 08:41:48 2012
(r236072)
@@ -358,19 +358,26 @@ static int pfil_local_phys = 0; /* run p
locally destined packets */
 static int log_stp   = 0;   /* log STP state changes */
 static int bridge_inherit_mac = 0;   /* share MAC with first bridge member */
+TUNABLE_INT(net.link.bridge.pfil_onlyip, pfil_onlyip);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, CTLFLAG_RW,
 pfil_onlyip, 0, Only pass IP packets when pfil is enabled);
+TUNABLE_INT(net.link.bridge.ipfw_arp, pfil_ipfw_arp);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, CTLFLAG_RW,
 pfil_ipfw_arp, 0, Filter ARP packets through IPFW layer2);
+TUNABLE_INT(net.link.bridge.pfil_bridge, pfil_bridge);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge, CTLFLAG_RW,
 pfil_bridge, 0, Packet filter on the bridge interface);
+TUNABLE_INT(net.link.bridge.pfil_member, pfil_member);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member, CTLFLAG_RW,
 pfil_member, 0, Packet filter on the member interface);
+TUNABLE_INT(net.link.bridge.pfil_local_phys, pfil_local_phys);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys, CTLFLAG_RW,
 pfil_local_phys, 0,
 Packet filter on the physical interface for locally destined packets);
+TUNABLE_INT(net.link.bridge.log_stp, log_stp);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, CTLFLAG_RW,
 log_stp, 0, Log STP state changes);
+TUNABLE_INT(net.link.bridge.inherit_mac, bridge_inherit_mac);
 SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RW,
 bridge_inherit_mac, 0,
 Inherit MAC address from the first bridge member);
___
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: r236075 - stable/8/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:44:50 2012
New Revision: 236075
URL: http://svn.freebsd.org/changeset/base/236075

Log:
  MFC r234936 (emaste)
  
   Relax restriction on direct tx to child ports
  
   Lagg(4) restricts the type of packet that may be sent directly to a child
   port, to avoid undesired output from accidental misconfiguration.
   Previously only ETHERTYPE_PAE was permitted.
  
   BPF writes to a lagg(4) child port are presumably intentional, so just
   allow them, while still blocking other packets that should take the
   aggregation path.
  
  PR:   kern/138620

Modified:
  stable/8/sys/net/if_lagg.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/net/if_lagg.c
==
--- stable/8/sys/net/if_lagg.c  Sat May 26 08:44:26 2012(r236074)
+++ stable/8/sys/net/if_lagg.c  Sat May 26 08:44:50 2012(r236075)
@@ -756,28 +756,18 @@ fallback:
return (EINVAL);
 }
 
+/*
+ * For direct output to child ports.
+ */
 static int
 lagg_port_output(struct ifnet *ifp, struct mbuf *m,
struct sockaddr *dst, struct route *ro)
 {
struct lagg_port *lp = ifp-if_lagg;
-   struct ether_header *eh;
-   short type = 0;
 
switch (dst-sa_family) {
case pseudo_AF_HDRCMPLT:
case AF_UNSPEC:
-   eh = (struct ether_header *)dst-sa_data;
-   type = eh-ether_type;
-   break;
-   }
-
-   /*
-* Only allow ethernet types required to initiate or maintain the link,
-* aggregated frames take a different path.
-*/
-   switch (ntohs(type)) {
-   case ETHERTYPE_PAE: /* EAPOL PAE/802.1x */
return ((*lp-lp_output)(ifp, m, dst, ro));
}
 
___
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: r236074 - stable/9/sys/net

2012-05-26 Thread Andrew Thompson
Author: thompsa
Date: Sat May 26 08:44:26 2012
New Revision: 236074
URL: http://svn.freebsd.org/changeset/base/236074

Log:
  MFC r234936 (emaste)
  
   Relax restriction on direct tx to child ports
  
   Lagg(4) restricts the type of packet that may be sent directly to a child
   port, to avoid undesired output from accidental misconfiguration.
   Previously only ETHERTYPE_PAE was permitted.
  
   BPF writes to a lagg(4) child port are presumably intentional, so just
   allow them, while still blocking other packets that should take the
   aggregation path.
  
  PR:   kern/138620

Modified:
  stable/9/sys/net/if_lagg.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/net/if_lagg.c
==
--- stable/9/sys/net/if_lagg.c  Sat May 26 08:43:51 2012(r236073)
+++ stable/9/sys/net/if_lagg.c  Sat May 26 08:44:26 2012(r236074)
@@ -764,28 +764,18 @@ fallback:
return (EINVAL);
 }
 
+/*
+ * For direct output to child ports.
+ */
 static int
 lagg_port_output(struct ifnet *ifp, struct mbuf *m,
struct sockaddr *dst, struct route *ro)
 {
struct lagg_port *lp = ifp-if_lagg;
-   struct ether_header *eh;
-   short type = 0;
 
switch (dst-sa_family) {
case pseudo_AF_HDRCMPLT:
case AF_UNSPEC:
-   eh = (struct ether_header *)dst-sa_data;
-   type = eh-ether_type;
-   break;
-   }
-
-   /*
-* Only allow ethernet types required to initiate or maintain the link,
-* aggregated frames take a different path.
-*/
-   switch (ntohs(type)) {
-   case ETHERTYPE_PAE: /* EAPOL PAE/802.1x */
return ((*lp-lp_output)(ifp, m, dst, ro));
}
 
___
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: r235870 - head/usr.bin/sockstat

2012-05-23 Thread Andrew Thompson
Author: thompsa
Date: Thu May 24 01:31:10 2012
New Revision: 235870
URL: http://svn.freebsd.org/changeset/base/235870

Log:
  Allow the socket list to be limited to a specific jail id.
  
  No objections:current@

Modified:
  head/usr.bin/sockstat/sockstat.1
  head/usr.bin/sockstat/sockstat.c

Modified: head/usr.bin/sockstat/sockstat.1
==
--- head/usr.bin/sockstat/sockstat.1Thu May 24 01:30:17 2012
(r235869)
+++ head/usr.bin/sockstat/sockstat.1Thu May 24 01:31:10 2012
(r235870)
@@ -27,7 +27,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd January 24, 2012
+.Dd May 16, 2012
 .Dt SOCKSTAT 1
 .Os
 .Sh NAME
@@ -36,6 +36,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl 46cLlu
+.Op Fl j Ar jid
 .Op Fl p Ar ports
 .Op Fl P Ar protocols
 .Sh DESCRIPTION
@@ -57,6 +58,8 @@ Show
 (IPv6) sockets.
 .It Fl c
 Show connected sockets.
+.It Fl j Ar jid
+Show only sockets belonging to the specified jail ID.
 .It Fl L
 Only show Internet sockets if the local or foreign addresses are not
 in the loopback network prefix

Modified: head/usr.bin/sockstat/sockstat.c
==
--- head/usr.bin/sockstat/sockstat.cThu May 24 01:30:17 2012
(r235869)
+++ head/usr.bin/sockstat/sockstat.cThu May 24 01:31:10 2012
(r235870)
@@ -62,6 +62,7 @@ __FBSDID($FreeBSD$);
 static int  opt_4; /* Show IPv4 sockets */
 static int  opt_6; /* Show IPv6 sockets */
 static int  opt_c; /* Show connected sockets */
+static int  opt_j; /* Show specified jail */
 static int  opt_L; /* Don't show IPv4 or IPv6 loopback sockets */
 static int  opt_l; /* Show listening sockets */
 static int  opt_u; /* Show Unix domain sockets */
@@ -549,6 +550,27 @@ getprocname(pid_t pid)
 }
 
 static int
+getprocjid(pid_t pid)
+{
+   static struct kinfo_proc proc;
+   size_t len;
+   int mib[4];
+
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_PROC;
+   mib[2] = KERN_PROC_PID;
+   mib[3] = (int)pid;
+   len = sizeof proc;
+   if (sysctl(mib, 4, proc, len, NULL, 0) == -1) {
+   /* Do not warn if the process exits before we get its jid. */
+   if (errno != ESRCH)
+   warn(sysctl());
+   return (-1);
+   }
+   return (proc.ki_jid);
+}
+
+static int
 check_ports(struct sock *s)
 {
int port;
@@ -643,6 +665,8 @@ display(void)
for (xf = xfiles, n = 0; n  nxfiles; ++n, ++xf) {
if (xf-xf_data == NULL)
continue;
+   if (opt_j = 0  opt_j != getprocjid(xf-xf_pid))
+   continue;
hash = (int)((uintptr_t)xf-xf_data % HASHSIZE);
for (s = sockhash[hash]; s != NULL; s = s-next)
if ((void *)s-socket == xf-xf_data)
@@ -668,6 +692,8 @@ display(void)
pos += xprintf(%d , xf-xf_fd);
displaysock(s, pos);
}
+   if (opt_j = 0)
+   return;
for (hash = 0; hash  HASHSIZE; hash++) {
for (s = sockhash[hash]; s != NULL; s = s-next) {
if (s-shown)
@@ -716,7 +742,8 @@ main(int argc, char *argv[])
int protos_defined = -1;
int o, i;
 
-   while ((o = getopt(argc, argv, 46cLlp:P:uv)) != -1)
+   opt_j = -1;
+   while ((o = getopt(argc, argv, 46cj:Llp:P:uv)) != -1)
switch (o) {
case '4':
opt_4 = 1;
@@ -727,6 +754,9 @@ main(int argc, char *argv[])
case 'c':
opt_c = 1;
break;
+   case 'j':
+   opt_j = atoi(optarg);
+   break;
case 'L':
opt_L = 1;
break;
___
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: r235144 - head/sys/dev/tsec

2012-05-08 Thread Andrew Thompson
Author: thompsa
Date: Tue May  8 21:09:03 2012
New Revision: 235144
URL: http://svn.freebsd.org/changeset/base/235144

Log:
  The DEVICE_POLLING dereference of sc-tsec_ifp needs to be checked for null
  first or this will panic. Condense three blocks that check sc-tsec_ifp into
  one while I am here.

Modified:
  head/sys/dev/tsec/if_tsec.c

Modified: head/sys/dev/tsec/if_tsec.c
==
--- head/sys/dev/tsec/if_tsec.c Tue May  8 19:47:52 2012(r235143)
+++ head/sys/dev/tsec/if_tsec.c Tue May  8 21:09:03 2012(r235144)
@@ -289,17 +289,17 @@ int
 tsec_detach(struct tsec_softc *sc)
 {
 
+   if (sc-tsec_ifp != NULL) {
 #ifdef DEVICE_POLLING
-   if (sc-tsec_ifp-if_capenable  IFCAP_POLLING)
-   ether_poll_deregister(sc-tsec_ifp);
+   if (sc-tsec_ifp-if_capenable  IFCAP_POLLING)
+   ether_poll_deregister(sc-tsec_ifp);
 #endif
 
-   /* Stop TSEC controller and free TX queue */
-   if (sc-sc_rres  sc-tsec_ifp)
-   tsec_shutdown(sc-dev);
+   /* Stop TSEC controller and free TX queue */
+   if (sc-sc_rres)
+   tsec_shutdown(sc-dev);
 
-   /* Detach network interface */
-   if (sc-tsec_ifp) {
+   /* Detach network interface */
ether_ifdetach(sc-tsec_ifp);
if_free(sc-tsec_ifp);
sc-tsec_ifp = NULL;
___
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: r235147 - head/sys/dev/tsec

2012-05-08 Thread Andrew Thompson
Author: thompsa
Date: Wed May  9 00:56:11 2012
New Revision: 235147
URL: http://svn.freebsd.org/changeset/base/235147

Log:
  Do not reinitialise the interface if it is already running, this prevents the
  bootp+nfs code from working as it calls init on each dhcp send and rx fails to
  start in time.

Modified:
  head/sys/dev/tsec/if_tsec.c

Modified: head/sys/dev/tsec/if_tsec.c
==
--- head/sys/dev/tsec/if_tsec.c Wed May  9 00:56:08 2012(r235146)
+++ head/sys/dev/tsec/if_tsec.c Wed May  9 00:56:11 2012(r235147)
@@ -358,6 +358,9 @@ tsec_init_locked(struct tsec_softc *sc)
struct ifnet *ifp = sc-tsec_ifp;
uint32_t timeout, val, i;
 
+   if (ifp-if_drv_flags  IFF_DRV_RUNNING)
+   return;
+
TSEC_GLOBAL_LOCK_ASSERT(sc);
tsec_stop(sc);
 
___
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: r234487 - head/sys/net

2012-04-20 Thread Andrew Thompson
Author: thompsa
Date: Fri Apr 20 09:55:50 2012
New Revision: 234487
URL: http://svn.freebsd.org/changeset/base/234487

Log:
  Add linkstate to bridge(4), set the link to up when at least one underlying
  interface is up, otherwise the link is down.
  
  This, among other things, allows carp to work on a bridge.
  
  Prodded by:   glebius
  Tested by:Alexander Lunev

Modified:
  head/sys/net/bridgestp.c
  head/sys/net/bridgestp.h
  head/sys/net/if.c
  head/sys/net/if_bridge.c

Modified: head/sys/net/bridgestp.c
==
--- head/sys/net/bridgestp.cFri Apr 20 09:43:42 2012(r234486)
+++ head/sys/net/bridgestp.cFri Apr 20 09:55:50 2012(r234487)
@@ -1767,28 +1767,16 @@ bstp_notify_rtage(void *arg, int pending
 }
 
 void
-bstp_linkstate(struct ifnet *ifp, int state)
+bstp_linkstate(struct bstp_port *bp)
 {
-   struct bstp_state *bs;
-   struct bstp_port *bp;
+   struct bstp_state *bs = bp-bp_bs;
 
-   /* search for the stp port */
-   mtx_lock(bstp_list_mtx);
-   LIST_FOREACH(bs, bstp_list, bs_list) {
-   BSTP_LOCK(bs);
-   LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
-   if (bp-bp_ifp == ifp) {
-   bstp_ifupdstatus(bs, bp);
-   bstp_update_state(bs, bp);
-   /* it only exists once so return */
-   BSTP_UNLOCK(bs);
-   mtx_unlock(bstp_list_mtx);
-   return;
-   }
-   }
-   BSTP_UNLOCK(bs);
+   BSTP_LOCK(bs);
+   if (bp-bp_active) {
+   bstp_ifupdstatus(bs, bp);
+   bstp_update_state(bs, bp);
}
-   mtx_unlock(bstp_list_mtx);
+   BSTP_UNLOCK(bs);
 }
 
 static void
@@ -2103,10 +2091,8 @@ bstp_modevent(module_t mod, int type, vo
case MOD_LOAD:
mtx_init(bstp_list_mtx, bridgestp list, NULL, MTX_DEF);
LIST_INIT(bstp_list);
-   bstp_linkstate_p = bstp_linkstate;
break;
case MOD_UNLOAD:
-   bstp_linkstate_p = NULL;
mtx_destroy(bstp_list_mtx);
break;
default:

Modified: head/sys/net/bridgestp.h
==
--- head/sys/net/bridgestp.hFri Apr 20 09:43:42 2012(r234486)
+++ head/sys/net/bridgestp.hFri Apr 20 09:55:50 2012(r234487)
@@ -369,8 +369,6 @@ struct bstp_state {
 
 extern const uint8_t bstp_etheraddr[];
 
-extern void (*bstp_linkstate_p)(struct ifnet *ifp, int state);
-
 void   bstp_attach(struct bstp_state *, struct bstp_cb_ops *);
 void   bstp_detach(struct bstp_state *);
 void   bstp_init(struct bstp_state *);
@@ -379,7 +377,7 @@ int bstp_create(struct bstp_state *, str
 intbstp_enable(struct bstp_port *);
 void   bstp_disable(struct bstp_port *);
 void   bstp_destroy(struct bstp_port *);
-void   bstp_linkstate(struct ifnet *, int);
+void   bstp_linkstate(struct bstp_port *);
 intbstp_set_htime(struct bstp_state *, int);
 intbstp_set_fdelay(struct bstp_state *, int);
 intbstp_set_maxage(struct bstp_state *, int);

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Fri Apr 20 09:43:42 2012(r234486)
+++ head/sys/net/if.c   Fri Apr 20 09:55:50 2012(r234487)
@@ -124,7 +124,7 @@ static MALLOC_DEFINE(M_IFDESCR, ifdescr
 static struct sx ifdescr_sx;
 SX_SYSINIT(ifdescr_sx, ifdescr_sx, ifnet descr);
 
-void   (*bstp_linkstate_p)(struct ifnet *ifp, int state);
+void   (*bridge_linkstate_p)(struct ifnet *ifp);
 void   (*ng_ether_link_state_p)(struct ifnet *ifp, int state);
 void   (*lagg_linkstate_p)(struct ifnet *ifp, int state);
 /* These are external hooks for CARP. */
@@ -1910,7 +1910,7 @@ do_link_state_change(void *arg, int pend
if (ifp-if_carp)
(*carp_linkstate_p)(ifp);
if (ifp-if_bridge)
-   (*bstp_linkstate_p)(ifp, link_state);
+   (*bridge_linkstate_p)(ifp);
if (ifp-if_lagg)
(*lagg_linkstate_p)(ifp, link_state);
 

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cFri Apr 20 09:43:42 2012(r234486)
+++ head/sys/net/if_bridge.cFri Apr 20 09:55:50 2012(r234487)
@@ -333,6 +333,9 @@ static int  bridge_ip6_checkbasic(struct 
 #endif /* INET6 */
 static int bridge_fragment(struct ifnet *, struct mbuf *,
struct ether_header *, int, struct llc *);
+static voidbridge_linkstate(struct ifnet *ifp);
+
+extern void (*bridge_linkstate_p)(struct ifnet *ifp);
 
 /* The default bridge vlan is 1 (IEEE 802.1Q-2003 Table 9-2) */
 #defineVLANTAGOF(_m)   \
@@ -496,6 

svn commit: r234488 - head/sys/net

2012-04-20 Thread Andrew Thompson
Author: thompsa
Date: Fri Apr 20 10:06:28 2012
New Revision: 234488
URL: http://svn.freebsd.org/changeset/base/234488

Log:
  Move the interface media check to a taskqueue, some interfaces (usb) sleep
  during SIOCGIFMEDIA and we were holding locks.

Modified:
  head/sys/net/bridgestp.c
  head/sys/net/bridgestp.h

Modified: head/sys/net/bridgestp.c
==
--- head/sys/net/bridgestp.cFri Apr 20 09:55:50 2012(r234487)
+++ head/sys/net/bridgestp.cFri Apr 20 10:06:28 2012(r234488)
@@ -127,7 +127,7 @@ static int  bstp_rerooted(struct bstp_sta
 static uint32_tbstp_calc_path_cost(struct bstp_port *);
 static voidbstp_notify_state(void *, int);
 static voidbstp_notify_rtage(void *, int);
-static voidbstp_ifupdstatus(struct bstp_state *, struct bstp_port *);
+static voidbstp_ifupdstatus(void *, int);
 static voidbstp_enable_port(struct bstp_state *, struct bstp_port *);
 static voidbstp_disable_port(struct bstp_state *, struct bstp_port *);
 static voidbstp_tick(void *);
@@ -1677,7 +1677,7 @@ bstp_set_autoptp(struct bstp_port *bp, i
if (set) {
bp-bp_flags |= BSTP_PORT_AUTOPTP;
if (bp-bp_role != BSTP_ROLE_DISABLED)
-   bstp_ifupdstatus(bs, bp);
+   taskqueue_enqueue(taskqueue_swi, bp-bp_mediatask);
} else
bp-bp_flags = ~BSTP_PORT_AUTOPTP;
BSTP_UNLOCK(bs);
@@ -1771,69 +1771,89 @@ bstp_linkstate(struct bstp_port *bp)
 {
struct bstp_state *bs = bp-bp_bs;
 
+   if (!bp-bp_active)
+   return;
+
+   bstp_ifupdstatus(bp, 0);
BSTP_LOCK(bs);
-   if (bp-bp_active) {
-   bstp_ifupdstatus(bs, bp);
-   bstp_update_state(bs, bp);
-   }
+   bstp_update_state(bs, bp);
BSTP_UNLOCK(bs);
 }
 
 static void
-bstp_ifupdstatus(struct bstp_state *bs, struct bstp_port *bp)
+bstp_ifupdstatus(void *arg, int pending)
 {
+   struct bstp_port *bp = (struct bstp_port *)arg;
+   struct bstp_state *bs = bp-bp_bs;
struct ifnet *ifp = bp-bp_ifp;
struct ifmediareq ifmr;
-   int error = 0;
+   int error, changed;
 
-   BSTP_LOCK_ASSERT(bs);
+   if (!bp-bp_active)
+   return;
 
bzero((char *)ifmr, sizeof(ifmr));
error = (*ifp-if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)ifmr);
 
+   BSTP_LOCK(bs);
+   changed = 0;
if ((error == 0)  (ifp-if_flags  IFF_UP)) {
if (ifmr.ifm_status  IFM_ACTIVE) {
/* A full-duplex link is assumed to be point to point */
if (bp-bp_flags  BSTP_PORT_AUTOPTP) {
-   bp-bp_ptp_link =
-   ifmr.ifm_active  IFM_FDX ? 1 : 0;
+   int fdx;
+
+   fdx = ifmr.ifm_active  IFM_FDX ? 1 : 0;
+   if (bp-bp_ptp_link ^ fdx) {
+   bp-bp_ptp_link = fdx;
+   changed = 1;
+   }
}
 
/* Calc the cost if the link was down previously */
if (bp-bp_flags  BSTP_PORT_PNDCOST) {
-   bp-bp_path_cost = bstp_calc_path_cost(bp);
+   uint32_t cost;
+
+   cost = bstp_calc_path_cost(bp);
+   if (bp-bp_path_cost != cost) {
+   bp-bp_path_cost = cost;
+   changed = 1;
+   }
bp-bp_flags = ~BSTP_PORT_PNDCOST;
}
 
-   if (bp-bp_role == BSTP_ROLE_DISABLED)
+   if (bp-bp_role == BSTP_ROLE_DISABLED) {
bstp_enable_port(bs, bp);
+   changed = 1;
+   }
} else {
if (bp-bp_role != BSTP_ROLE_DISABLED) {
bstp_disable_port(bs, bp);
+   changed = 1;
if ((bp-bp_flags  BSTP_PORT_ADMEDGE) 
bp-bp_protover == BSTP_PROTO_RSTP)
bp-bp_operedge = 1;
}
}
-   return;
-   }
-
-   if (bp-bp_infois != BSTP_INFO_DISABLED)
+   } else if (bp-bp_infois != BSTP_INFO_DISABLED) {
bstp_disable_port(bs, bp);
+   changed = 1;
+   }
+   if (changed)
+   bstp_assign_roles(bs);
+   BSTP_UNLOCK(bs);
 }
 
 static void
 bstp_enable_port(struct bstp_state *bs, struct bstp_port *bp)
 {
bp-bp_infois = BSTP_INFO_AGED;
-   

svn commit: r234403 - head/sys/net

2012-04-17 Thread Andrew Thompson
Author: thompsa
Date: Wed Apr 18 01:39:14 2012
New Revision: 234403
URL: http://svn.freebsd.org/changeset/base/234403

Log:
  Remove KASSERTS, they do not add any value here since the pointer is about to
  be derefernced anyway.

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Tue Apr 17 22:05:55 2012(r234402)
+++ head/sys/net/if.c   Wed Apr 18 01:39:14 2012(r234403)
@@ -1909,14 +1909,10 @@ do_link_state_change(void *arg, int pend
(*ng_ether_link_state_p)(ifp, link_state);
if (ifp-if_carp)
(*carp_linkstate_p)(ifp);
-   if (ifp-if_bridge) {
-   KASSERT(bstp_linkstate_p != NULL,(if_bridge bstp not 
loaded!));
+   if (ifp-if_bridge)
(*bstp_linkstate_p)(ifp, link_state);
-   }
-   if (ifp-if_lagg) {
-   KASSERT(lagg_linkstate_p != NULL,(if_lagg not loaded!));
+   if (ifp-if_lagg)
(*lagg_linkstate_p)(ifp, link_state);
-   }
 
if (IS_DEFAULT_VNET(curvnet))
devctl_notify(IFNET, ifp-if_xname,
___
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: r234403 - head/sys/net

2012-04-17 Thread Andrew Thompson
On 18 April 2012 14:16, Peter Jeremy peterjer...@acm.org wrote:
 On 2012-Apr-18 01:39:14 +, Andrew Thompson thom...@freebsd.org wrote:
Log:
  Remove KASSERTS, they do not add any value here since the pointer is about 
 to
  be derefernced anyway.

 Could you give a bit more background to this commit.  You get a crash in
 both cases but the KASSERT() at least tells you which variable was NULL
 without needing to trawl through the crashdump to find what caused the
 NULL pointer dereference trap.

Out of the five linkstate function pointers in this block of code only
these two had a kassert so it was just about making it more
consistent. It is something that is not possible within the code
anyway (sans memory corruption).


Andrew
___
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: r234163 - head/sys/net

2012-04-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Apr 12 01:07:17 2012
New Revision: 234163
URL: http://svn.freebsd.org/changeset/base/234163

Log:
  Set the proto to LAGG_PROTO_NONE before calling the detach routine so packets
  are discarded, this is an issue because lacp drops the lock which may allow
  network threads to access freed memory. Expand the lock coverage so the
  detach/attach happen atomically.
  
  Submitted by: Andrew Boyer (earlier version)

Modified:
  head/sys/net/if_lagg.c

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Thu Apr 12 00:59:30 2012(r234162)
+++ head/sys/net/if_lagg.c  Thu Apr 12 01:07:17 2012(r234163)
@@ -950,11 +950,11 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
error = EPROTONOSUPPORT;
break;
}
+   LAGG_WLOCK(sc);
if (sc-sc_proto != LAGG_PROTO_NONE) {
-   LAGG_WLOCK(sc);
-   error = sc-sc_detach(sc);
-   /* Reset protocol and pointers */
+   /* Reset protocol first in case detach unlocks */
sc-sc_proto = LAGG_PROTO_NONE;
+   error = sc-sc_detach(sc);
sc-sc_detach = NULL;
sc-sc_start = NULL;
sc-sc_input = NULL;
@@ -966,10 +966,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
sc-sc_lladdr = NULL;
sc-sc_req = NULL;
sc-sc_portreq = NULL;
-   LAGG_WUNLOCK(sc);
+   } else if (sc-sc_input != NULL) {
+   /* Still detaching */
+   error = EBUSY;
}
-   if (error != 0)
+   if (error != 0) {
+   LAGG_WUNLOCK(sc);
break;
+   }
for (int i = 0; i  (sizeof(lagg_protos) /
sizeof(lagg_protos[0])); i++) {
if (lagg_protos[i].ti_proto == ra-ra_proto) {
@@ -977,7 +981,6 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
printf(%s: using proto %u\n,
sc-sc_ifname,
lagg_protos[i].ti_proto);
-   LAGG_WLOCK(sc);
sc-sc_proto = lagg_protos[i].ti_proto;
if (sc-sc_proto != LAGG_PROTO_NONE)
error = lagg_protos[i].ti_attach(sc);
@@ -985,6 +988,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
return (error);
}
}
+   LAGG_WUNLOCK(sc);
error = EPROTONOSUPPORT;
break;
case SIOCGLAGGFLAGS:
___
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: r221780 - head/usr.sbin/freebsd-update

2012-03-11 Thread Andrew Thompson
On 12 May 2011 03:23, Colin Percival cperc...@freebsd.org wrote:
 Author: cperciva
 Date: Wed May 11 15:23:27 2011
 New Revision: 221780
 URL: http://svn.freebsd.org/changeset/base/221780

 Log:
  Make freebsd-update(8) smarter in how it handles $FreeBSD$ tags in
  configuration files.

  Nagged by:    pgollucci
  MFC after:    1 month

This does not appear to have been MFC'd.


Andrew
___
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: r232629 - in head: sbin/ifconfig sys/net

2012-03-06 Thread Andrew Thompson
Author: thompsa
Date: Tue Mar  6 22:58:13 2012
New Revision: 232629
URL: http://svn.freebsd.org/changeset/base/232629

Log:
  Add the ability to set which packet layers are used for the load balance hash
  calculation.

Modified:
  head/sbin/ifconfig/ifconfig.8
  head/sbin/ifconfig/iflagg.c
  head/sys/net/ieee8023ad_lacp.c
  head/sys/net/if_lagg.c
  head/sys/net/if_lagg.h

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Tue Mar  6 22:45:54 2012
(r232628)
+++ head/sbin/ifconfig/ifconfig.8   Tue Mar  6 22:58:13 2012
(r232629)
@@ -2309,6 +2309,21 @@ Set the aggregation protocol.
 The default is failover.
 The available options are failover, fec, lacp, loadbalance, roundrobin and
 none.
+.It Cm lagghash Ar option Ns Oo , Ns Ar option Oc
+Set the packet layers to hash for aggregation protocols which load balance.
+The default is
+.Dq l2,l3,l4 .
+The options can be combined using commas.
+.Pp
+.Bl -tag -width .Cm l2 -compact
+.It Cm l2
+src/dst mac address and optional vlan number.
+.It Cm l3
+src/dst address for IPv4 or IPv6.
+.It Cm l4
+src/dst port for TCP/UCP/SCTP.
+.El
+.Pp
 .El
 .Pp
 The following parameters are specific to IP tunnel interfaces,

Modified: head/sbin/ifconfig/iflagg.c
==
--- head/sbin/ifconfig/iflagg.c Tue Mar  6 22:45:54 2012(r232628)
+++ head/sbin/ifconfig/iflagg.c Tue Mar  6 22:58:13 2012(r232629)
@@ -81,6 +81,36 @@ setlaggproto(const char *val, int d, int
err(1, SIOCSLAGG);
 }
 
+static void
+setlagghash(const char *val, int d, int s, const struct afswtch *afp)
+{
+   struct lagg_reqflags rf;
+   char *str, *tmp, *tok;
+
+
+   rf.rf_flags = 0;
+   str = tmp = strdup(val);
+   while ((tok = strsep(tmp, ,)) != NULL) {
+   if (strcmp(tok, l2) == 0)
+   rf.rf_flags |= LAGG_F_HASHL2;
+   else if (strcmp(tok, l3) == 0)
+   rf.rf_flags |= LAGG_F_HASHL3;
+   else if (strcmp(tok, l4) == 0)
+   rf.rf_flags |= LAGG_F_HASHL4;
+   else  {
+   free(str);
+   errx(1, Invalid lagghash option: %s, tok);
+   }
+   }
+   free(str);
+   if (rf.rf_flags == 0)
+   errx(1, No lagghash options supplied);
+
+   strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname));
+   if (ioctl(s, SIOCSLAGGHASH, rf))
+   err(1, SIOCSLAGGHASH);
+}
+
 static char *
 lacp_format_mac(const uint8_t *mac, char *buf, size_t buflen)
 {
@@ -115,6 +145,7 @@ lagg_status(int s)
struct lagg_protos lpr[] = LAGG_PROTOS;
struct lagg_reqport rp, rpbuf[LAGG_MAX_PORTS];
struct lagg_reqall ra;
+   struct lagg_reqflags rf;
struct lacp_opreq *lp;
const char *proto = unknown;
int i, isport = 0;
@@ -132,6 +163,10 @@ lagg_status(int s)
ra.ra_size = sizeof(rpbuf);
ra.ra_port = rpbuf;
 
+   strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname));
+   if (ioctl(s, SIOCGLAGGFLAGS, rf) != 0)
+   rf.rf_flags = 0;
+
if (ioctl(s, SIOCGLAGG, ra) == 0) {
lp = (struct lacp_opreq *)ra.ra_lacpreq;
 
@@ -143,6 +178,23 @@ lagg_status(int s)
}
 
printf(\tlaggproto %s, proto);
+   if (rf.rf_flags  LAGG_F_HASHMASK) {
+   const char *sep = ;
+
+   printf( lagghash );
+   if (rf.rf_flags  LAGG_F_HASHL2) {
+   printf(%sl2, sep);
+   sep = ,;
+   }
+   if (rf.rf_flags  LAGG_F_HASHL3) {
+   printf(%sl3, sep);
+   sep = ,;
+   }
+   if (rf.rf_flags  LAGG_F_HASHL4) {
+   printf(%sl4, sep);
+   sep = ,;
+   }
+   }
if (isport)
printf( laggdev %s, rp.rp_ifname);
putchar('\n');
@@ -174,6 +226,7 @@ static struct cmd lagg_cmds[] = {
DEF_CMD_ARG(laggport, setlaggport),
DEF_CMD_ARG(-laggport,unsetlaggport),
DEF_CMD_ARG(laggproto,setlaggproto),
+   DEF_CMD_ARG(lagghash, setlagghash),
 };
 static struct afswtch af_lagg = {
.af_name= af_lagg,

Modified: head/sys/net/ieee8023ad_lacp.c
==
--- head/sys/net/ieee8023ad_lacp.c  Tue Mar  6 22:45:54 2012
(r232628)
+++ head/sys/net/ieee8023ad_lacp.c  Tue Mar  6 22:58:13 2012
(r232629)
@@ -815,7 +815,7 @@ lacp_select_tx_port(struct lagg_softc *s
if (sc-use_flowid  (m-m_flags  

Re: svn commit: r232629 - in head: sbin/ifconfig sys/net

2012-03-06 Thread Andrew Thompson
On 7 March 2012 19:07, Andrey Zonov and...@zonov.org wrote:
 On 07.03.2012 2:58, Andrew Thompson wrote:
 [snip]

 Modified: head/sbin/ifconfig/ifconfig.8

 ==
 --- head/sbin/ifconfig/ifconfig.8       Tue Mar  6 22:45:54 2012
  (r232628)
 +++ head/sbin/ifconfig/ifconfig.8       Tue Mar  6 22:58:13 2012
  (r232629)
 @@ -2309,6 +2309,21 @@ Set the aggregation protocol.
  The default is failover.
  The available options are failover, fec, lacp, loadbalance, roundrobin
 and
  none.
 +.It Cm lagghash Ar option Ns Oo , Ns Ar option Oc
 +Set the packet layers to hash for aggregation protocols which load
 balance.
 +The default is
 +.Dq l2,l3,l4 .
 +The options can be combined using commas.
 +.Pp
 +.Bl -tag -width .Cm l2 -compact
 +.It Cm l2
 +src/dst mac address and optional vlan number.
 +.It Cm l3
 +src/dst address for IPv4 or IPv6.
 +.It Cm l4
 +src/dst port for TCP/UCP/SCTP.


 s/UCP/UDP/?

Oops, thanks.
___
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: r232638 - head/sbin/ifconfig

2012-03-06 Thread Andrew Thompson
Author: thompsa
Date: Wed Mar  7 06:25:17 2012
New Revision: 232638
URL: http://svn.freebsd.org/changeset/base/232638

Log:
  Fix typo and bump the document date which I also forgot.
  
  Spotted by:   Andrey Zonov

Modified:
  head/sbin/ifconfig/ifconfig.8

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Wed Mar  7 03:16:45 2012
(r232637)
+++ head/sbin/ifconfig/ifconfig.8   Wed Mar  7 06:25:17 2012
(r232638)
@@ -28,7 +28,7 @@
 .\ From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\ $FreeBSD$
 .\
-.Dd February 29, 2012
+.Dd March 7, 2012
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -2321,7 +2321,7 @@ src/dst mac address and optional vlan nu
 .It Cm l3
 src/dst address for IPv4 or IPv6.
 .It Cm l4
-src/dst port for TCP/UCP/SCTP.
+src/dst port for TCP/UDP/SCTP.
 .El
 .Pp
 .El
___
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: r232640 - head/sys/net

2012-03-06 Thread Andrew Thompson
Author: thompsa
Date: Wed Mar  7 07:22:53 2012
New Revision: 232640
URL: http://svn.freebsd.org/changeset/base/232640

Log:
  Move the vlan buffer space into the union which also fixes an unused variable
  warning with !INET  !INET6.
  
  Spotted by:   pluknet

Modified:
  head/sys/net/if_lagg.c

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Wed Mar  7 06:42:21 2012(r232639)
+++ head/sys/net/if_lagg.c  Wed Mar  7 07:22:53 2012(r232640)
@@ -1438,7 +1438,6 @@ lagg_hashmbuf(struct lagg_softc *sc, str
uint32_t p = key;
int off;
struct ether_header *eh;
-   struct ether_vlan_header vlanbuf;
const struct ether_vlan_header *vlan;
 #ifdef INET
const struct ip *ip;
@@ -1456,6 +1455,7 @@ lagg_hashmbuf(struct lagg_softc *sc, str
 #ifdef INET6
struct ip6_hdr ip6;
 #endif
+   struct ether_vlan_header vlan;
uint32_t port;
} buf;
 
@@ -1475,7 +1475,7 @@ lagg_hashmbuf(struct lagg_softc *sc, str
p = hash32_buf(m-m_pkthdr.ether_vtag,
sizeof(m-m_pkthdr.ether_vtag), p);
} else if (etype == ETHERTYPE_VLAN) {
-   vlan = lagg_gethdr(m, off,  sizeof(*vlan), vlanbuf);
+   vlan = lagg_gethdr(m, off,  sizeof(*vlan), buf);
if (vlan == NULL)
goto out;
 
___
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: r232526 - head/sys/net80211

2012-03-04 Thread Andrew Thompson
On 5 March 2012 12:13, Adrian Chadd adr...@freebsd.org wrote:
 Author: adrian
 Date: Sun Mar  4 23:13:52 2012
 New Revision: 232526
 URL: http://svn.freebsd.org/changeset/base/232526

 Log:
  Add the thread id to the net80211 alq records.

  This will (hopefully) aid in debugging concurrency related issues.

 Modified:
  head/sys/net80211/ieee80211_alq.c
  head/sys/net80211/ieee80211_alq.h

 Modified: head/sys/net80211/ieee80211_alq.c
 ==
 --- head/sys/net80211/ieee80211_alq.c   Sun Mar  4 23:04:16 2012        
 (r232525)
 +++ head/sys/net80211/ieee80211_alq.c   Sun Mar  4 23:13:52 2012        
 (r232526)
 @@ -152,6 +152,7 @@ ieee80211_alq_log(struct ieee80211vap *v
        r-r_version = 1;
        r-r_wlan = htons(vap-iv_ifp-if_dunit);
        r-r_op = op;
 +       r-r_threadid = (uint32_t) curthread-td_ucred;

Shouldn't this be td_tid?


Andrew
___
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: r232314 - in stable/8: share/man/man4 sys/i386/conf sys/net

2012-02-29 Thread Andrew Thompson
Author: thompsa
Date: Wed Feb 29 20:22:45 2012
New Revision: 232314
URL: http://svn.freebsd.org/changeset/base/232314

Log:
  MFC r232008,232010,232080,232089
  
   Using the flowid in the mbuf assumes the network card is giving a good hash 
for
   the traffic flow, this may not be the case giving poor traffic distribution.
   Add a sysctl which allows us to fall back to our own flow hash code.
  
  PR:   kern/164901
  Approved by:  re (bz)

Modified:
  stable/8/share/man/man4/lagg.4
  stable/8/sys/net/ieee8023ad_lacp.c
  stable/8/sys/net/if_lagg.c
  stable/8/sys/net/if_lagg.h
Directory Properties:
  stable/8/share/man/man4/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/i386/conf/XENHVM   (props changed)

Modified: stable/8/share/man/man4/lagg.4
==
--- stable/8/share/man/man4/lagg.4  Wed Feb 29 20:13:53 2012
(r232313)
+++ stable/8/share/man/man4/lagg.4  Wed Feb 29 20:22:45 2012
(r232314)
@@ -16,7 +16,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd October 18, 2010
+.Dd February 23, 2012
 .Dt LAGG 4
 .Os
 .Sh NAME
@@ -133,6 +133,21 @@ variable in
 .Pp
 The MTU of the first interface to be added is used as the lagg MTU.
 All additional interfaces are required to have exactly the same value.
+.Pp
+The
+.Ic loadbalance
+and
+.Ic lacp
+modes will use the RSS hash from the network card if available to avoid
+computing one, this may give poor traffic distribution if the hash is invalid
+or uses less of the protocol header information.
+Local hash computation can be forced per interface by setting the
+.Va net.link.lagg.X.use_flowid
+.Xr sysctl 8
+variable to zero where X is the interface number.
+The default for new interfaces is set via the
+.Va net.link.lagg.default_use_flowid
+.Xr sysctl 8 .
 .Sh EXAMPLES
 Create a 802.3ad link aggregation using LACP with two
 .Xr bge 4

Modified: stable/8/sys/net/ieee8023ad_lacp.c
==
--- stable/8/sys/net/ieee8023ad_lacp.c  Wed Feb 29 20:13:53 2012
(r232313)
+++ stable/8/sys/net/ieee8023ad_lacp.c  Wed Feb 29 20:22:45 2012
(r232314)
@@ -812,7 +812,7 @@ lacp_select_tx_port(struct lagg_softc *s
return (NULL);
}
 
-   if (m-m_flags  M_FLOWID)
+   if (sc-use_flowid  (m-m_flags  M_FLOWID))
hash = m-m_pkthdr.flowid;
else
hash = lagg_hashmbuf(m, lsc-lsc_hashkey);

Modified: stable/8/sys/net/if_lagg.c
==
--- stable/8/sys/net/if_lagg.c  Wed Feb 29 20:13:53 2012(r232313)
+++ stable/8/sys/net/if_lagg.c  Wed Feb 29 20:22:45 2012(r232314)
@@ -167,6 +167,11 @@ static int lagg_failover_rx_all = 0; /* 
 SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW,
 lagg_failover_rx_all, 0,
 Accept input from any interface in a failover lagg);
+static int def_use_flowid = 1; /* Default value for using M_FLOWID */
+TUNABLE_INT(net.link.lagg.default_use_flowid, def_use_flowid);
+SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RW,
+def_use_flowid, 0,
+Default setting for using flow id for load sharing);
 
 static int
 lagg_modevent(module_t mod, int type, void *data)
@@ -257,6 +262,8 @@ lagg_clone_create(struct if_clone *ifc, 
struct ifnet *ifp;
int i, error = 0;
static const u_char eaddr[6];   /* 00:00:00:00:00:00 */
+   struct sysctl_oid *oid;
+   char num[14];   /* sufficient for 32 bits */
 
sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
ifp = sc-sc_ifp = if_alloc(IFT_ETHER);
@@ -265,6 +272,15 @@ lagg_clone_create(struct if_clone *ifc, 
return (ENOSPC);
}
 
+   sysctl_ctx_init(sc-ctx);
+   snprintf(num, sizeof(num), %u, unit);
+   sc-use_flowid = def_use_flowid;
+   oid = SYSCTL_ADD_NODE(sc-ctx, SYSCTL_NODE_CHILDREN(_net_link, lagg),
+   OID_AUTO, num, CTLFLAG_RD, NULL, );
+   SYSCTL_ADD_INT(sc-ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
+   use_flowid, CTLTYPE_INT|CTLFLAG_RW, sc-use_flowid, 
sc-use_flowid,
+   Use flow id for load sharing);
+
sc-sc_proto = LAGG_PROTO_NONE;
for (i = 0; lagg_protos[i].ti_proto != LAGG_PROTO_NONE; i++) {
if (lagg_protos[i].ti_proto == LAGG_PROTO_DEFAULT) {
@@ -344,6 +360,7 @@ lagg_clone_destroy(struct ifnet *ifp)
 
LAGG_WUNLOCK(sc);
 
+   sysctl_ctx_free(sc-ctx);
ifmedia_removeall(sc-sc_media);
ether_ifdetach(ifp);
if_free_type(ifp, IFT_ETHER);
@@ -1668,7 +1685,7 @@ 

svn commit: r232315 - head/sys/net

2012-02-29 Thread Andrew Thompson
Author: thompsa
Date: Wed Feb 29 20:58:21 2012
New Revision: 232315
URL: http://svn.freebsd.org/changeset/base/232315

Log:
  Use a more appropriate default for the maximum number of addresses in the
  bridge forwarding table.
  
  PR:   docs/164564
  Discussed with:   brueffer

Modified:
  head/sys/net/if_bridge.c

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cWed Feb 29 20:22:45 2012(r232314)
+++ head/sys/net/if_bridge.cWed Feb 29 20:58:21 2012(r232315)
@@ -144,10 +144,10 @@ __FBSDID($FreeBSD$);
 #defineBRIDGE_RTHASH_MASK  (BRIDGE_RTHASH_SIZE - 1)
 
 /*
- * Maximum number of addresses to cache.
+ * Default maximum number of addresses to cache.
  */
 #ifndef BRIDGE_RTABLE_MAX
-#defineBRIDGE_RTABLE_MAX   100
+#defineBRIDGE_RTABLE_MAX   2000
 #endif
 
 /*
___
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: r232321 - head/share/man/man9

2012-02-29 Thread Andrew Thompson
Author: thompsa
Date: Wed Feb 29 22:41:40 2012
New Revision: 232321
URL: http://svn.freebsd.org/changeset/base/232321

Log:
  Correct the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a
  system tunable has never been implemented. This flag is only used by sysctl(8)
  to provide a helpful error message.
  
  Discussed with:   dwhite, kan

Modified:
  head/share/man/man9/sysctl.9

Modified: head/share/man/man9/sysctl.9
==
--- head/share/man/man9/sysctl.9Wed Feb 29 22:35:09 2012
(r232320)
+++ head/share/man/man9/sysctl.9Wed Feb 29 22:41:40 2012
(r232321)
@@ -138,9 +138,9 @@ This sysctl can be written to by process
 .It Dv CTLFLAG_SKIP
 When iterating the sysctl name space, do not list this sysctl.
 .It Dv CTLFLAG_TUN
-Also declare a system tunable with the same name to initialize this variable.
+Advisory flag that a system tunable also exists for this variable.
 .It Dv CTLFLAG_RDTUN
-Also declare a system tunable with the same name to initialize this variable;
+Advisory flag that a system tunable also exists for this variable;
 however, the run-time variable is read-only.
 .El
 .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: r232279 - in stable/9: share/man/man4 sys/i386/conf sys/net

2012-02-28 Thread Andrew Thompson
Author: thompsa
Date: Wed Feb 29 00:52:56 2012
New Revision: 232279
URL: http://svn.freebsd.org/changeset/base/232279

Log:
  MFC r232008,232010,232080,232089
  
   Using the flowid in the mbuf assumes the network card is giving a good hash 
for
   the traffic flow, this may not be the case giving poor traffic distribution.
   Add a sysctl which allows us to fall back to our own flow hash code.
  
  PR:   kern/164901

Modified:
  stable/9/share/man/man4/lagg.4
  stable/9/sys/net/ieee8023ad_lacp.c
  stable/9/sys/net/if_lagg.c
  stable/9/sys/net/if_lagg.h
Directory Properties:
  stable/9/share/man/man4/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)

Modified: stable/9/share/man/man4/lagg.4
==
--- stable/9/share/man/man4/lagg.4  Wed Feb 29 00:30:18 2012
(r232278)
+++ stable/9/share/man/man4/lagg.4  Wed Feb 29 00:52:56 2012
(r232279)
@@ -16,7 +16,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd October 18, 2010
+.Dd February 23, 2012
 .Dt LAGG 4
 .Os
 .Sh NAME
@@ -133,6 +133,21 @@ variable in
 .Pp
 The MTU of the first interface to be added is used as the lagg MTU.
 All additional interfaces are required to have exactly the same value.
+.Pp
+The
+.Ic loadbalance
+and
+.Ic lacp
+modes will use the RSS hash from the network card if available to avoid
+computing one, this may give poor traffic distribution if the hash is invalid
+or uses less of the protocol header information.
+Local hash computation can be forced per interface by setting the
+.Va net.link.lagg.X.use_flowid
+.Xr sysctl 8
+variable to zero where X is the interface number.
+The default for new interfaces is set via the
+.Va net.link.lagg.default_use_flowid
+.Xr sysctl 8 .
 .Sh EXAMPLES
 Create a 802.3ad link aggregation using LACP with two
 .Xr bge 4

Modified: stable/9/sys/net/ieee8023ad_lacp.c
==
--- stable/9/sys/net/ieee8023ad_lacp.c  Wed Feb 29 00:30:18 2012
(r232278)
+++ stable/9/sys/net/ieee8023ad_lacp.c  Wed Feb 29 00:52:56 2012
(r232279)
@@ -812,7 +812,7 @@ lacp_select_tx_port(struct lagg_softc *s
return (NULL);
}
 
-   if (m-m_flags  M_FLOWID)
+   if (sc-use_flowid  (m-m_flags  M_FLOWID))
hash = m-m_pkthdr.flowid;
else
hash = lagg_hashmbuf(m, lsc-lsc_hashkey);

Modified: stable/9/sys/net/if_lagg.c
==
--- stable/9/sys/net/if_lagg.c  Wed Feb 29 00:30:18 2012(r232278)
+++ stable/9/sys/net/if_lagg.c  Wed Feb 29 00:52:56 2012(r232279)
@@ -171,6 +171,11 @@ static int lagg_failover_rx_all = 0; /* 
 SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW,
 lagg_failover_rx_all, 0,
 Accept input from any interface in a failover lagg);
+static int def_use_flowid = 1; /* Default value for using M_FLOWID */
+TUNABLE_INT(net.link.lagg.default_use_flowid, def_use_flowid);
+SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RW,
+def_use_flowid, 0,
+Default setting for using flow id for load sharing);
 
 static int
 lagg_modevent(module_t mod, int type, void *data)
@@ -261,6 +266,8 @@ lagg_clone_create(struct if_clone *ifc, 
struct ifnet *ifp;
int i, error = 0;
static const u_char eaddr[6];   /* 00:00:00:00:00:00 */
+   struct sysctl_oid *oid;
+   char num[14];   /* sufficient for 32 bits */
 
sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
ifp = sc-sc_ifp = if_alloc(IFT_ETHER);
@@ -269,6 +276,15 @@ lagg_clone_create(struct if_clone *ifc, 
return (ENOSPC);
}
 
+   sysctl_ctx_init(sc-ctx);
+   snprintf(num, sizeof(num), %u, unit);
+   sc-use_flowid = def_use_flowid;
+   oid = SYSCTL_ADD_NODE(sc-ctx, SYSCTL_NODE_CHILDREN(_net_link, lagg),
+   OID_AUTO, num, CTLFLAG_RD, NULL, );
+   SYSCTL_ADD_INT(sc-ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
+   use_flowid, CTLTYPE_INT|CTLFLAG_RW, sc-use_flowid, 
sc-use_flowid,
+   Use flow id for load sharing);
+
sc-sc_proto = LAGG_PROTO_NONE;
for (i = 0; lagg_protos[i].ti_proto != LAGG_PROTO_NONE; 

svn commit: r232118 - head/sys/net

2012-02-24 Thread Andrew Thompson
Author: thompsa
Date: Fri Feb 24 17:50:36 2012
New Revision: 232118
URL: http://svn.freebsd.org/changeset/base/232118

Log:
  Only look for a usable MAC address for the bridge ID from ports within our
  bridge, this allows us to have more than one independent bridge in the same
  STP domain.
  
  PR:   kern/164369
  Submitted by: Nikos Vassiliadis (earlier version)
  MFC after:2 weeks

Modified:
  head/sys/net/bridgestp.c

Modified: head/sys/net/bridgestp.c
==
--- head/sys/net/bridgestp.cFri Feb 24 17:50:23 2012(r232117)
+++ head/sys/net/bridgestp.cFri Feb 24 17:50:36 2012(r232118)
@@ -2013,24 +2013,33 @@ bstp_reinit(struct bstp_state *bs)
struct bstp_port *bp;
struct ifnet *ifp, *mif;
u_char *e_addr;
+   void *bridgeptr;
static const u_char llzero[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */
 
BSTP_LOCK_ASSERT(bs);
 
+   if (LIST_EMPTY(bs-bs_bplist))
+   goto disablestp;
+
mif = NULL;
+   bridgeptr = LIST_FIRST(bs-bs_bplist)-bp_ifp-if_bridge;
+   KASSERT(bridgeptr != NULL, (Invalid bridge pointer));
/*
 * Search through the Ethernet adapters and find the one with the
-* lowest value. The adapter which we take the MAC address from does
-* not need to be part of the bridge, it just needs to be a unique
-* value.
+* lowest value. Make sure the adapter which we take the MAC address
+* from is part of this bridge, so we can have more than one independent
+* bridges in the same STP domain.
 */
IFNET_RLOCK_NOSLEEP();
TAILQ_FOREACH(ifp, V_ifnet, if_link) {
if (ifp-if_type != IFT_ETHER)
-   continue;
+   continue;   /* Not Ethernet */
+
+   if (ifp-if_bridge != bridgeptr)
+   continue;   /* Not part of our bridge */
 
if (bstp_addr_cmp(IF_LLADDR(ifp), llzero) == 0)
-   continue;
+   continue;   /* No mac address set */
 
if (mif == NULL) {
mif = ifp;
@@ -2042,21 +2051,8 @@ bstp_reinit(struct bstp_state *bs)
}
}
IFNET_RUNLOCK_NOSLEEP();
-
-   if (LIST_EMPTY(bs-bs_bplist) || mif == NULL) {
-   /* Set the bridge and root id (lower bits) to zero */
-   bs-bs_bridge_pv.pv_dbridge_id =
-   ((uint64_t)bs-bs_bridge_priority)  48;
-   bs-bs_bridge_pv.pv_root_id = bs-bs_bridge_pv.pv_dbridge_id;
-   bs-bs_root_pv = bs-bs_bridge_pv;
-   /* Disable any remaining ports, they will have no MAC address */
-   LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
-   bp-bp_infois = BSTP_INFO_DISABLED;
-   bstp_set_port_role(bp, BSTP_ROLE_DISABLED);
-   }
-   callout_stop(bs-bs_bstpcallout);
-   return;
-   }
+   if (mif == NULL)
+   goto disablestp;
 
e_addr = IF_LLADDR(mif);
bs-bs_bridge_pv.pv_dbridge_id =
@@ -2084,6 +2080,20 @@ bstp_reinit(struct bstp_state *bs)
 
bstp_assign_roles(bs);
bstp_timer_start(bs-bs_link_timer, BSTP_LINK_TIMER);
+   return;
+
+disablestp:
+   /* Set the bridge and root id (lower bits) to zero */
+   bs-bs_bridge_pv.pv_dbridge_id =
+   ((uint64_t)bs-bs_bridge_priority)  48;
+   bs-bs_bridge_pv.pv_root_id = bs-bs_bridge_pv.pv_dbridge_id;
+   bs-bs_root_pv = bs-bs_bridge_pv;
+   /* Disable any remaining ports, they will have no MAC address */
+   LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
+   bp-bp_infois = BSTP_INFO_DISABLED;
+   bstp_set_port_role(bp, BSTP_ROLE_DISABLED);
+   }
+   callout_stop(bs-bs_bstpcallout);
 }
 
 static int
___
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: r232070 - head/sys/net

2012-02-23 Thread Andrew Thompson
Author: thompsa
Date: Thu Feb 23 20:58:52 2012
New Revision: 232070
URL: http://svn.freebsd.org/changeset/base/232070

Log:
  Indicate this function decrements the timer as well as testing for expiry.

Modified:
  head/sys/net/bridgestp.c

Modified: head/sys/net/bridgestp.c
==
--- head/sys/net/bridgestp.cThu Feb 23 20:54:22 2012(r232069)
+++ head/sys/net/bridgestp.cThu Feb 23 20:58:52 2012(r232070)
@@ -134,7 +134,7 @@ static void bstp_tick(void *);
 static voidbstp_timer_start(struct bstp_timer *, uint16_t);
 static voidbstp_timer_stop(struct bstp_timer *);
 static voidbstp_timer_latch(struct bstp_timer *);
-static int bstp_timer_expired(struct bstp_timer *);
+static int bstp_timer_dectest(struct bstp_timer *);
 static voidbstp_hello_timer_expiry(struct bstp_state *,
struct bstp_port *);
 static voidbstp_message_age_expiry(struct bstp_state *,
@@ -1862,7 +1862,7 @@ bstp_tick(void *arg)
CURVNET_SET(bs-bs_vnet);
 
/* poll link events on interfaces that do not support linkstate */
-   if (bstp_timer_expired(bs-bs_link_timer)) {
+   if (bstp_timer_dectest(bs-bs_link_timer)) {
LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
if (!(bp-bp_ifp-if_capabilities  IFCAP_LINKSTATE))
bstp_ifupdstatus(bs, bp);
@@ -1872,21 +1872,21 @@ bstp_tick(void *arg)
 
LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
/* no events need to happen for these */
-   bstp_timer_expired(bp-bp_tc_timer);
-   bstp_timer_expired(bp-bp_recent_root_timer);
-   bstp_timer_expired(bp-bp_forward_delay_timer);
-   bstp_timer_expired(bp-bp_recent_backup_timer);
+   bstp_timer_dectest(bp-bp_tc_timer);
+   bstp_timer_dectest(bp-bp_recent_root_timer);
+   bstp_timer_dectest(bp-bp_forward_delay_timer);
+   bstp_timer_dectest(bp-bp_recent_backup_timer);
 
-   if (bstp_timer_expired(bp-bp_hello_timer))
+   if (bstp_timer_dectest(bp-bp_hello_timer))
bstp_hello_timer_expiry(bs, bp);
 
-   if (bstp_timer_expired(bp-bp_message_age_timer))
+   if (bstp_timer_dectest(bp-bp_message_age_timer))
bstp_message_age_expiry(bs, bp);
 
-   if (bstp_timer_expired(bp-bp_migrate_delay_timer))
+   if (bstp_timer_dectest(bp-bp_migrate_delay_timer))
bstp_migrate_delay_expiry(bs, bp);
 
-   if (bstp_timer_expired(bp-bp_edge_delay_timer))
+   if (bstp_timer_dectest(bp-bp_edge_delay_timer))
bstp_edge_delay_expiry(bs, bp);
 
/* update the various state machines for the port */
@@ -1925,7 +1925,7 @@ bstp_timer_latch(struct bstp_timer *t)
 }
 
 static int
-bstp_timer_expired(struct bstp_timer *t)
+bstp_timer_dectest(struct bstp_timer *t)
 {
if (t-active == 0 || t-latched)
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: r232080 - in head: share/man/man4 sys/net

2012-02-23 Thread Andrew Thompson
Author: thompsa
Date: Thu Feb 23 21:56:53 2012
New Revision: 232080
URL: http://svn.freebsd.org/changeset/base/232080

Log:
  Add a sysctl/tunable default value for the use_flowid sysctl in r232008.

Modified:
  head/share/man/man4/lagg.4
  head/sys/net/if_lagg.c

Modified: head/share/man/man4/lagg.4
==
--- head/share/man/man4/lagg.4  Thu Feb 23 21:54:04 2012(r232079)
+++ head/share/man/man4/lagg.4  Thu Feb 23 21:56:53 2012(r232080)
@@ -142,10 +142,12 @@ and
 modes will use the RSS hash from the network card if available to avoid
 computing one, this may give poor traffic distribution if the hash is invalid
 or uses less of the protocol header information.
-Local hash computation can be forced by setting the
+Local hash computation can be forced per interface by setting the
 .Va net.link.lagg.X.use_flowid
 .Xr sysctl 8
-variable to zero where X is the interface number.
+variable to zero where X is the interface number, the default for
+new interfaces is set via
+.Va net.link.lagg.default_use_flowid .
 .Sh EXAMPLES
 Create a 802.3ad link aggregation using LACP with two
 .Xr bge 4

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Thu Feb 23 21:54:04 2012(r232079)
+++ head/sys/net/if_lagg.c  Thu Feb 23 21:56:53 2012(r232080)
@@ -172,6 +172,11 @@ static int lagg_failover_rx_all = 0; /* 
 SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW,
 lagg_failover_rx_all, 0,
 Accept input from any interface in a failover lagg);
+static int def_use_flowid = 1; /* Default value for using M_FLOWID */
+TUNABLE_INT(net.link.lagg.default_use_flowid, def_use_flowid);
+SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RW,
+def_use_flowid, 0,
+Default setting for using flow id for load sharing);
 
 static int
 lagg_modevent(module_t mod, int type, void *data)
@@ -274,7 +279,7 @@ lagg_clone_create(struct if_clone *ifc, 
 
sysctl_ctx_init(sc-ctx);
snprintf(num, sizeof(num), %u, unit);
-   sc-use_flowid = 1;
+   sc-use_flowid = def_use_flowid;
oid = SYSCTL_ADD_NODE(sc-ctx, SYSCTL_NODE_CHILDREN(_net_link, lagg),
OID_AUTO, num, CTLFLAG_RD, NULL, );
SYSCTL_ADD_INT(sc-ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
___
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: r232089 - head/share/man/man4

2012-02-23 Thread Andrew Thompson
Author: thompsa
Date: Thu Feb 23 23:37:29 2012
New Revision: 232089
URL: http://svn.freebsd.org/changeset/base/232089

Log:
  Break the last part to its own sentence rather than a run-on.
  
  Suggested by: dougb

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

Modified: head/share/man/man4/lagg.4
==
--- head/share/man/man4/lagg.4  Thu Feb 23 22:34:44 2012(r232088)
+++ head/share/man/man4/lagg.4  Thu Feb 23 23:37:29 2012(r232089)
@@ -145,9 +145,10 @@ or uses less of the protocol header info
 Local hash computation can be forced per interface by setting the
 .Va net.link.lagg.X.use_flowid
 .Xr sysctl 8
-variable to zero where X is the interface number, the default for
-new interfaces is set via
-.Va net.link.lagg.default_use_flowid .
+variable to zero where X is the interface number.
+The default for new interfaces is set via the
+.Va net.link.lagg.default_use_flowid
+.Xr sysctl 8 .
 .Sh EXAMPLES
 Create a 802.3ad link aggregation using LACP with two
 .Xr bge 4
___
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: r232080 - in head: share/man/man4 sys/net

2012-02-23 Thread Andrew Thompson
On 24 February 2012 12:23, Doug Barton do...@freebsd.org wrote:
 First, I'm always glad to see devs updating the documentation, so please
 don't take this as in any way being critical, just trying to help. :)

n/p, I like feedback.

 On 02/23/2012 13:56, Andrew Thompson wrote:
 Modified: head/share/man/man4/lagg.4
 ==
 --- head/share/man/man4/lagg.4        Thu Feb 23 21:54:04 2012        
 (r232079)
 +++ head/share/man/man4/lagg.4        Thu Feb 23 21:56:53 2012        
 (r232080)
 @@ -142,10 +142,12 @@ and
  modes will use the RSS hash from the network card if available to avoid
  computing one, this may give poor traffic distribution if the hash is 
 invalid
  or uses less of the protocol header information.
 -Local hash computation can be forced by setting the
 +Local hash computation can be forced per interface by setting the

 This is a great example of why we use short lines in the man page
 sources. It allows people to come along later and add text without
 having to make changes to multiple lines.

I can see your point here.


  .Va net.link.lagg.X.use_flowid
  .Xr sysctl 8
 -variable to zero where X is the interface number.
 +variable to zero where X is the interface number, the default for
 +new interfaces is set via
 +.Va net.link.lagg.default_use_flowid .

 If adding a comma there was the right change the new clause should still
 have started on the next line, for the reason described above. However,
 what you added is actually a sentence that can/should stand on its own.

Fixed.


Andrew
___
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: r232008 - head/sys/net

2012-02-22 Thread Andrew Thompson
Author: thompsa
Date: Wed Feb 22 22:01:30 2012
New Revision: 232008
URL: http://svn.freebsd.org/changeset/base/232008

Log:
  Using the flowid in the mbuf assumes the network card is giving a good hash 
for
  the traffic flow, this may not be the case giving poor traffic distribution.
  Add a sysctl which allows us to fall back to our own flow hash code.
  
  PR:   kern/164901
  Submitted by: Eugene Grosbein
  MFC after:1 week

Modified:
  head/sys/net/ieee8023ad_lacp.c
  head/sys/net/if_lagg.c
  head/sys/net/if_lagg.h

Modified: head/sys/net/ieee8023ad_lacp.c
==
--- head/sys/net/ieee8023ad_lacp.c  Wed Feb 22 21:47:50 2012
(r232007)
+++ head/sys/net/ieee8023ad_lacp.c  Wed Feb 22 22:01:30 2012
(r232008)
@@ -812,7 +812,7 @@ lacp_select_tx_port(struct lagg_softc *s
return (NULL);
}
 
-   if (m-m_flags  M_FLOWID)
+   if (sc-use_flowid  (m-m_flags  M_FLOWID))
hash = m-m_pkthdr.flowid;
else
hash = lagg_hashmbuf(m, lsc-lsc_hashkey);

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Wed Feb 22 21:47:50 2012(r232007)
+++ head/sys/net/if_lagg.c  Wed Feb 22 22:01:30 2012(r232008)
@@ -262,6 +262,8 @@ lagg_clone_create(struct if_clone *ifc, 
struct ifnet *ifp;
int i, error = 0;
static const u_char eaddr[6];   /* 00:00:00:00:00:00 */
+   struct sysctl_oid *oid;
+   char num[14];   /* sufficient for 32 bits */
 
sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
ifp = sc-sc_ifp = if_alloc(IFT_ETHER);
@@ -270,6 +272,15 @@ lagg_clone_create(struct if_clone *ifc, 
return (ENOSPC);
}
 
+   sysctl_ctx_init(sc-ctx);
+   snprintf(num, sizeof(num), %u, unit);
+   sc-use_flowid = 1;
+   oid = SYSCTL_ADD_NODE(sc-ctx, SYSCTL_NODE_CHILDREN(_net_link, lagg),
+   OID_AUTO, num, CTLFLAG_RD, NULL, );
+   SYSCTL_ADD_INT(sc-ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
+   use_flowid, CTLTYPE_INT|CTLFLAG_RW, sc-use_flowid, 
sc-use_flowid,
+   Use flow id for load sharing);
+
sc-sc_proto = LAGG_PROTO_NONE;
for (i = 0; lagg_protos[i].ti_proto != LAGG_PROTO_NONE; i++) {
if (lagg_protos[i].ti_proto == LAGG_PROTO_DEFAULT) {
@@ -349,6 +360,7 @@ lagg_clone_destroy(struct ifnet *ifp)
 
LAGG_WUNLOCK(sc);
 
+   sysctl_ctx_free(sc-ctx);
ifmedia_removeall(sc-sc_media);
ether_ifdetach(ifp);
if_free(ifp);
@@ -1676,7 +1688,7 @@ lagg_lb_start(struct lagg_softc *sc, str
struct lagg_port *lp = NULL;
uint32_t p = 0;
 
-   if (m-m_flags  M_FLOWID)
+   if (sc-use_flowid  (m-m_flags  M_FLOWID))
p = m-m_pkthdr.flowid;
else
p = lagg_hashmbuf(m, lb-lb_key);

Modified: head/sys/net/if_lagg.h
==
--- head/sys/net/if_lagg.h  Wed Feb 22 21:47:50 2012(r232007)
+++ head/sys/net/if_lagg.h  Wed Feb 22 22:01:30 2012(r232008)
@@ -21,6 +21,8 @@
 #ifndef _NET_LAGG_H
 #define _NET_LAGG_H
 
+#include sys/sysctl.h
+
 /*
  * Global definitions
  */
@@ -202,6 +204,8 @@ struct lagg_softc {
eventhandler_tag vlan_attach;
eventhandler_tag vlan_detach;
 #endif
+   struct sysctl_ctx_list  ctx;/* sysctl variables */
+   int use_flowid; /* use M_FLOWID */
 };
 
 struct lagg_port {
___
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: r232009 - head/share/man/man4

2012-02-22 Thread Andrew Thompson
Author: thompsa
Date: Wed Feb 22 22:09:17 2012
New Revision: 232009
URL: http://svn.freebsd.org/changeset/base/232009

Log:
  Make it clear that fec is just an alias

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

Modified: head/share/man/man4/lagg.4
==
--- head/share/man/man4/lagg.4  Wed Feb 22 22:01:30 2012(r232008)
+++ head/share/man/man4/lagg.4  Wed Feb 22 22:09:17 2012(r232009)
@@ -88,8 +88,9 @@ variable to a nonzero value,
 which is useful for certain bridged network setups.
 .It Ic fec
 Supports Cisco EtherChannel.
-This is a static setup and does not negotiate aggregation with the peer or
-exchange frames to monitor the link.
+This is an alias for
+.Ic loadbalance
+mode.
 .It Ic lacp
 Supports the IEEE 802.3ad Link Aggregation Control Protocol (LACP) and the
 Marker Protocol.
___
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: r232010 - head/share/man/man4

2012-02-22 Thread Andrew Thompson
Author: thompsa
Date: Wed Feb 22 22:29:23 2012
New Revision: 232010
URL: http://svn.freebsd.org/changeset/base/232010

Log:
  Document the net.link.lagg.X.use_flowid sysctl from r232008.

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

Modified: head/share/man/man4/lagg.4
==
--- head/share/man/man4/lagg.4  Wed Feb 22 22:09:17 2012(r232009)
+++ head/share/man/man4/lagg.4  Wed Feb 22 22:29:23 2012(r232010)
@@ -16,7 +16,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd October 18, 2010
+.Dd February 23, 2012
 .Dt LAGG 4
 .Os
 .Sh NAME
@@ -134,6 +134,18 @@ variable in
 .Pp
 The MTU of the first interface to be added is used as the lagg MTU.
 All additional interfaces are required to have exactly the same value.
+.Pp
+The
+.Ic loadbalance
+and
+.Ic lacp
+modes will use the RSS hash from the network card if available to avoid
+computing one, this may give poor traffic distribution if the hash is invalid
+or uses less of the protocol header information.
+Local hash computation can be forced by setting the
+.Va net.link.lagg.X.use_flowid
+.Xr sysctl 8
+variable to zero where X is the interface number.
 .Sh EXAMPLES
 Create a 802.3ad link aggregation using LACP with two
 .Xr bge 4
___
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: r232014 - head/sys/net

2012-02-22 Thread Andrew Thompson
Author: thompsa
Date: Thu Feb 23 00:59:21 2012
New Revision: 232014
URL: http://svn.freebsd.org/changeset/base/232014

Log:
  bstp_input() always consumes the packet so remove the mbuf handling dance
  around it.
  
  Obtained from:OpenBSD (r1.37)

Modified:
  head/sys/net/bridgestp.c
  head/sys/net/bridgestp.h
  head/sys/net/if_bridge.c

Modified: head/sys/net/bridgestp.c
==
--- head/sys/net/bridgestp.cThu Feb 23 00:52:27 2012(r232013)
+++ head/sys/net/bridgestp.cThu Feb 23 00:59:21 2012(r232014)
@@ -446,7 +446,7 @@ bstp_pdu_flags(struct bstp_port *bp)
return (flags);
 }
 
-struct mbuf *
+void
 bstp_input(struct bstp_port *bp, struct ifnet *ifp, struct mbuf *m)
 {
struct bstp_state *bs = bp-bp_bs;
@@ -456,7 +456,7 @@ bstp_input(struct bstp_port *bp, struct 
 
if (bp-bp_active == 0) {
m_freem(m);
-   return (NULL);
+   return;
}
 
BSTP_LOCK(bs);
@@ -521,7 +521,6 @@ out:
BSTP_UNLOCK(bs);
if (m)
m_freem(m);
-   return (NULL);
 }
 
 static void

Modified: head/sys/net/bridgestp.h
==
--- head/sys/net/bridgestp.hThu Feb 23 00:52:27 2012(r232013)
+++ head/sys/net/bridgestp.hThu Feb 23 00:59:21 2012(r232014)
@@ -392,6 +392,6 @@ int bstp_set_edge(struct bstp_port *, in
 intbstp_set_autoedge(struct bstp_port *, int);
 intbstp_set_ptp(struct bstp_port *, int);
 intbstp_set_autoptp(struct bstp_port *, int);
-struct mbuf *bstp_input(struct bstp_port *, struct ifnet *, struct mbuf *);
+void   bstp_input(struct bstp_port *, struct ifnet *, struct mbuf *);
 
 #endif /* _KERNEL */

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cThu Feb 23 00:52:27 2012(r232013)
+++ head/sys/net/if_bridge.cThu Feb 23 00:59:21 2012(r232014)
@@ -2215,11 +2215,9 @@ bridge_input(struct ifnet *ifp, struct m
/* Tap off 802.1D packets; they do not get forwarded. */
if (memcmp(eh-ether_dhost, bstp_etheraddr,
ETHER_ADDR_LEN) == 0) {
-   m = bstp_input(bif-bif_stp, ifp, m);
-   if (m == NULL) {
-   BRIDGE_UNLOCK(sc);
-   return (NULL);
-   }
+   bstp_input(bif-bif_stp, ifp, m); /* consumes mbuf */
+   BRIDGE_UNLOCK(sc);
+   return (NULL);
}
 
if ((bif-bif_flags  IFBIF_STP) 
___
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: r232030 - head/sys/net

2012-02-22 Thread Andrew Thompson
Author: thompsa
Date: Thu Feb 23 06:26:16 2012
New Revision: 232030
URL: http://svn.freebsd.org/changeset/base/232030

Log:
  Now that network interfaces advertise if they support linkstate notifications
  we do not need to perform a media ioctl every 15 seconds.

Modified:
  head/sys/net/bridgestp.c

Modified: head/sys/net/bridgestp.c
==
--- head/sys/net/bridgestp.cThu Feb 23 06:13:12 2012(r232029)
+++ head/sys/net/bridgestp.cThu Feb 23 06:26:16 2012(r232030)
@@ -1861,10 +1861,12 @@ bstp_tick(void *arg)
 
CURVNET_SET(bs-bs_vnet);
 
-   /* slow timer to catch missed link events */
+   /* poll link events on interfaces that do not support linkstate */
if (bstp_timer_expired(bs-bs_link_timer)) {
-   LIST_FOREACH(bp, bs-bs_bplist, bp_next)
-   bstp_ifupdstatus(bs, bp);
+   LIST_FOREACH(bp, bs-bs_bplist, bp_next) {
+   if (!(bp-bp_ifp-if_capabilities  IFCAP_LINKSTATE))
+   bstp_ifupdstatus(bs, bp);
+   }
bstp_timer_start(bs-bs_link_timer, BSTP_LINK_TIMER);
}
 
___
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: r229882 - stable/9/sys/boot/arm/ixp425/boot2

2012-01-09 Thread Andrew Thompson
Author: thompsa
Date: Mon Jan  9 21:49:03 2012
New Revision: 229882
URL: http://svn.freebsd.org/changeset/base/229882

Log:
  MFC r225955
  
   Allow ixp425 boot2 to compile after r219452

Modified:
  stable/9/sys/boot/arm/ixp425/boot2/boot2.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/boot/arm/ixp425/boot2/boot2.c
==
--- stable/9/sys/boot/arm/ixp425/boot2/boot2.c  Mon Jan  9 20:25:14 2012
(r229881)
+++ stable/9/sys/boot/arm/ixp425/boot2/boot2.c  Mon Jan  9 21:49:03 2012
(r229882)
@@ -86,7 +86,7 @@ static unsigned dsk_start;
 static char cmd[512];
 static char kname[1024];
 static uint32_t opts;
-static int dsk_meta;
+static uint8_t dsk_meta;
 static int bootslice;
 static int bootpart;
 static int disk_layout;
___
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: r229883 - stable/9/sys/arm/xscale/ixp425

2012-01-09 Thread Andrew Thompson
Author: thompsa
Date: Mon Jan  9 21:49:47 2012
New Revision: 229883
URL: http://svn.freebsd.org/changeset/base/229883

Log:
  MFC r226034
  
   Add missing newbus glue, this has never attached properly to gpiobus.

Modified:
  stable/9/sys/arm/xscale/ixp425/avila_gpio.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/arm/xscale/ixp425/avila_gpio.c
==
--- stable/9/sys/arm/xscale/ixp425/avila_gpio.c Mon Jan  9 21:49:03 2012
(r229882)
+++ stable/9/sys/arm/xscale/ixp425/avila_gpio.c Mon Jan  9 21:49:47 2012
(r229883)
@@ -356,5 +356,10 @@ static driver_t gpio_avila_driver = {
sizeof(struct avila_gpio_softc),
 };
 static devclass_t gpio_avila_devclass;
+extern devclass_t gpiobus_devclass, gpioc_devclass;
+extern driver_t gpiobus_driver, gpioc_driver;
 
 DRIVER_MODULE(gpio_avila, ixp, gpio_avila_driver, gpio_avila_devclass, 0, 0);
+DRIVER_MODULE(gpiobus, gpio_avila, gpiobus_driver, gpiobus_devclass, 0, 0);
+DRIVER_MODULE(gpioc, gpio_avila, gpioc_driver, gpioc_devclass, 0, 0);
+MODULE_VERSION(gpio_avila, 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: r229884 - stable/9/tools/tools/nanobsd/gateworks

2012-01-09 Thread Andrew Thompson
Author: thompsa
Date: Mon Jan  9 21:51:50 2012
New Revision: 229884
URL: http://svn.freebsd.org/changeset/base/229884

Log:
  MFC r226242
  
   Fix build after TARGET_BIG_ENDIAN was nuked from orbit.

Modified:
  stable/9/tools/tools/nanobsd/gateworks/common
Directory Properties:
  stable/9/tools/tools/nanobsd/   (props changed)

Modified: stable/9/tools/tools/nanobsd/gateworks/common
==
--- stable/9/tools/tools/nanobsd/gateworks/common   Mon Jan  9 21:49:47 
2012(r229883)
+++ stable/9/tools/tools/nanobsd/gateworks/common   Mon Jan  9 21:51:50 
2012(r229884)
@@ -4,9 +4,8 @@ NANO_CFGDIR=${NANO_CFGDIR:-${NANO_SRC}/$
 test -d ${NANO_CFGDIR} || NANO_CFGDIR=/var/empty
 NANO_PMAKE=make  # NB: disable -j 3
 
-NANO_ARCH=arm
+NANO_ARCH=armeb
 TARGET_CPUTYPE=xscale; export TARGET_CPUTYPE   # XXX
-TARGET_BIG_ENDIAN=true; export TARGET_BIG_ENDIAN   # XXX
 
 NANO_CUSTOMIZE=cust_allow_ssh_root
 
___
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: r229885 - stable/9/sys/arm/xscale/ixp425

2012-01-09 Thread Andrew Thompson
Author: thompsa
Date: Mon Jan  9 21:52:55 2012
New Revision: 229885
URL: http://svn.freebsd.org/changeset/base/229885

Log:
  MFC r226324
  
   Dont just set the pin high when turning on output, use the current value. 
Also
   let this value be set when in input mode.

Modified:
  stable/9/sys/arm/xscale/ixp425/cambria_gpio.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/arm/xscale/ixp425/cambria_gpio.c
==
--- stable/9/sys/arm/xscale/ixp425/cambria_gpio.c   Mon Jan  9 21:51:50 
2012(r229884)
+++ stable/9/sys/arm/xscale/ixp425/cambria_gpio.c   Mon Jan  9 21:52:55 
2012(r229885)
@@ -84,6 +84,7 @@ struct cambria_gpio_softc {
 struct mtx sc_mtx;
struct gpio_pin sc_pins[GPIO_PINS];
uint8_t sc_latch;
+   uint8_t sc_val;
 };
 
 struct cambria_gpio_pin {
@@ -309,6 +310,9 @@ cambria_gpio_pin_setflags(device_t dev, 
 {
struct cambria_gpio_softc *sc = device_get_softc(dev);
int error;
+   uint8_t mask;
+
+   mask = 1  pin;
 
if (pin = GPIO_PINS)
return (EINVAL);
@@ -325,7 +329,16 @@ cambria_gpio_pin_setflags(device_t dev, 
GPIO_LOCK(sc);
sc-sc_pins[pin].gp_flags = flags;
 
-   sc-sc_latch |= (1  pin);
+   /*
+* Writing a logical one sets the signal high and writing a logical
+* zero sets the signal low. To configure a digital I/O signal as an
+* input, a logical one must first be written to the data bit to
+* three-state the associated output.
+*/
+   if (flags  GPIO_PIN_INPUT || sc-sc_val  mask)
+   sc-sc_latch |= mask; /* input or output  high */
+   else
+   sc-sc_latch = ~mask;
error = cambria_gpio_write(sc);
GPIO_UNLOCK(sc);
 
@@ -337,15 +350,28 @@ cambria_gpio_pin_set(device_t dev, uint3
 {
struct cambria_gpio_softc *sc = device_get_softc(dev);
int error;
+   uint8_t mask;
 
-   if (pin = GPIO_PINS || sc-sc_pins[pin].gp_flags != GPIO_PIN_OUTPUT)
-   return (EINVAL);
+   mask = 1  pin;
 
+   if (pin = GPIO_PINS)
+   return (EINVAL);
GPIO_LOCK(sc);
if (value)
-   sc-sc_latch |= (1  pin);
+   sc-sc_val |= mask;
else
-   sc-sc_latch = ~(1  pin);
+   sc-sc_val = ~mask;
+
+   if (sc-sc_pins[pin].gp_flags != GPIO_PIN_OUTPUT) {
+   /* just save, altering the latch will disable input */
+   GPIO_UNLOCK(sc);
+   return (0);
+   }
+
+   if (value)
+   sc-sc_latch |= mask;
+   else
+   sc-sc_latch = ~mask;
error = cambria_gpio_write(sc);
GPIO_UNLOCK(sc);
 
@@ -375,14 +401,17 @@ static int
 cambria_gpio_pin_toggle(device_t dev, uint32_t pin)
 {
struct cambria_gpio_softc *sc = device_get_softc(dev);
-   int error;
+   int error = 0;
 
-   if (pin = GPIO_PINS || sc-sc_pins[pin].gp_flags != GPIO_PIN_OUTPUT)
+   if (pin = GPIO_PINS)
return (EINVAL);
 
GPIO_LOCK(sc);
-   sc-sc_latch ^= (1  pin);
-   error = cambria_gpio_write(sc);
+   sc-sc_val ^= (1  pin);
+   if (sc-sc_pins[pin].gp_flags == GPIO_PIN_OUTPUT) {
+   sc-sc_latch ^= (1  pin);
+   error = cambria_gpio_write(sc);
+   }
GPIO_UNLOCK(sc);
 
return (error);
___
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: r226324 - head/sys/arm/xscale/ixp425

2011-10-12 Thread Andrew Thompson
Author: thompsa
Date: Wed Oct 12 20:57:21 2011
New Revision: 226324
URL: http://svn.freebsd.org/changeset/base/226324

Log:
  Dont just set the pin high when turning on output, use the current value. Also
  let this value be set when in input mode.

Modified:
  head/sys/arm/xscale/ixp425/cambria_gpio.c

Modified: head/sys/arm/xscale/ixp425/cambria_gpio.c
==
--- head/sys/arm/xscale/ixp425/cambria_gpio.c   Wed Oct 12 20:40:25 2011
(r226323)
+++ head/sys/arm/xscale/ixp425/cambria_gpio.c   Wed Oct 12 20:57:21 2011
(r226324)
@@ -84,6 +84,7 @@ struct cambria_gpio_softc {
 struct mtx sc_mtx;
struct gpio_pin sc_pins[GPIO_PINS];
uint8_t sc_latch;
+   uint8_t sc_val;
 };
 
 struct cambria_gpio_pin {
@@ -309,6 +310,9 @@ cambria_gpio_pin_setflags(device_t dev, 
 {
struct cambria_gpio_softc *sc = device_get_softc(dev);
int error;
+   uint8_t mask;
+
+   mask = 1  pin;
 
if (pin = GPIO_PINS)
return (EINVAL);
@@ -325,7 +329,16 @@ cambria_gpio_pin_setflags(device_t dev, 
GPIO_LOCK(sc);
sc-sc_pins[pin].gp_flags = flags;
 
-   sc-sc_latch |= (1  pin);
+   /*
+* Writing a logical one sets the signal high and writing a logical
+* zero sets the signal low. To configure a digital I/O signal as an
+* input, a logical one must first be written to the data bit to
+* three-state the associated output.
+*/
+   if (flags  GPIO_PIN_INPUT || sc-sc_val  mask)
+   sc-sc_latch |= mask; /* input or output  high */
+   else
+   sc-sc_latch = ~mask;
error = cambria_gpio_write(sc);
GPIO_UNLOCK(sc);
 
@@ -337,15 +350,28 @@ cambria_gpio_pin_set(device_t dev, uint3
 {
struct cambria_gpio_softc *sc = device_get_softc(dev);
int error;
+   uint8_t mask;
 
-   if (pin = GPIO_PINS || sc-sc_pins[pin].gp_flags != GPIO_PIN_OUTPUT)
-   return (EINVAL);
+   mask = 1  pin;
 
+   if (pin = GPIO_PINS)
+   return (EINVAL);
GPIO_LOCK(sc);
if (value)
-   sc-sc_latch |= (1  pin);
+   sc-sc_val |= mask;
else
-   sc-sc_latch = ~(1  pin);
+   sc-sc_val = ~mask;
+
+   if (sc-sc_pins[pin].gp_flags != GPIO_PIN_OUTPUT) {
+   /* just save, altering the latch will disable input */
+   GPIO_UNLOCK(sc);
+   return (0);
+   }
+
+   if (value)
+   sc-sc_latch |= mask;
+   else
+   sc-sc_latch = ~mask;
error = cambria_gpio_write(sc);
GPIO_UNLOCK(sc);
 
@@ -375,14 +401,17 @@ static int
 cambria_gpio_pin_toggle(device_t dev, uint32_t pin)
 {
struct cambria_gpio_softc *sc = device_get_softc(dev);
-   int error;
+   int error = 0;
 
-   if (pin = GPIO_PINS || sc-sc_pins[pin].gp_flags != GPIO_PIN_OUTPUT)
+   if (pin = GPIO_PINS)
return (EINVAL);
 
GPIO_LOCK(sc);
-   sc-sc_latch ^= (1  pin);
-   error = cambria_gpio_write(sc);
+   sc-sc_val ^= (1  pin);
+   if (sc-sc_pins[pin].gp_flags == GPIO_PIN_OUTPUT) {
+   sc-sc_latch ^= (1  pin);
+   error = cambria_gpio_write(sc);
+   }
GPIO_UNLOCK(sc);
 
return (error);
___
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: r226325 - head/sys/arm/xscale/ixp425

2011-10-12 Thread Andrew Thompson
Author: thompsa
Date: Wed Oct 12 20:58:54 2011
New Revision: 226325
URL: http://svn.freebsd.org/changeset/base/226325

Log:
  Name these gpio pins better, they are on an external PLD and not the same as
  the cpu wired gpio.

Modified:
  head/sys/arm/xscale/ixp425/cambria_gpio.c

Modified: head/sys/arm/xscale/ixp425/cambria_gpio.c
==
--- head/sys/arm/xscale/ixp425/cambria_gpio.c   Wed Oct 12 20:57:21 2011
(r226324)
+++ head/sys/arm/xscale/ixp425/cambria_gpio.c   Wed Oct 12 20:58:54 2011
(r226325)
@@ -96,11 +96,11 @@ struct cambria_gpio_pin {
 extern struct ixp425_softc *ixp425_softc;
 
 static struct cambria_gpio_pin cambria_gpio_pins[GPIO_PINS] = {
-   { GPIO0, 0, GPIO_PIN_OUTPUT },
-   { GPIO1, 1, GPIO_PIN_OUTPUT },
-   { GPIO2, 2, GPIO_PIN_OUTPUT },
-   { GPIO3, 3, GPIO_PIN_OUTPUT },
-   { GPIO4, 4, GPIO_PIN_OUTPUT },
+   { PLD0, 0, GPIO_PIN_OUTPUT },
+   { PLD1, 1, GPIO_PIN_OUTPUT },
+   { PLD2, 2, GPIO_PIN_OUTPUT },
+   { PLD3, 3, GPIO_PIN_OUTPUT },
+   { PLD4, 4, GPIO_PIN_OUTPUT },
 };
 
 /*
___
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: r226242 - head/tools/tools/nanobsd/gateworks

2011-10-10 Thread Andrew Thompson
Author: thompsa
Date: Tue Oct 11 01:11:57 2011
New Revision: 226242
URL: http://svn.freebsd.org/changeset/base/226242

Log:
  Fix build after TARGET_BIG_ENDIAN was nuked from orbit.

Modified:
  head/tools/tools/nanobsd/gateworks/common

Modified: head/tools/tools/nanobsd/gateworks/common
==
--- head/tools/tools/nanobsd/gateworks/common   Mon Oct 10 21:54:19 2011
(r226241)
+++ head/tools/tools/nanobsd/gateworks/common   Tue Oct 11 01:11:57 2011
(r226242)
@@ -4,9 +4,8 @@ NANO_CFGDIR=${NANO_CFGDIR:-${NANO_SRC}/$
 test -d ${NANO_CFGDIR} || NANO_CFGDIR=/var/empty
 NANO_PMAKE=make  # NB: disable -j 3
 
-NANO_ARCH=arm
+NANO_ARCH=armeb
 TARGET_CPUTYPE=xscale; export TARGET_CPUTYPE   # XXX
-TARGET_BIG_ENDIAN=true; export TARGET_BIG_ENDIAN   # XXX
 
 NANO_CUSTOMIZE=cust_allow_ssh_root
 
___
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: r226034 - head/sys/arm/xscale/ixp425

2011-10-05 Thread Andrew Thompson
Author: thompsa
Date: Wed Oct  5 08:33:50 2011
New Revision: 226034
URL: http://svn.freebsd.org/changeset/base/226034

Log:
  Add missing newbus glue, this has never attached properly to gpiobus.

Modified:
  head/sys/arm/xscale/ixp425/avila_gpio.c

Modified: head/sys/arm/xscale/ixp425/avila_gpio.c
==
--- head/sys/arm/xscale/ixp425/avila_gpio.c Wed Oct  5 07:28:23 2011
(r226033)
+++ head/sys/arm/xscale/ixp425/avila_gpio.c Wed Oct  5 08:33:50 2011
(r226034)
@@ -356,5 +356,10 @@ static driver_t gpio_avila_driver = {
sizeof(struct avila_gpio_softc),
 };
 static devclass_t gpio_avila_devclass;
+extern devclass_t gpiobus_devclass, gpioc_devclass;
+extern driver_t gpiobus_driver, gpioc_driver;
 
 DRIVER_MODULE(gpio_avila, ixp, gpio_avila_driver, gpio_avila_devclass, 0, 0);
+DRIVER_MODULE(gpiobus, gpio_avila, gpiobus_driver, gpiobus_devclass, 0, 0);
+DRIVER_MODULE(gpioc, gpio_avila, gpioc_driver, gpioc_devclass, 0, 0);
+MODULE_VERSION(gpio_avila, 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: r225955 - head/sys/boot/arm/ixp425/boot2

2011-10-03 Thread Andrew Thompson
Author: thompsa
Date: Tue Oct  4 00:15:40 2011
New Revision: 225955
URL: http://svn.freebsd.org/changeset/base/225955

Log:
  Allow ixp425 boot2 to compile after r219452

Modified:
  head/sys/boot/arm/ixp425/boot2/boot2.c

Modified: head/sys/boot/arm/ixp425/boot2/boot2.c
==
--- head/sys/boot/arm/ixp425/boot2/boot2.c  Mon Oct  3 21:48:10 2011
(r225954)
+++ head/sys/boot/arm/ixp425/boot2/boot2.c  Tue Oct  4 00:15:40 2011
(r225955)
@@ -86,7 +86,7 @@ static unsigned dsk_start;
 static char cmd[512];
 static char kname[1024];
 static uint32_t opts;
-static int dsk_meta;
+static uint8_t dsk_meta;
 static int bootslice;
 static int bootpart;
 static int disk_layout;
___
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: r225495 - stable/8/sys/net

2011-09-11 Thread Andrew Thompson
Author: thompsa
Date: Sun Sep 11 23:37:40 2011
New Revision: 225495
URL: http://svn.freebsd.org/changeset/base/225495

Log:
  MFC r225380
  
   On the first loop for generating a bridge MAC address use the local
   hostid, this gives a good chance of keeping the same address over
   reboots. This is intended to help IPV6 and similar which generate
   their addresses from the mac.
  
  PR:   kern/160300
  Submitted by: mdodd

Modified:
  stable/8/sys/net/if_bridge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/net/if_bridge.c
==
--- stable/8/sys/net/if_bridge.cSun Sep 11 21:38:33 2011
(r225494)
+++ stable/8/sys/net/if_bridge.cSun Sep 11 23:37:40 2011
(r225495)
@@ -85,6 +85,7 @@ __FBSDID($FreeBSD$);
 #include sys/malloc.h
 #include sys/protosw.h
 #include sys/systm.h
+#include sys/jail.h
 #include sys/time.h
 #include sys/socket.h /* for net/if.h */
 #include sys/sockio.h
@@ -560,7 +561,8 @@ bridge_clone_create(struct if_clone *ifc
 {
struct bridge_softc *sc, *sc2;
struct ifnet *bifp, *ifp;
-   int retry;
+   int fb, retry;
+   unsigned long hostid;
 
sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
ifp = sc-sc_ifp = if_alloc(IFT_ETHER);
@@ -593,17 +595,30 @@ bridge_clone_create(struct if_clone *ifc
IFQ_SET_READY(ifp-if_snd);
 
/*
-* Generate a random ethernet address with a locally administered
-* address.
+* Generate an ethernet address with a locally administered address.
 *
 * Since we are using random ethernet addresses for the bridge, it is
 * possible that we might have address collisions, so make sure that
 * this hardware address isn't already in use on another bridge.
+* The first try uses the hostid and falls back to arc4rand().
 */
+   fb = 0;
+   getcredhostid(curthread-td_ucred, hostid);
for (retry = 1; retry != 0;) {
-   arc4rand(sc-sc_defaddr, ETHER_ADDR_LEN, 1);
-   sc-sc_defaddr[0] = ~1;/* clear multicast bit */
-   sc-sc_defaddr[0] |= 2; /* set the LAA bit */
+   if (fb || hostid == 0) {
+   arc4rand(sc-sc_defaddr, ETHER_ADDR_LEN, 1);
+   sc-sc_defaddr[0] = ~1;/* clear multicast bit */
+   sc-sc_defaddr[0] |= 2; /* set the LAA bit */
+   } else {
+   sc-sc_defaddr[0] = 0x2;
+   sc-sc_defaddr[1] = (hostid  24)  0xff;
+   sc-sc_defaddr[2] = (hostid  16)  0xff;
+   sc-sc_defaddr[3] = (hostid  8 )  0xff;
+   sc-sc_defaddr[4] =  hostid 0xff;
+   sc-sc_defaddr[5] = ifp-if_dunit  0xff;
+   }
+
+   fb = 1;
retry = 0;
mtx_lock(bridge_list_mtx);
LIST_FOREACH(sc2, bridge_list, sc_list) {
___
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: r225380 - head/sys/net

2011-09-04 Thread Andrew Thompson
Author: thompsa
Date: Sun Sep  4 22:06:32 2011
New Revision: 225380
URL: http://svn.freebsd.org/changeset/base/225380

Log:
  On the first loop for generating a bridge MAC address use the local
  hostid, this gives a good chance of keeping the same address over
  reboots. This is intended to help IPV6 and similar which generate
  their addresses from the mac.
  
  PR:   kern/160300
  Submitted by: mdodd
  Approved by:  re (kib)

Modified:
  head/sys/net/if_bridge.c

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cSun Sep  4 16:26:43 2011(r225379)
+++ head/sys/net/if_bridge.cSun Sep  4 22:06:32 2011(r225380)
@@ -85,6 +85,7 @@ __FBSDID($FreeBSD$);
 #include sys/malloc.h
 #include sys/protosw.h
 #include sys/systm.h
+#include sys/jail.h
 #include sys/time.h
 #include sys/socket.h /* for net/if.h */
 #include sys/sockio.h
@@ -560,7 +561,8 @@ bridge_clone_create(struct if_clone *ifc
 {
struct bridge_softc *sc, *sc2;
struct ifnet *bifp, *ifp;
-   int retry;
+   int fb, retry;
+   unsigned long hostid;
 
sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
ifp = sc-sc_ifp = if_alloc(IFT_ETHER);
@@ -593,17 +595,30 @@ bridge_clone_create(struct if_clone *ifc
IFQ_SET_READY(ifp-if_snd);
 
/*
-* Generate a random ethernet address with a locally administered
-* address.
+* Generate an ethernet address with a locally administered address.
 *
 * Since we are using random ethernet addresses for the bridge, it is
 * possible that we might have address collisions, so make sure that
 * this hardware address isn't already in use on another bridge.
+* The first try uses the hostid and falls back to arc4rand().
 */
+   fb = 0;
+   getcredhostid(curthread-td_ucred, hostid);
for (retry = 1; retry != 0;) {
-   arc4rand(sc-sc_defaddr, ETHER_ADDR_LEN, 1);
-   sc-sc_defaddr[0] = ~1;/* clear multicast bit */
-   sc-sc_defaddr[0] |= 2; /* set the LAA bit */
+   if (fb || hostid == 0) {
+   arc4rand(sc-sc_defaddr, ETHER_ADDR_LEN, 1);
+   sc-sc_defaddr[0] = ~1;/* clear multicast bit */
+   sc-sc_defaddr[0] |= 2; /* set the LAA bit */
+   } else {
+   sc-sc_defaddr[0] = 0x2;
+   sc-sc_defaddr[1] = (hostid  24)  0xff;
+   sc-sc_defaddr[2] = (hostid  16)  0xff;
+   sc-sc_defaddr[3] = (hostid  8 )  0xff;
+   sc-sc_defaddr[4] =  hostid 0xff;
+   sc-sc_defaddr[5] = ifp-if_dunit  0xff;
+   }
+
+   fb = 1;
retry = 0;
mtx_lock(bridge_list_mtx);
LIST_FOREACH(sc2, bridge_list, sc_list) {
___
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: r223846 - head/sys/net

2011-07-07 Thread Andrew Thompson
Author: thompsa
Date: Thu Jul  7 20:02:09 2011
New Revision: 223846
URL: http://svn.freebsd.org/changeset/base/223846

Log:
  Grab the rlock before checking if our interface is enabled, it could be
  possible to hit a dead pointer when changing interfaces.
  
  PR:   kern/156978
  Submitted by: Andrew Boyer
  MFC after:1 week

Modified:
  head/sys/net/if_lagg.c

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Thu Jul  7 18:07:03 2011(r223845)
+++ head/sys/net/if_lagg.c  Thu Jul  7 20:02:09 2011(r223846)
@@ -1221,14 +1221,15 @@ lagg_input(struct ifnet *ifp, struct mbu
struct lagg_softc *sc = lp-lp_softc;
struct ifnet *scifp = sc-sc_ifp;
 
+   LAGG_RLOCK(sc);
if ((scifp-if_drv_flags  IFF_DRV_RUNNING) == 0 ||
(lp-lp_flags  LAGG_PORT_DISABLED) ||
sc-sc_proto == LAGG_PROTO_NONE) {
+   LAGG_RUNLOCK(sc);
m_freem(m);
return (NULL);
}
 
-   LAGG_RLOCK(sc);
ETHER_BPF_MTAP(scifp, m);
 
m = (*sc-sc_input)(sc, lp, m);
___
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: r222275 - in head/sys: amd64/conf i386/conf

2011-05-24 Thread Andrew Thompson
On 25 May 2011 16:46, Kevin Lo ke...@freebsd.org wrote:
 Author: kevlo
 Date: Wed May 25 04:46:48 2011
 New Revision: 75
 URL: http://svn.freebsd.org/changeset/base/75

 Log:
  run(4) needs firmware loaded to work

 Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/i386/conf/GENERIC

 Modified: head/sys/amd64/conf/GENERIC
 ==
 --- head/sys/amd64/conf/GENERIC Wed May 25 03:25:14 2011        (r74)
 +++ head/sys/amd64/conf/GENERIC Wed May 25 04:46:48 2011        (r75)
 @@ -324,6 +324,7 @@ device              udav            # Davicom DM9601E USB
  # USB Wireless
  device         rum             # Ralink Technology RT2501USB wireless NICs
  device         run             # Ralink Technology RT2700/RT2800/RT3000 NICs.
 +device         runfw           # Ralink Technology RT2700/RT2800/RT3000 NICs 
 firmware
  device         uath            # Atheros AR5523 wireless NICs
  device         upgt            # Conexant/Intersil PrismGT wireless NICs.
  device         ural            # Ralink Technology RT2500USB wireless NICs

Are you sure this is right? I believe this will statically link in
contrib/dev/run/rt2870.fw.uu to the kernel as opposed to having the
kernel load and release runfw.ko as needed.


Andrew
___
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: r221792 - head/sys/geom

2011-05-11 Thread Andrew Thompson
Author: thompsa
Date: Wed May 11 21:47:30 2011
New Revision: 221792
URL: http://svn.freebsd.org/changeset/base/221792

Log:
  Move the three geom kprocs as threads under a single pid.
  
  Reviewed by:  julian

Modified:
  head/sys/geom/geom_kern.c

Modified: head/sys/geom/geom_kern.c
==
--- head/sys/geom/geom_kern.c   Wed May 11 21:15:12 2011(r221791)
+++ head/sys/geom/geom_kern.c   Wed May 11 21:47:30 2011(r221792)
@@ -44,6 +44,7 @@ __FBSDID($FreeBSD$);
 #include sys/bio.h
 #include sys/sysctl.h
 #include sys/proc.h
+#include sys/unistd.h
 #include sys/kthread.h
 #include sys/lock.h
 #include sys/mutex.h
@@ -57,7 +58,10 @@ MALLOC_DEFINE(M_GEOM, GEOM, Geom data
 
 struct sx topology_lock;
 
-static struct proc *g_up_proc;
+static struct proc *g_proc;
+static struct thread *g_up_td;
+static struct thread *g_down_td;
+static struct thread *g_event_td;
 
 int g_debugflags;
 int g_collectstats = 1;
@@ -82,71 +86,43 @@ int g_shutdown;
  */
 
 static void
-g_up_procbody(void)
+g_up_procbody(void *arg)
 {
-   struct proc *p = g_up_proc;
-   struct thread *tp = FIRST_THREAD_IN_PROC(p);
 
mtx_assert(Giant, MA_NOTOWNED);
-   thread_lock(tp);
-   sched_prio(tp, PRIBIO);
-   thread_unlock(tp);
+   thread_lock(g_up_td);
+   sched_prio(g_up_td, PRIBIO);
+   thread_unlock(g_up_td);
for(;;) {
-   g_io_schedule_up(tp);
+   g_io_schedule_up(g_up_td);
}
 }
 
-static struct kproc_desc g_up_kp = {
-   g_up,
-   g_up_procbody,
-   g_up_proc,
-};
-
-static struct proc *g_down_proc;
-
 static void
-g_down_procbody(void)
+g_down_procbody(void *arg)
 {
-   struct proc *p = g_down_proc;
-   struct thread *tp = FIRST_THREAD_IN_PROC(p);
 
mtx_assert(Giant, MA_NOTOWNED);
-   thread_lock(tp);
-   sched_prio(tp, PRIBIO);
-   thread_unlock(tp);
+   thread_lock(g_down_td);
+   sched_prio(g_down_td, PRIBIO);
+   thread_unlock(g_down_td);
for(;;) {
-   g_io_schedule_down(tp);
+   g_io_schedule_down(g_down_td);
}
 }
 
-static struct kproc_desc g_down_kp = {
-   g_down,
-   g_down_procbody,
-   g_down_proc,
-};
-
-static struct proc *g_event_proc;
-
 static void
-g_event_procbody(void)
+g_event_procbody(void *arg)
 {
-   struct proc *p = g_event_proc;
-   struct thread *tp = FIRST_THREAD_IN_PROC(p);
 
mtx_assert(Giant, MA_NOTOWNED);
-   thread_lock(tp);
-   sched_prio(tp, PRIBIO);
-   thread_unlock(tp);
+   thread_lock(g_event_td);
+   sched_prio(g_event_td, PRIBIO);
+   thread_unlock(g_event_td);
g_run_events();
/* NOTREACHED */
 }
 
-static struct kproc_desc g_event_kp = {
-   g_event,
-   g_event_procbody,
-   g_event_proc,
-};
-
 static void
 geom_shutdown(void *foo __unused)
 {
@@ -164,9 +140,12 @@ g_init(void)
g_event_init();
g_ctl_init();
mtx_lock(Giant);
-   kproc_start(g_event_kp);
-   kproc_start(g_up_kp);
-   kproc_start(g_down_kp);
+   kproc_kthread_add(g_event_procbody, NULL, g_proc, g_event_td,
+   RFHIGHPID, 0, geom, g_event);
+   kproc_kthread_add(g_up_procbody, NULL, g_proc, g_up_td,
+   RFHIGHPID, 0, geom, g_up);
+   kproc_kthread_add(g_down_procbody, NULL, g_proc, g_down_td,
+   RFHIGHPID, 0, geom, g_down);
mtx_unlock(Giant);
EVENTHANDLER_REGISTER(shutdown_pre_sync, geom_shutdown, NULL,
SHUTDOWN_PRI_FIRST);
___
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: r221721 - stable/8/sys/net

2011-05-09 Thread Andrew Thompson
Author: thompsa
Date: Tue May 10 02:58:08 2011
New Revision: 221721
URL: http://svn.freebsd.org/changeset/base/221721

Log:
  MFC r221270
  
   LACP frames must not be send VLAN-tagged, check for that before processing.
  
  PR:   kern/156743
  Submitted by: Dmitrij Tejblum

Modified:
  stable/8/sys/net/if_lagg.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/net/if_lagg.c
==
--- stable/8/sys/net/if_lagg.c  Tue May 10 02:38:44 2011(r221720)
+++ stable/8/sys/net/if_lagg.c  Tue May 10 02:58:08 2011(r221721)
@@ -1786,7 +1786,7 @@ lagg_lacp_input(struct lagg_softc *sc, s
etype = ntohs(eh-ether_type);
 
/* Tap off LACP control messages */
-   if (etype == ETHERTYPE_SLOW) {
+   if ((m-m_flags  M_VLANTAG) == 0  etype == ETHERTYPE_SLOW) {
m = lacp_input(lp, m);
if (m == NULL)
return (NULL);
___
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: r221270 - head/sys/net

2011-04-30 Thread Andrew Thompson
Author: thompsa
Date: Sat Apr 30 20:34:52 2011
New Revision: 221270
URL: http://svn.freebsd.org/changeset/base/221270

Log:
  LACP frames must not be send VLAN-tagged, check for that before processing.
  
  PR:   kern/156743
  Submitted by: Dmitrij Tejblum
  MFC after:1 week

Modified:
  head/sys/net/if_lagg.c

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Sat Apr 30 20:16:49 2011(r221269)
+++ head/sys/net/if_lagg.c  Sat Apr 30 20:34:52 2011(r221270)
@@ -1794,7 +1794,7 @@ lagg_lacp_input(struct lagg_softc *sc, s
etype = ntohs(eh-ether_type);
 
/* Tap off LACP control messages */
-   if (etype == ETHERTYPE_SLOW) {
+   if ((m-m_flags  M_VLANTAG) == 0  etype == ETHERTYPE_SLOW) {
m = lacp_input(lp, m);
if (m == NULL)
return (NULL);
___
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: r221185 - stable/8/usr.sbin/usbdump

2011-04-28 Thread Andrew Thompson
Author: thompsa
Date: Thu Apr 28 21:27:34 2011
New Revision: 221185
URL: http://svn.freebsd.org/changeset/base/221185

Log:
  MFC r220316
  
   Lower WARNS to unbreak the build, some archs may have alignment issues.

Modified:
  stable/8/usr.sbin/usbdump/Makefile
Directory Properties:
  stable/8/usr.sbin/usbdump/   (props changed)

Modified: stable/8/usr.sbin/usbdump/Makefile
==
--- stable/8/usr.sbin/usbdump/Makefile  Thu Apr 28 21:25:58 2011
(r221184)
+++ stable/8/usr.sbin/usbdump/Makefile  Thu Apr 28 21:27:34 2011
(r221185)
@@ -3,6 +3,6 @@
 PROG=  usbdump
 SRCS=  usbdump.c
 MAN=   usbdump.8
-WARNS?=4
+WARNS?=3
 
 .include bsd.prog.mk
___
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: r221196 - svnadmin/conf

2011-04-28 Thread Andrew Thompson
Author: thompsa
Date: Fri Apr 29 03:20:51 2011
New Revision: 221196
URL: http://svn.freebsd.org/changeset/base/221196

Log:
  Release hselasky, onwards and upwards.

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Fri Apr 29 03:16:15 2011(r221195)
+++ svnadmin/conf/mentors   Fri Apr 29 03:20:51 2011(r221196)
@@ -16,7 +16,6 @@ andrewimp
 artavg Co-mentor: marcel
 erimlaier  Co-mentor: thompsa
 gabor  delphij
-hselasky   thompsa
 jinmei gnn
 jonathan   rwatson
 jpaetzel   kib
___
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


  1   2   3   4   5   6   7   8   9   >