svn commit: r231997 - head/sys/netgraph

2012-02-22 Thread Gleb Smirnoff
Author: glebius
Date: Wed Feb 22 09:08:51 2012
New Revision: 231997
URL: http://svn.freebsd.org/changeset/base/231997

Log:
  Revert r231829, that was my braino.

Modified:
  head/sys/netgraph/ng_base.c

Modified: head/sys/netgraph/ng_base.c
==
--- head/sys/netgraph/ng_base.c Wed Feb 22 08:30:18 2012(r231996)
+++ head/sys/netgraph/ng_base.c Wed Feb 22 09:08:51 2012(r231997)
@@ -3208,11 +3208,11 @@ ngb_mod_event(module_t mod, int event, v
MTX_DEF);
 #endif
ng_qzone = uma_zcreate(NetGraph items, sizeof(struct ng_item),
-   NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, M_WAITOK);
+   NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0);
uma_zone_set_max(ng_qzone, maxalloc);
ng_qdzone = uma_zcreate(NetGraph data items,
sizeof(struct ng_item), NULL, NULL, NULL, NULL,
-   UMA_ALIGN_CACHE, M_WAITOK);
+   UMA_ALIGN_CACHE, 0);
uma_zone_set_max(ng_qdzone, maxdata);
/* Autoconfigure number of threads. */
if (numthreads = 0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r231998 - head/sys/fs/msdosfs

2012-02-22 Thread Konstantin Belousov
Author: kib
Date: Wed Feb 22 13:01:17 2012
New Revision: 231998
URL: http://svn.freebsd.org/changeset/base/231998

Log:
  Use DOINGASYNC() to test for async allowance, to honor VFS syncing requests.
  
  Noted by: bde
  MFC after:1 week

Modified:
  head/sys/fs/msdosfs/msdosfs_denode.c
  head/sys/fs/msdosfs/msdosfs_lookup.c
  head/sys/fs/msdosfs/msdosfs_vnops.c

Modified: head/sys/fs/msdosfs/msdosfs_denode.c
==
--- head/sys/fs/msdosfs/msdosfs_denode.cWed Feb 22 09:08:51 2012
(r231997)
+++ head/sys/fs/msdosfs/msdosfs_denode.cWed Feb 22 13:01:17 2012
(r231998)
@@ -431,7 +431,7 @@ detrunc(dep, length, flags, cred, td)
if (allerror)
printf(detrunc(): vtruncbuf error %d\n, allerror);
 #endif
-   error = deupdat(dep, !(DETOV(dep)-v_mount-mnt_flag  MNT_ASYNC));
+   error = deupdat(dep, !DOINGASYNC((DETOV(dep;
if (error != 0  allerror == 0)
allerror = error;
 #ifdef MSDOSFS_DEBUG
@@ -510,7 +510,7 @@ deextend(dep, length, cred)
}
dep-de_FileSize = length;
dep-de_flag |= DE_UPDATE | DE_MODIFIED;
-   return (deupdat(dep, !(DETOV(dep)-v_mount-mnt_flag  MNT_ASYNC)));
+   return (deupdat(dep, !DOINGASYNC(DETOV(dep;
 }
 
 /*

Modified: head/sys/fs/msdosfs/msdosfs_lookup.c
==
--- head/sys/fs/msdosfs/msdosfs_lookup.cWed Feb 22 09:08:51 2012
(r231997)
+++ head/sys/fs/msdosfs/msdosfs_lookup.cWed Feb 22 13:01:17 2012
(r231998)
@@ -690,7 +690,7 @@ createde(dep, ddep, depp, cnp)
 
while (--ddep-de_fndcnt = 0) {
if (!(ddep-de_fndoffset  pmp-pm_crbomask)) {
-   if (DETOV(ddep)-v_mount-mnt_flag  MNT_ASYNC)
+   if (DOINGASYNC(DETOV(ddep)))
bdwrite(bp);
else if ((error = bwrite(bp)) != 0)
return error;
@@ -720,7 +720,7 @@ createde(dep, ddep, depp, cnp)
}
}
 
-   if (DETOV(ddep)-v_mount-mnt_flag  MNT_ASYNC)
+   if (DOINGASYNC(DETOV(ddep)))
bdwrite(bp);
else if ((error = bwrite(bp)) != 0)
return error;
@@ -1022,7 +1022,7 @@ removede(pdep, dep)
|| ep-deAttributes != ATTR_WIN95)
break;
}
-   if (DETOV(pdep)-v_mount-mnt_flag  MNT_ASYNC)
+   if (DOINGASYNC(DETOV(pdep)))
bdwrite(bp);
else if ((error = bwrite(bp)) != 0)
return error;

Modified: head/sys/fs/msdosfs/msdosfs_vnops.c
==
--- head/sys/fs/msdosfs/msdosfs_vnops.c Wed Feb 22 09:08:51 2012
(r231997)
+++ head/sys/fs/msdosfs/msdosfs_vnops.c Wed Feb 22 13:01:17 2012
(r231998)
@@ -1249,7 +1249,7 @@ abortit:
putushort(dotdotp-deStartCluster, dp-de_StartCluster);
if (FAT32(pmp))
putushort(dotdotp-deHighClust, dp-de_StartCluster  
16);
-   if (fvp-v_mount-mnt_flag  MNT_ASYNC)
+   if (DOINGASYNC(fvp))
bdwrite(bp);
else if ((error = bwrite(bp)) != 0) {
/* XXX should downgrade to ro here, fs is corrupt */
@@ -1383,7 +1383,7 @@ msdosfs_mkdir(ap)
putushort(denp[1].deHighClust, pdep-de_StartCluster  16);
}
 
-   if (ap-a_dvp-v_mount-mnt_flag  MNT_ASYNC)
+   if (DOINGASYNC(ap-a_dvp))
bdwrite(bp);
else if ((error = bwrite(bp)) != 0)
goto bad;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r231999 - head/sys/conf

2012-02-22 Thread Josh Paetzel
Author: jpaetzel
Date: Wed Feb 22 15:05:19 2012
New Revision: 231999
URL: http://svn.freebsd.org/changeset/base/231999

Log:
  Fix various typos and normalize spelling.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/conf/NOTES

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Wed Feb 22 13:01:17 2012(r231998)
+++ head/sys/conf/NOTES Wed Feb 22 15:05:19 2012(r231999)
@@ -219,19 +219,19 @@ options   MAXCPU=32
 
 # ADAPTIVE_MUTEXES changes the behavior of blocking mutexes to spin
 # if the thread that currently owns the mutex is executing on another
-# CPU.  This behaviour is enabled by default, so this option can be used
+# CPU.  This behavior is enabled by default, so this option can be used
 # to disable it.
 optionsNO_ADAPTIVE_MUTEXES
 
 # ADAPTIVE_RWLOCKS changes the behavior of reader/writer locks to spin
 # if the thread that currently owns the rwlock is executing on another
-# CPU.  This behaviour is enabled by default, so this option can be used
+# CPU.  This behavior is enabled by default, so this option can be used
 # to disable it.
 optionsNO_ADAPTIVE_RWLOCKS
 
 # ADAPTIVE_SX changes the behavior of sx locks to spin if the thread that
 # currently owns the sx lock is executing on another CPU.
-# This behaviour is enabled by default, so this option can be used to
+# This behavior is enabled by default, so this option can be used to
 # disable it.
 optionsNO_ADAPTIVE_SX
 
@@ -437,7 +437,7 @@ options KTRACE_REQUEST_POOL=101
 # initial value of the ktr_mask variable which determines at runtime
 # what events to trace.  KTR_CPUMASK determines which CPU's log
 # events, with bit X corresponding to CPU X.  The layout of the string
-# passed as KTR_CPUMASK must match a serie of bitmasks each of them
+# passed as KTR_CPUMASK must match a series of bitmasks each of them
 # separated by the ,  characters (ie:
 # KTR_CPUMASK=(0xAF, 0x)).  KTR_VERBOSE enables
 # dumping of KTR events to the console by default.  This functionality
@@ -602,7 +602,7 @@ options FLOWTABLE
 optionsSCTP
 # There are bunches of options:
 # this one turns on all sorts of
-# nastly printing that you can
+# nastily printing that you can
 # do. It's all controlled by a
 # bit mask (settable by socket opt and
 # by sysctl). Including will not cause
@@ -1269,7 +1269,7 @@ hint.sa.1.target=6
 # The sg driver provides a passthrough API that is compatible with the
 # Linux SG driver.  It will work in conjunction with the COMPAT_LINUX
 # option to run linux SG apps.  It can also stand on its own and provide
-# source level API compatiblity for porting apps to FreeBSD.
+# source level API compatibility for porting apps to FreeBSD.
 #
 # Target Mode support is provided here but also requires that a SIM
 # (SCSI Host Adapter Driver) provide support as well.
@@ -1434,7 +1434,7 @@ options   SC_NORM_REV_ATTR=(FG_YELLOW|BG_
 optionsSC_KERNEL_CONS_ATTR=(FG_RED|BG_BLACK)
 optionsSC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED)
 
-# The following options will let you change the default behaviour of
+# The following options will let you change the default behavior of
 # cut-n-paste feature
 optionsSC_CUT_SPACES2TABS  # convert leading spaces into tabs
 optionsSC_CUT_SEPCHARS=\x09\ # set of characters that delimit words
@@ -1835,7 +1835,7 @@ hint.uart.0.baud=115200
 #  specifically, the 0x20 flag can also be set (see above).
 #  Currently, at most one unit can have console support; the
 #  first one (in config file order) with this flag set is
-#  preferred.  Setting this flag for sio0 gives the old behaviour.
+#  preferred.  Setting this flag for sio0 gives the old behavior.
 #  0x80use this port for serial line gdb support in ddb.  Also known
 #  as debug port.
 #
@@ -2335,7 +2335,7 @@ hint.gusc.0.flags=0x13
 #  sanity checking and possible increase of
 #  verbosity.
 #
-# SND_DIAGNOSTIC   Simmilar in a spirit of INVARIANTS/DIAGNOSTIC,
+# SND_DIAGNOSTIC   Similar in a spirit of INVARIANTS/DIAGNOSTIC,
 #  zero tolerance against inconsistencies.
 #
 # SND_FEEDER_MULTIFORMAT   By default, only 16/32 bit feeders are compiled
@@ -2418,7 +2418,7 @@ devicecmx
 # options  BROOKTREE_SYSTEM_DEFAULT=BROOKTREE_NTSC
 # Specifies the default video capture mode.
 # This is required for Dual Crystal (2835Mhz) boards where PAL is used
-# to prevent hangs during initialisation, e.g. VideoLogic Captivator PCI.
+# to prevent hangs during initialization, e.g. VideoLogic Captivator PCI.
 #
 # options  BKTR_USE_PLL
 # This is required for PAL or SECAM boards with a 28Mhz crystal and no 35Mhz
@@ -2428,7 +2428,7 @@ devicecmx
 # This enables IOCTLs which give user level 

svn commit: r232000 - head/share/misc

2012-02-22 Thread Maxim Konovalov
Author: maxim
Date: Wed Feb 22 17:52:53 2012
New Revision: 232000
URL: http://svn.freebsd.org/changeset/base/232000

Log:
  DragonFly 3.0.1 added.

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==
--- head/share/misc/bsd-family-tree Wed Feb 22 15:05:19 2012
(r231999)
+++ head/share/misc/bsd-family-tree Wed Feb 22 17:52:53 2012
(r232000)
@@ -251,7 +251,7 @@ FreeBSD 5.2   |  |  
  |   10.7| |   |
  ||  | OpenBSD 5.0 |
  +--FreeBSD   |  | |   |
- |9.0 |  | |   |
+ |9.0 |  | |   DragonFly 3.0.1
  | v  |  | |   |
  ||  | |   |
 FreeBSD 10 -current   |  NetBSD -current  OpenBSD -current |
@@ -543,6 +543,7 @@ OpenBSD 4.9 2011-05-01 [OBD]
 Mac OS X 10.7  2011-07-20 [APL]
 OpenBSD 5.02011-11-01 [OBD]
 FreeBSD 9.02012-01-12 [FBD]
+DragonFly 3.0.12012-02-21 [DFB]
 
 Bibliography
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r232002 - head/sys/vm

2012-02-22 Thread Konstantin Belousov
Author: kib
Date: Wed Feb 22 20:01:38 2012
New Revision: 232002
URL: http://svn.freebsd.org/changeset/base/232002

Log:
  Remove wrong comment.
  
  Discussed with:   alc
  MFC after:3 days

Modified:
  head/sys/vm/vnode_pager.h

Modified: head/sys/vm/vnode_pager.h
==
--- head/sys/vm/vnode_pager.h   Wed Feb 22 20:00:48 2012(r232001)
+++ head/sys/vm/vnode_pager.h   Wed Feb 22 20:01:38 2012(r232002)
@@ -40,10 +40,6 @@
 
 #ifdef _KERNEL
 
-/*
- * XXX Generic routines; currently called by badly written FS code; these
- * XXX should go away soon.
- */
 int vnode_pager_generic_getpages(struct vnode *vp, vm_page_t *m,
  int count, int reqpage);
 int vnode_pager_generic_putpages(struct vnode *vp, vm_page_t *m,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r232003 - head/sys/ufs/ufs

2012-02-22 Thread Konstantin Belousov
Author: kib
Date: Wed Feb 22 20:03:51 2012
New Revision: 232003
URL: http://svn.freebsd.org/changeset/base/232003

Log:
  Properly lock DQREF() with dqhlock. Missed locking caused counter
  corruption.
  
  Assert that the dq reference value is sane before decrementing it.
  
  Reported and tested by:   pho
  MFC after:1 week

Modified:
  head/sys/ufs/ufs/ufs_quota.c

Modified: head/sys/ufs/ufs/ufs_quota.c
==
--- head/sys/ufs/ufs/ufs_quota.cWed Feb 22 20:01:38 2012
(r232002)
+++ head/sys/ufs/ufs/ufs_quota.cWed Feb 22 20:03:51 2012
(r232003)
@@ -1469,6 +1469,7 @@ dqrele(struct vnode *vp, struct dquot *d
if (dq == NODQUOT)
return;
DQH_LOCK();
+   KASSERT(dq-dq_cnt  0, (Lost dq %p reference 1, dq));
if (dq-dq_cnt  1) {
dq-dq_cnt--;
DQH_UNLOCK();
@@ -1479,6 +1480,7 @@ sync:
(void) dqsync(vp, dq);
 
DQH_LOCK();
+   KASSERT(dq-dq_cnt  0, (Lost dq %p reference 2, dq));
if (--dq-dq_cnt  0)
{
DQH_UNLOCK();
@@ -1658,6 +1660,7 @@ quotaref(vp, qrp)
 */
found = 0;
ip = VTOI(vp);
+   mtx_lock(dqhlock);
for (i = 0; i  MAXQUOTAS; i++) {
if ((dq = ip-i_dquot[i]) == NODQUOT)
continue;
@@ -1665,6 +1668,7 @@ quotaref(vp, qrp)
qrp[i] = dq;
found++;
}
+   mtx_unlock(dqhlock);
return (found);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r231978 - head/sys/conf

2012-02-22 Thread Ed Schouten
* Dimitry Andric d...@freebsd.org, 20120221 21:55:
   These warnings are tricky to fix without a lot of overhaul, and they are
   harmless, so disable them for now.

What about marking it const? It seems to be never written to.

-- 
 Ed Schouten e...@80386.nl
 WWW: http://80386.nl/


pgpiVcrq6VuKz.pgp
Description: PGP signature


svn commit: r232004 - head/usr.bin/ncal

2012-02-22 Thread Maxim Konovalov
Author: maxim
Date: Wed Feb 22 21:08:58 2012
New Revision: 232004
URL: http://svn.freebsd.org/changeset/base/232004

Log:
  o Use ISO 3166 county code for Sweden.
  
  PR:   standards/165400
  Submitted by: Carsten Hey
  MFC after:1 week

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

Modified: head/usr.bin/ncal/ncal.c
==
--- head/usr.bin/ncal/ncal.cWed Feb 22 20:03:51 2012(r232003)
+++ head/usr.bin/ncal/ncal.cWed Feb 22 21:08:58 2012(r232004)
@@ -105,7 +105,7 @@ static struct djswitch {
{RO, Romania,   {1919,  3, 31}},
{RU, Russia,{1918,  1, 31}},
{SI, Slovenia,  {1919,  3,  4}},
-   {SW, Sweden,{1753,  2, 17}},
+   {SE, Sweden,{1753,  2, 17}},
{TR, Turkey,{1926, 12, 18}},
{US, United States, {1752,  9,  2}},
{YU, Yugoslavia,{1919,  3,  4}}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r232007 - head/lib/libc/gen

2012-02-22 Thread Jilles Tjoelker
Author: jilles
Date: Wed Feb 22 21:47:50 2012
New Revision: 232007
URL: http://svn.freebsd.org/changeset/base/232007

Log:
  libc: Eliminate some relative relocations in fmtmsg().

Modified:
  head/lib/libc/gen/fmtmsg.c

Modified: head/lib/libc/gen/fmtmsg.c
==
--- head/lib/libc/gen/fmtmsg.c  Wed Feb 22 21:46:15 2012(r232006)
+++ head/lib/libc/gen/fmtmsg.c  Wed Feb 22 21:47:50 2012(r232007)
@@ -45,10 +45,6 @@ static const char
*sevinfo(int);
 static int  validmsgverb(const char *);
 
-static const char *validlist[] = {
-   label, severity, text, action, tag, NULL
-};
-
 int
 fmtmsg(long class, const char *label, int sev, const char *text,
 const char *action, const char *tag)
@@ -205,14 +201,18 @@ sevinfo(int sev)
 static int
 validmsgverb(const char *msgverb)
 {
+   const char *validlist = label\0severity\0text\0action\0tag\0;
char *msgcomp;
-   int i, equality;
+   size_t len1, len2;
+   const char *p;
+   int equality;
 
equality = 0;
while ((msgcomp = nextcomp(msgverb)) != NULL) {
equality--;
-   for (i = 0; validlist[i] != NULL; i++) {
-   if (strcmp(msgcomp, validlist[i]) == 0)
+   len1 = strlen(msgcomp);
+   for (p = validlist; (len2 = strlen(p)) != 0; p += len2 + 1) {
+   if (len1 == len2  memcmp(msgcomp, p, len1) == 0)
equality++;
}
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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


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


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


Re: svn commit: r231999 - head/sys/conf

2012-02-22 Thread Doug Barton
On 02/22/2012 07:05, Josh Paetzel wrote:
 -# CPU.  This behaviour is enabled by default, so this option can be used

That's not a typo, it's an alternate spelling, which we usually don't
correct (same with initialisation). I'm not asking for the change to
be backed out, just letting you know for future reference.


Doug

-- 

It's always a long day; 86400 doesn't fit into a short.

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

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


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

2012-02-22 Thread Glen Barber
Author: gjb (doc committer)
Date: Wed Feb 22 22:40:20 2012
New Revision: 232011
URL: http://svn.freebsd.org/changeset/base/232011

Log:
  Xref the following in wlan(4):
  
  - bwn(4)
  - mwl(4)
  - run(4)
  
  MFC after:3 days

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

Modified: head/share/man/man4/wlan.4
==
--- head/share/man/man4/wlan.4  Wed Feb 22 22:29:23 2012(r232010)
+++ head/share/man/man4/wlan.4  Wed Feb 22 22:40:20 2012(r232011)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd July 8, 2009
+.Dd February 22, 2012
 .Dt WLAN 4
 .Os
 .Sh NAME
@@ -174,13 +174,16 @@ may not interoperate.
 .Xr an 4 ,
 .Xr ath 4 ,
 .Xr bwi 4 ,
+.Xr bwn 4 ,
 .Xr ipw 4 ,
 .Xr iwi 4 ,
 .Xr iwn 4 ,
 .Xr malo 4 ,
+.Xr mwl 4 ,
 .Xr netintro 4 ,
 .Xr ral 4 ,
 .Xr rum 4 ,
+.Xr run 4 ,
 .Xr uath 4 ,
 .Xr upgt 4 ,
 .Xr ural 4 ,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r231989 - in head: lib/libthr/thread sys/kern sys/sys

2012-02-22 Thread Jilles Tjoelker
On Wed, Feb 22, 2012 at 03:22:50AM +, David Xu wrote:
 Author: davidxu
 Date: Wed Feb 22 03:22:49 2012
 New Revision: 231989
 URL: http://svn.freebsd.org/changeset/base/231989

 Log:
   Use unused fourth argument of umtx_op to pass flags to kernel for operation
   UMTX_OP_WAIT. Upper 16bits is enough to hold a clock id, and lower
   16bits is used to pass flags. The change saves a clock_gettime() syscall
   from libthr.

 Modified:
   head/lib/libthr/thread/thr_umtx.c
   head/sys/kern/kern_umtx.c
   head/sys/sys/umtx.h
 
 Modified: head/lib/libthr/thread/thr_umtx.c
 ==
 --- head/lib/libthr/thread/thr_umtx.c Wed Feb 22 01:50:13 2012
 (r231988)
 +++ head/lib/libthr/thread/thr_umtx.c Wed Feb 22 03:22:49 2012
 (r231989)
 @@ -200,20 +200,10 @@ int
 + abstime != NULL ? (void *)(uintptr_t)((clockid  16) | 
 UMTX_WAIT_ABSTIME) : 0, 

Please check that this shift does not lose any information (i.e.,
clockid = 0  clockid = 0x) before doing it.

Implementing clock_getcpuclockid() will require clockids greater than
65535 because such clockids contain a process id.

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


Re: svn commit: r231989 - in head: lib/libthr/thread sys/kern sys/sys

2012-02-22 Thread David Xu

On 2012/2/23 7:42, Jilles Tjoelker wrote:

On Wed, Feb 22, 2012 at 03:22:50AM +, David Xu wrote:

Author: davidxu
Date: Wed Feb 22 03:22:49 2012
New Revision: 231989
URL: http://svn.freebsd.org/changeset/base/231989
Log:
   Use unused fourth argument of umtx_op to pass flags to kernel for operation
   UMTX_OP_WAIT. Upper 16bits is enough to hold a clock id, and lower
   16bits is used to pass flags. The change saves a clock_gettime() syscall
   from libthr.
Modified:
   head/lib/libthr/thread/thr_umtx.c
   head/sys/kern/kern_umtx.c
   head/sys/sys/umtx.h

Modified: head/lib/libthr/thread/thr_umtx.c
==
--- head/lib/libthr/thread/thr_umtx.c   Wed Feb 22 01:50:13 2012
(r231988)
+++ head/lib/libthr/thread/thr_umtx.c   Wed Feb 22 03:22:49 2012
(r231989)
@@ -200,20 +200,10 @@ int
+   abstime != NULL ? (void *)(uintptr_t)((clockid  16) | 
UMTX_WAIT_ABSTIME) : 0,

Please check that this shift does not lose any information (i.e.,
clockid= 0  clockid= 0x) before doing it.

Implementing clock_getcpuclockid() will require clockids greater than
65535 because such clockids contain a process id.

In which document said the clock id includes a process id ? I think the 
clock_getcpuclockid()

is a simplified version of getrusage().



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


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


svn commit: r232015 - head/sys/dev/mii

2012-02-22 Thread Pyun YongHyeon
Author: yongari
Date: Thu Feb 23 01:20:21 2012
New Revision: 232015
URL: http://svn.freebsd.org/changeset/base/232015

Log:
  Add Seeq Technology 80220 PHY support to smcphy(4).  This PHY is
  found on Adaptec AIC-6915 Starfire ethernet controller.
  While here, use status register to know resolved speed/duplex.
  With this change, sf(4) correctly reports speed/duplex of
  established link.
  
  Reviewed by:  marius

Modified:
  head/sys/dev/mii/smcphy.c

Modified: head/sys/dev/mii/smcphy.c
==
--- head/sys/dev/mii/smcphy.c   Thu Feb 23 00:59:21 2012(r232014)
+++ head/sys/dev/mii/smcphy.c   Thu Feb 23 01:20:21 2012(r232015)
@@ -55,6 +55,7 @@ static intsmcphy_attach(device_t);
 static int smcphy_service(struct mii_softc *, struct mii_data *, int);
 static voidsmcphy_reset(struct mii_softc *);
 static voidsmcphy_auto(struct mii_softc *, int);
+static voidsmcphy_status(struct mii_softc *);
 
 static device_method_t smcphy_methods[] = {
/* device interface */
@@ -76,13 +77,20 @@ static driver_t smcphy_driver = {
 DRIVER_MODULE(smcphy, miibus, smcphy_driver, smcphy_devclass, 0, 0);
 
 static const struct mii_phydesc smcphys[] = {
+   MII_PHY_DESC(SEEQ, 80220),
MII_PHY_DESC(SEEQ, 84220),
MII_PHY_END
 };
 
+static const struct mii_phy_funcs smcphy80220_funcs = {
+   smcphy_service,
+   smcphy_status,
+   mii_phy_reset
+};
+
 static const struct mii_phy_funcs smcphy_funcs = {
smcphy_service,
-   ukphy_status,   
+   smcphy_status,
smcphy_reset
 };
 
@@ -97,11 +105,16 @@ static int
 smcphy_attach(device_t dev)
 {
struct mii_softc *sc;
+   struct mii_attach_args *ma;
+   const struct mii_phy_funcs *mpf;
 
sc = device_get_softc(dev);
-
-   mii_phy_dev_attach(dev, MIIF_NOISOLATE | MIIF_NOMANPAUSE,
-   smcphy_funcs, 1);
+   ma = device_get_ivars(dev);
+   if (MII_MODEL(ma-mii_id2) == MII_MODEL_SEEQ_80220)
+   mpf = smcphy80220_funcs;
+   else
+   mpf = smcphy_funcs;
+   mii_phy_dev_attach(dev, MIIF_NOISOLATE | MIIF_NOMANPAUSE, mpf, 1);
mii_phy_setmedia(sc);
 
return (0);
@@ -214,3 +227,46 @@ smcphy_auto(struct mii_softc *sc, int me
anar = PHY_READ(sc, MII_ANAR);
PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
 }
+
+static void
+smcphy_status(struct mii_softc *sc)
+{
+   struct mii_data *mii;
+   uint32_t bmcr, bmsr, status;
+
+   mii = sc-mii_pdata;
+   mii-mii_media_status = IFM_AVALID;
+   mii-mii_media_active = IFM_ETHER;
+
+   bmsr = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR);
+   if ((bmsr  BMSR_LINK) != 0)
+   mii-mii_media_status |= IFM_ACTIVE;
+
+   bmcr = PHY_READ(sc, MII_BMCR);
+   if ((bmcr  BMCR_ISO) != 0) {
+   mii-mii_media_active |= IFM_NONE;
+   mii-mii_media_status = 0;
+   return;
+   }
+
+   if ((bmcr  BMCR_LOOP) != 0)
+   mii-mii_media_active |= IFM_LOOP;
+
+   if ((bmcr  BMCR_AUTOEN) != 0) {
+   if ((bmsr  BMSR_ACOMP) == 0) {
+   /* Erg, still trying, I guess... */
+   mii-mii_media_active |= IFM_NONE;
+   return;
+   }
+   }
+
+   status = PHY_READ(sc, 0x12);
+   if (status  0x0080)
+   mii-mii_media_active |= IFM_100_TX;
+   else
+   mii-mii_media_active |= IFM_10_T;
+   if (status  0x0040)
+   mii-mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc);
+   else
+   mii-mii_media_active |= IFM_HDX;
+}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r232016 - head/sys/modules/mii

2012-02-22 Thread Pyun YongHyeon
Author: yongari
Date: Thu Feb 23 01:22:40 2012
New Revision: 232016
URL: http://svn.freebsd.org/changeset/base/232016

Log:
  Connect smcphy(4) to mii module build.

Modified:
  head/sys/modules/mii/Makefile

Modified: head/sys/modules/mii/Makefile
==
--- head/sys/modules/mii/Makefile   Thu Feb 23 01:20:21 2012
(r232015)
+++ head/sys/modules/mii/Makefile   Thu Feb 23 01:22:40 2012
(r232016)
@@ -8,7 +8,7 @@ SRCS+=  ciphy.c device_if.h
 SRCS+= e1000phy.c gentbi.c icsphy.c ip1000phy.c jmphy.c lxtphy.c
 SRCS+= miibus_if.c miibus_if.h mii.c miidevs.h mii_bitbang.c mii_physubr.c
 SRCS+= mlphy.c nsgphy.c nsphy.c nsphyter.c pci_if.h pnaphy.c qsphy.c
-SRCS+= rdcphy.c rgephy.c rlphy.c tdkphy.c tlphy.c truephy.c
+SRCS+= rdcphy.c rgephy.c rlphy.c smcphy.c tdkphy.c tlphy.c truephy.c
 SRCS+= ukphy.c ukphy_subr.c
 SRCS+= xmphy.c
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r232019 - head/sys/dev/sf

2012-02-22 Thread Pyun YongHyeon
Author: yongari
Date: Thu Feb 23 05:10:00 2012
New Revision: 232019
URL: http://svn.freebsd.org/changeset/base/232019

Log:
  Give hardware chance to drain active DMA cycles.

Modified:
  head/sys/dev/sf/if_sf.c

Modified: head/sys/dev/sf/if_sf.c
==
--- head/sys/dev/sf/if_sf.c Thu Feb 23 04:32:41 2012(r232018)
+++ head/sys/dev/sf/if_sf.c Thu Feb 23 05:10:00 2012(r232019)
@@ -2329,6 +2329,9 @@ sf_stop(struct sf_softc *sc)
/* Disable Tx/Rx egine. */
csr_write_4(sc, SF_GEN_ETH_CTL, 0);
 
+   /* Give hardware chance to drain active DMA cycles. */
+   DELAY(1000);
+
csr_write_4(sc, SF_CQ_CONSIDX, 0);
csr_write_4(sc, SF_CQ_PRODIDX, 0);
csr_write_4(sc, SF_RXDQ_ADDR_Q1, 0);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r232027 - head/sys/dev/sf

2012-02-22 Thread Pyun YongHyeon
Author: yongari
Date: Thu Feb 23 05:25:14 2012
New Revision: 232027
URL: http://svn.freebsd.org/changeset/base/232027

Log:
  No need to reprogram hardware RX filter when driver is not running.

Modified:
  head/sys/dev/sf/if_sf.c

Modified: head/sys/dev/sf/if_sf.c
==
--- head/sys/dev/sf/if_sf.c Thu Feb 23 05:23:42 2012(r232026)
+++ head/sys/dev/sf/if_sf.c Thu Feb 23 05:25:14 2012(r232027)
@@ -600,7 +600,8 @@ sf_ioctl(struct ifnet *ifp, u_long comma
case SIOCADDMULTI:
case SIOCDELMULTI:
SF_LOCK(sc);
-   sf_rxfilter(sc);
+   if ((ifp-if_drv_flags  IFF_DRV_RUNNING) != 0)
+   sf_rxfilter(sc);
SF_UNLOCK(sc);
break;
case SIOCGIFMEDIA:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r232029 - head/sys/dev/sf

2012-02-22 Thread Pyun YongHyeon
Author: yongari
Date: Thu Feb 23 06:13:12 2012
New Revision: 232029
URL: http://svn.freebsd.org/changeset/base/232029

Log:
  Remove taskqueue based MII stat change handler.
  Driver does not need deferred link state change processing.
  While I'm here, do not report current link status if interface is
  not UP.

Modified:
  head/sys/dev/sf/if_sf.c
  head/sys/dev/sf/if_sfreg.h

Modified: head/sys/dev/sf/if_sf.c
==
--- head/sys/dev/sf/if_sf.c Thu Feb 23 05:36:49 2012(r232028)
+++ head/sys/dev/sf/if_sf.c Thu Feb 23 06:13:12 2012(r232029)
@@ -96,7 +96,6 @@ __FBSDID($FreeBSD$);
 #include sys/socket.h
 #include sys/sockio.h
 #include sys/sysctl.h
-#include sys/taskqueue.h
 
 #include net/bpf.h
 #include net/if.h
@@ -192,7 +191,6 @@ static uint8_t sf_read_eeprom(struct sf_
 static int sf_miibus_readreg(device_t, int, int);
 static int sf_miibus_writereg(device_t, int, int, int);
 static void sf_miibus_statchg(device_t);
-static void sf_link_task(void *, int);
 #ifdef DEVICE_POLLING
 static int sf_poll(struct ifnet *ifp, enum poll_cmd cmd, int count);
 #endif
@@ -394,30 +392,16 @@ static void
 sf_miibus_statchg(device_t dev)
 {
struct sf_softc *sc;
-
-   sc = device_get_softc(dev);
-   taskqueue_enqueue(taskqueue_swi, sc-sf_link_task);
-}
-
-static void
-sf_link_task(void *arg, int pending)
-{
-   struct sf_softc *sc;
struct mii_data *mii;
struct ifnet*ifp;
uint32_tval;
 
-   sc = (struct sf_softc *)arg;
-
-   SF_LOCK(sc);
-
+   sc = device_get_softc(dev);
mii = device_get_softc(sc-sf_miibus);
ifp = sc-sf_ifp;
if (mii == NULL || ifp == NULL ||
-   (ifp-if_drv_flags  IFF_DRV_RUNNING) == 0) {
-   SF_UNLOCK(sc);
+   (ifp-if_drv_flags  IFF_DRV_RUNNING) == 0)
return;
-   }
 
if (mii-mii_media_status  IFM_ACTIVE) {
if (IFM_SUBTYPE(mii-mii_media_active) != IFM_NONE)
@@ -454,8 +438,6 @@ sf_link_task(void *arg, int pending)
else
val = ~SF_TIMER_TIMES_TEN;
csr_write_4(sc, SF_TIMER_CTL, val);
-
-   SF_UNLOCK(sc);
 }
 
 static void
@@ -558,8 +540,12 @@ sf_ifmedia_sts(struct ifnet *ifp, struct
 
sc = ifp-if_softc;
SF_LOCK(sc);
-   mii = device_get_softc(sc-sf_miibus);
+   if ((ifp-if_flags  IFF_UP) == 0) {
+   SF_UNLOCK(sc);
+   return;
+   }
 
+   mii = device_get_softc(sc-sf_miibus);
mii_pollstat(mii);
ifmr-ifm_active = mii-mii_media_active;
ifmr-ifm_status = mii-mii_media_status;
@@ -753,7 +739,6 @@ sf_attach(device_t dev)
mtx_init(sc-sf_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
MTX_DEF);
callout_init_mtx(sc-sf_co, sc-sf_mtx, 0);
-   TASK_INIT(sc-sf_link_task, 0, sf_link_task, sc);
 
/*
 * Map control/status registers.
@@ -955,7 +940,6 @@ sf_detach(device_t dev)
sf_stop(sc);
SF_UNLOCK(sc);
callout_drain(sc-sf_co);
-   taskqueue_drain(taskqueue_swi, sc-sf_link_task);
if (ifp != NULL)
ether_ifdetach(ifp);
}

Modified: head/sys/dev/sf/if_sfreg.h
==
--- head/sys/dev/sf/if_sfreg.h  Thu Feb 23 05:36:49 2012(r232028)
+++ head/sys/dev/sf/if_sfreg.h  Thu Feb 23 06:13:12 2012(r232029)
@@ -1083,7 +1083,6 @@ struct sf_softc {
int sf_if_flags;
struct callout  sf_co;
int sf_watchdog_timer;
-   struct task sf_link_task;
int sf_link;
int sf_suspended;
int sf_detach;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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


svn commit: r232031 - head/sys/dev/sf

2012-02-22 Thread Pyun YongHyeon
Author: yongari
Date: Thu Feb 23 06:35:18 2012
New Revision: 232031
URL: http://svn.freebsd.org/changeset/base/232031

Log:
  With r232015, sf(4) gets correct speed/duplex of established link.
  Add more strict speed check in sf_miibus_statchg() and do not touch
  MAC config registers when driver lost a link.

Modified:
  head/sys/dev/sf/if_sf.c

Modified: head/sys/dev/sf/if_sf.c
==
--- head/sys/dev/sf/if_sf.c Thu Feb 23 06:26:16 2012(r232030)
+++ head/sys/dev/sf/if_sf.c Thu Feb 23 06:35:18 2012(r232031)
@@ -403,11 +403,19 @@ sf_miibus_statchg(device_t dev)
(ifp-if_drv_flags  IFF_DRV_RUNNING) == 0)
return;
 
-   if (mii-mii_media_status  IFM_ACTIVE) {
-   if (IFM_SUBTYPE(mii-mii_media_active) != IFM_NONE)
+   sc-sf_link = 0;
+   if ((mii-mii_media_status  (IFM_ACTIVE | IFM_AVALID)) ==
+   (IFM_ACTIVE | IFM_AVALID)) {
+   switch (IFM_SUBTYPE(mii-mii_media_active)) {
+   case IFM_10_T:
+   case IFM_100_TX:
+   case IFM_100_FX:
sc-sf_link = 1;
-   } else
-   sc-sf_link = 0;
+   break;
+   }
+   }
+   if (sc-sf_link == 0)
+   return;
 
val = csr_read_4(sc, SF_MACCFG_1);
val = ~SF_MACCFG1_FULLDUPLEX;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r232039 - head/sys/dev/sound/usb

2012-02-22 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Feb 23 07:56:19 2012
New Revision: 232039
URL: http://svn.freebsd.org/changeset/base/232039

Log:
  Avoid creating PCM devices for MIDI adapters.
  
  MFC after:3 days

Modified:
  head/sys/dev/sound/usb/uaudio.c

Modified: head/sys/dev/sound/usb/uaudio.c
==
--- head/sys/dev/sound/usb/uaudio.c Thu Feb 23 07:34:53 2012
(r232038)
+++ head/sys/dev/sound/usb/uaudio.c Thu Feb 23 07:56:19 2012
(r232039)
@@ -626,21 +626,21 @@ uaudio_attach(device_t dev)
sc-sc_mixer_count);
 
if (sc-sc_play_chan.valid) {
-   device_printf(dev, Play: %d Hz, %d ch, %s format\n,
+   device_printf(dev, Play: %d Hz, %d ch, %s format.\n,
sc-sc_play_chan.sample_rate,
sc-sc_play_chan.p_asf1d-bNrChannels,
sc-sc_play_chan.p_fmt-description);
} else {
-   device_printf(dev, No playback!\n);
+   device_printf(dev, No playback.\n);
}
 
if (sc-sc_rec_chan.valid) {
-   device_printf(dev, Record: %d Hz, %d ch, %s format\n,
+   device_printf(dev, Record: %d Hz, %d ch, %s format.\n,
sc-sc_rec_chan.sample_rate,
sc-sc_rec_chan.p_asf1d-bNrChannels,
sc-sc_rec_chan.p_fmt-description);
} else {
-   device_printf(dev, No recording!\n);
+   device_printf(dev, No recording.\n);
}
 
if (sc-sc_midi_chan.valid) {
@@ -648,9 +648,9 @@ uaudio_attach(device_t dev)
if (umidi_probe(dev)) {
goto detach;
}
-   device_printf(dev, MIDI sequencer\n);
+   device_printf(dev, MIDI sequencer.\n);
} else {
-   device_printf(dev, No midi sequencer\n);
+   device_printf(dev, No midi sequencer.\n);
}
 
DPRINTF(doing child attach\n);
@@ -659,13 +659,21 @@ uaudio_attach(device_t dev)
 
sc-sc_sndcard_func.func = SCF_PCM;
 
-   child = device_add_child(dev, pcm, -1);
+   /*
+* Only attach a PCM device if we have a playback, recording
+* or mixer device present:
+*/
+   if (sc-sc_play_chan.valid ||
+   sc-sc_rec_chan.valid ||
+   sc-sc_mix_info) {
+   child = device_add_child(dev, pcm, -1);
 
-   if (child == NULL) {
-   DPRINTF(out of memory\n);
-   goto detach;
+   if (child == NULL) {
+   DPRINTF(out of memory\n);
+   goto detach;
+   }
+   device_set_ivars(child, sc-sc_sndcard_func);
}
-   device_set_ivars(child, sc-sc_sndcard_func);
 
if (bus_generic_attach(dev)) {
DPRINTF(child attach failed\n);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org