Re: svn commit: r272673 - in head: include lib/libc/string sys/conf sys/libkern sys/sys

2014-10-07 Thread Dag-Erling Smørgrav
Xin LI  writes:
> Log:
>   Add explicit_bzero(3) and its kernel counterpart.

I would much prefer that we add memset_s(3) from C11, which predates
explicit_bzero(3) by either three or five years (depending on whether
you count from the publication date or the proposal date).  In the
longer term, we should also consider adding the rest of annex K.

Here's a patch for NetBSD (which was never accepted):

https://mail-index.netbsd.org/tech-userlevel/2012/02/24/msg006125.html

I realize that these extensions are controversial, but I still believe
that having them is better than not having them.  As the WG points out,
the intention with gets_s(3) and scanf_s(3) is not to encourage the use
of those interfaces, but to make it easier to retrofit code that uses
gets(3) and scanf(3).

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r272683 - in head/sys/ofed: drivers/net/mlx4 include/linux/mlx4

2014-10-07 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Oct  7 10:04:25 2014
New Revision: 272683
URL: https://svnweb.freebsd.org/changeset/base/272683

Log:
  Fix compile warning when compiling with GCC.
  
  MFC after:3 days
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/ofed/drivers/net/mlx4/mlx4.h
  head/sys/ofed/include/linux/mlx4/device.h

Modified: head/sys/ofed/drivers/net/mlx4/mlx4.h
==
--- head/sys/ofed/drivers/net/mlx4/mlx4.h   Tue Oct  7 08:23:37 2014
(r272682)
+++ head/sys/ofed/drivers/net/mlx4/mlx4.h   Tue Oct  7 10:04:25 2014
(r272683)
@@ -1234,6 +1234,7 @@ int mlx4_trans_to_dmfs_attach(struct mlx
  u8 gid[16], u8 port,
  int block_mcast_loopback,
  enum mlx4_protocol prot, u64 *reg_id);
+int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port, u64 mac, u64 clear, u8 
mode);
 int mlx4_SET_MCAST_FLTR_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_vhcr *vhcr,
struct mlx4_cmd_mailbox *inbox,

Modified: head/sys/ofed/include/linux/mlx4/device.h
==
--- head/sys/ofed/include/linux/mlx4/device.h   Tue Oct  7 08:23:37 2014
(r272682)
+++ head/sys/ofed/include/linux/mlx4/device.h   Tue Oct  7 10:04:25 2014
(r272683)
@@ -1208,7 +1208,6 @@ int mlx4_multicast_promisc_add(struct ml
 int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port);
 int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port);
 int mlx4_unicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port);
-int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port, u64 mac, u64 clear, u8 
mode);
 
 int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac);
 void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac);
___
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: r272695 - head/sys/net

2014-10-07 Thread Andrey V. Elsukov
Author: ae
Date: Tue Oct  7 13:31:04 2014
New Revision: 272695
URL: https://svnweb.freebsd.org/changeset/base/272695

Log:
  Our packet filters use mbuf's rcvif pointer to determine incoming interface.
  Change mbuf's rcvif to enc0 and restore it after pfil processing.
  
  PR:   110959
  Sponsored by: Yandex LLC

Modified:
  head/sys/net/if_enc.c

Modified: head/sys/net/if_enc.c
==
--- head/sys/net/if_enc.c   Tue Oct  7 13:30:42 2014(r272694)
+++ head/sys/net/if_enc.c   Tue Oct  7 13:31:04 2014(r272695)
@@ -230,6 +230,7 @@ ipsec_filter(struct mbuf **mp, int dir, 
 {
int error, i;
struct ip *ip;
+   struct ifnet *rcvif;
 
KASSERT(encif != NULL, ("%s: encif is null", __func__));
KASSERT(flags & (ENC_IN|ENC_OUT),
@@ -268,6 +269,8 @@ ipsec_filter(struct mbuf **mp, int dir, 
}
 
error = 0;
+   rcvif = (*mp)->m_pkthdr.rcvif;
+   (*mp)->m_pkthdr.rcvif = encif;
ip = mtod(*mp, struct ip *);
switch (ip->ip_v) {
 #ifdef INET
@@ -298,6 +301,7 @@ ipsec_filter(struct mbuf **mp, int dir, 
if (error != 0)
goto bad;
 
+   (*mp)->m_pkthdr.rcvif = rcvif;
return (error);
 
 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"


Re: svn commit: r272695 - head/sys/net

2014-10-07 Thread Marko Zec
On Tue, 7 Oct 2014 13:31:05 +
"Andrey V. Elsukov"  wrote:

> Author: ae
> Date: Tue Oct  7 13:31:04 2014
> New Revision: 272695
> URL: https://svnweb.freebsd.org/changeset/base/272695
> 
> Log:
>   Our packet filters use mbuf's rcvif pointer to determine incoming
> interface. Change mbuf's rcvif to enc0 and restore it after pfil
> processing.

Will this work / was this tested with options VIMAGE, where
m_pkthdr.rcvif->if_vnet will no longer match curvnet, except in vnet0?

Marko



>   PR: 110959
>   Sponsored by:   Yandex LLC
> 
> Modified:
>   head/sys/net/if_enc.c
> 
> Modified: head/sys/net/if_enc.c
> ==
> --- head/sys/net/if_enc.c Tue Oct  7 13:30:42 2014
> (r272694) +++ head/sys/net/if_enc.c   Tue Oct  7 13:31:04
> 2014  (r272695) @@ -230,6 +230,7 @@ ipsec_filter(struct mbuf
> **mp, int dir, {
>   int error, i;
>   struct ip *ip;
> + struct ifnet *rcvif;
>  
>   KASSERT(encif != NULL, ("%s: encif is null", __func__));
>   KASSERT(flags & (ENC_IN|ENC_OUT),
> @@ -268,6 +269,8 @@ ipsec_filter(struct mbuf **mp, int dir, 
>   }
>  
>   error = 0;
> + rcvif = (*mp)->m_pkthdr.rcvif;
> + (*mp)->m_pkthdr.rcvif = encif;
>   ip = mtod(*mp, struct ip *);
>   switch (ip->ip_v) {
>  #ifdef INET
> @@ -298,6 +301,7 @@ ipsec_filter(struct mbuf **mp, int dir, 
>   if (error != 0)
>   goto bad;
>  
> + (*mp)->m_pkthdr.rcvif = rcvif;
>   return (error);
>  
>  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: r272701 - head/sys/cddl/compat/opensolaris/sys

2014-10-07 Thread Andriy Gapon
Author: avg
Date: Tue Oct  7 14:15:50 2014
New Revision: 272701
URL: https://svnweb.freebsd.org/changeset/base/272701

Log:
  make userland __assfail from opensolaris compat honor 'aok' variable
  
  This should allow zdb -A option to actually make difference.
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/compat/opensolaris/sys/assfail.h

Modified: head/sys/cddl/compat/opensolaris/sys/assfail.h
==
--- head/sys/cddl/compat/opensolaris/sys/assfail.h  Tue Oct  7 14:09:05 
2014(r272700)
+++ head/sys/cddl/compat/opensolaris/sys/assfail.h  Tue Oct  7 14:15:50 
2014(r272701)
@@ -46,20 +46,24 @@ void assfail3(const char *, uintmax_t, c
 #else  /* !defined(_KERNEL) */
 
 #ifndef HAVE_ASSFAIL
+extern int aok;
+
 static __inline int
 __assfail(const char *expr, const char *file, int line)
 {
 
(void)fprintf(stderr, "Assertion failed: (%s), file %s, line %d.\n",
expr, file, line);
-   abort();
-   /* NOTREACHED */
+   if (!aok)
+   abort();
return (0);
 }
 #define assfail __assfail
 #endif
 
 #ifndef HAVE_ASSFAIL3
+extern int aok;
+
 static __inline void
 __assfail3(const char *expr, uintmax_t lv, const char *op, uintmax_t rv,
 const char *file, int line) {
@@ -67,8 +71,8 @@ __assfail3(const char *expr, uintmax_t l
(void)fprintf(stderr,
"Assertion failed: %s (0x%jx %s 0x%jx), file %s, line %d.\n",
expr, lv, op, rv, file, line);
-abort();
-/* NOTREACHED */
+   if (!aok)
+   abort();
 }
 #define assfail3 __assfail3
 #endif
___
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: r272695 - head/sys/net

2014-10-07 Thread Andrey V. Elsukov
On 07.10.2014 18:04, Marko Zec wrote:
> On Tue, 7 Oct 2014 13:31:05 +
> "Andrey V. Elsukov"  wrote:
> 
>> Author: ae
>> Date: Tue Oct  7 13:31:04 2014
>> New Revision: 272695
>> URL: https://svnweb.freebsd.org/changeset/base/272695
>>
>> Log:
>>   Our packet filters use mbuf's rcvif pointer to determine incoming
>> interface. Change mbuf's rcvif to enc0 and restore it after pfil
>> processing.
> 
> Will this work / was this tested with options VIMAGE, where
> m_pkthdr.rcvif->if_vnet will no longer match curvnet, except in vnet0?

I tested only without VIMAGE. ipfw and pf use if_xname field to compare
interfaces. So will this work?

-- 
WBR, Andrey V. Elsukov
___
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: r272702 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-10-07 Thread Andriy Gapon
Author: avg
Date: Tue Oct  7 14:30:24 2014
New Revision: 272702
URL: https://svnweb.freebsd.org/changeset/base/272702

Log:
  reduce L2ARC_WRITE_SIZE on FreeBSD
  
  FreeBSD has ARC_BUFC_NUMMETADATALISTS metadata lists and ARC_BUFC_NUMDATALISTS
  data lists (currently both are 16) while illumos has just a single list
  of each kind.
  
  L2ARC_WRITE_SIZE determines the default value of l2arc_write_max which
  defines limits on how much data is scanned and written to a cache device
  during each run of the l2arc feed thread.  The limits are applied on the
  per buffer list basis.
  Because FreeBSD has more lists we proportionally reduce the limits.
  
  Reviewed by:  Brendan Gregg (earlier version)
  MFC after:2 weeks
  Sponsored by: HybridCluster

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Tue Oct  7 
14:15:50 2014(r272701)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Tue Oct  7 
14:30:24 2014(r272702)
@@ -711,7 +711,9 @@ uint64_t zfs_crc64_table[256];
  * Level 2 ARC
  */
 
-#defineL2ARC_WRITE_SIZE(8 * 1024 * 1024)   /* initial 
write max */
+/* initial write max */
+#defineL2ARC_WRITE_SIZE\
+(8 * 1024 * 1024 * 2 / (ARC_BUFC_NUMMETADATALISTS + ARC_BUFC_NUMDATALISTS))
 #defineL2ARC_HEADROOM  2   /* num of 
writes */
 /*
  * If we discover during ARC scan any buffers to be compressed, we boost
___
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: r272695 - head/sys/net

2014-10-07 Thread Marko Zec
On Tue, 7 Oct 2014 18:17:18 +0400
"Andrey V. Elsukov"  wrote:

> On 07.10.2014 18:04, Marko Zec wrote:
> > On Tue, 7 Oct 2014 13:31:05 +
> > "Andrey V. Elsukov"  wrote:
> > 
> >> Author: ae
> >> Date: Tue Oct  7 13:31:04 2014
> >> New Revision: 272695
> >> URL: https://svnweb.freebsd.org/changeset/base/272695
> >>
> >> Log:
> >>   Our packet filters use mbuf's rcvif pointer to determine incoming
> >> interface. Change mbuf's rcvif to enc0 and restore it after pfil
> >> processing.
> > 
> > Will this work / was this tested with options VIMAGE, where
> > m_pkthdr.rcvif->if_vnet will no longer match curvnet, except in
> > vnet0?
> 
> I tested only without VIMAGE. ipfw and pf use if_xname field to
> compare interfaces. So will this work?

I have no idea whether this would work now, but this change implies that
no pfil consumer should reference m_pkthdr.rcvif->if_vnet from now on,
ever.  Which doesn't seem right to me.

If changing m_pkthdr.rcvif to enc0 in ipsec_filter() is really
unavoidable, perhaps we could introduce enc0 for each vnet, maybe in a
similar manner how hrs@ virtualized gif (271917) and gre (271918)
cloners, which (gif) apparently seem to be at the root of the PR 110959
referenced here.

Marko
___
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: r272706 - head/sys/netinet6

2014-10-07 Thread Michael Tuexen
Author: tuexen
Date: Tue Oct  7 16:01:17 2014
New Revision: 272706
URL: https://svnweb.freebsd.org/changeset/base/272706

Log:
  Fix a bug introduced in
  https://svnweb.freebsd.org/base?view=revision&revision=272347
  
  MFC after: 3 days

Modified:
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet6/udp6_usrreq.c
==
--- head/sys/netinet6/udp6_usrreq.c Tue Oct  7 15:21:20 2014
(r272705)
+++ head/sys/netinet6/udp6_usrreq.c Tue Oct  7 16:01:17 2014
(r272706)
@@ -265,7 +265,7 @@ udp6_input(struct mbuf **mp, int *offp, 
 
if (uh_sum != 0) {
UDPSTAT_INC(udps_badsum);
-   /*goto badunlocked;*/
+   goto badunlocked;
}
 
/*
___
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: r272707 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-10-07 Thread Andriy Gapon
Author: avg
Date: Tue Oct  7 16:06:10 2014
New Revision: 272707
URL: https://svnweb.freebsd.org/changeset/base/272707

Log:
  revert r272702: wrong (earlier) change was committed

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Tue Oct  7 
16:01:17 2014(r272706)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Tue Oct  7 
16:06:10 2014(r272707)
@@ -711,9 +711,7 @@ uint64_t zfs_crc64_table[256];
  * Level 2 ARC
  */
 
-/* initial write max */
-#defineL2ARC_WRITE_SIZE\
-(8 * 1024 * 1024 * 2 / (ARC_BUFC_NUMMETADATALISTS + ARC_BUFC_NUMDATALISTS))
+#defineL2ARC_WRITE_SIZE(8 * 1024 * 1024)   /* initial 
write max */
 #defineL2ARC_HEADROOM  2   /* num of 
writes */
 /*
  * If we discover during ARC scan any buffers to be compressed, we boost
___
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: r272708 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-10-07 Thread Andriy Gapon
Author: avg
Date: Tue Oct  7 16:08:21 2014
New Revision: 272708
URL: https://svnweb.freebsd.org/changeset/base/272708

Log:
  l2arc_write_buffers: reduce headroom value
  
  FreeBSD has ARC_BUFC_NUMMETADATALISTS metadata lists and ARC_BUFC_NUMDATALISTS
  data lists (currently both are 16) while illumos has just a single list
  of each kind.
  
  headroom determines how much data is scanned on a single list
  during each run of the l2arc feed thread.
  Because FreeBSD has more lists we proportionally decrease the limit.
  
  Reviewed by:  Brendan Gregg (earlier version)
  MFC after:2 weeks
  Sponsored by: HybridCluster

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Tue Oct  7 
16:06:10 2014(r272707)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Tue Oct  7 
16:08:21 2014(r272708)
@@ -5047,7 +5047,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de
if (ab == NULL)
ARCSTAT_BUMP(arcstat_l2_write_buffer_list_null_iter);
 
-   headroom = target_sz * l2arc_headroom;
+   headroom = target_sz * l2arc_headroom * 2 / ARC_BUFC_NUMLISTS;
if (do_headroom_boost)
headroom = (headroom * l2arc_headroom_boost) / 100;
 
___
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: r272596 - head/sys/fs/devfs

2014-10-07 Thread John Baldwin
On Monday, October 06, 2014 8:52:37 pm Mateusz Guzik wrote:
> On Mon, Oct 06, 2014 at 11:37:32AM -0400, John Baldwin wrote:
> > On Monday, October 06, 2014 06:20:36 AM Mateusz Guzik wrote:
> > > Author: mjg
> > > Date: Mon Oct  6 06:20:35 2014
> > > New Revision: 272596
> > > URL: https://svnweb.freebsd.org/changeset/base/272596
> > > 
> > > Log:
> > >   devfs: don't take proctree_lock unconditionally in devfs_close
> > > 
> > >   MFC after:  1 week
> > 
> > Just for my sanity:
> > 
> > What keeps td->td_proc->p_session static in this case so that it is safe to 
> > dereference it?  Specifically, if you are preempted after reading p_session 
> > but before you then read s_ttyvp, what prevents a race with another thread 
> > changing the session of td->td_proc?
> > 
> 
> Right, it's buggy.
> 
> Turns out devfs was quite liberal in relation to that even prior to my
> change.
> 
> How about:
> 
> diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
> index d7009a4..a480e4f 100644
> --- a/sys/fs/devfs/devfs_vnops.c
> +++ b/sys/fs/devfs/devfs_vnops.c
> @@ -499,6 +499,7 @@ devfs_access(struct vop_access_args *ap)
>  {
>   struct vnode *vp = ap->a_vp;
>   struct devfs_dirent *de;
> + struct proc *p;
>   int error;
>  
>   de = vp->v_data;
> @@ -511,11 +512,14 @@ devfs_access(struct vop_access_args *ap)
>   return (0);
>   if (error != EACCES)
>   return (error);
> + p = ap->a_td->td_proc;
>   /* We do, however, allow access to the controlling terminal */
> - if (!(ap->a_td->td_proc->p_flag & P_CONTROLT))
> + if (!(p->p_flag & P_CONTROLT))
>   return (error);
> - if (ap->a_td->td_proc->p_session->s_ttydp == de->de_cdp)
> - return (0);
> + PROC_LOCK(p);
> + if (p->p_session->s_ttydp == de->de_cdp)
> + error = 0;
> + PROC_UNLOCK(p);
>   return (error);
>  }
>  
> @@ -525,6 +529,7 @@ devfs_close(struct vop_close_args *ap)
>  {
>   struct vnode *vp = ap->a_vp, *oldvp;
>   struct thread *td = ap->a_td;
> + struct proc *p;
>   struct cdev *dev = vp->v_rdev;
>   struct cdevsw *dsw;
>   int vp_locked, error, ref;
> @@ -545,24 +550,30 @@ devfs_close(struct vop_close_args *ap)
>* if the reference count is 2 (this last descriptor
>* plus the session), release the reference from the session.
>*/
> - if (td && vp == td->td_proc->p_session->s_ttyvp) {
> - oldvp = NULL;
> - sx_xlock(&proctree_lock);
> - if (vp == td->td_proc->p_session->s_ttyvp) {
> - SESS_LOCK(td->td_proc->p_session);
> - VI_LOCK(vp);
> - if (count_dev(dev) == 2 &&
> - (vp->v_iflag & VI_DOOMED) == 0) {
> - td->td_proc->p_session->s_ttyvp = NULL;
> - td->td_proc->p_session->s_ttydp = NULL;
> - oldvp = vp;
> + if (td != NULL) {
> + p = td->td_proc;
> + PROC_LOCK(p);
> + if (vp == p->p_session->s_ttyvp) {
> + PROC_UNLOCK(p);
> + oldvp = NULL;
> + sx_xlock(&proctree_lock);
> + if (vp == p->p_session->s_ttyvp) {
> + SESS_LOCK(p->p_session);
> + VI_LOCK(vp);
> + if (count_dev(dev) == 2 &&
> + (vp->v_iflag & VI_DOOMED) == 0) {
> + p->p_session->s_ttyvp = NULL;
> + p->p_session->s_ttydp = NULL;
> + oldvp = vp;
> + }
> + VI_UNLOCK(vp);
> + SESS_UNLOCK(p->p_session);
>   }
> - VI_UNLOCK(vp);
> - SESS_UNLOCK(td->td_proc->p_session);
> - }
> - sx_xunlock(&proctree_lock);
> - if (oldvp != NULL)
> - vrele(oldvp);
> + sx_xunlock(&proctree_lock);
> + if (oldvp != NULL)
> + vrele(oldvp);
> + } else
> + PROC_UNLOCK(p);
>   }
>   /*
>* We do not want to really close the device if it
> @@ -814,6 +825,7 @@ devfs_prison_check(struct devfs_dirent *de, struct thread 
> *td)
>  {
>   struct cdev_priv *cdp;
>   struct ucred *dcr;
> + struct proc *p;
>   int error;
>  
>   cdp = de->de_cdp;
> @@ -827,10 +839,13 @@ devfs_prison_check(struct devfs_dirent *de, struct 
> thread *td)
>   if (error == 0)
>   return (0);
>   /* We do, however, allow access to the controlling terminal */
> - if (!(td->td_proc->p_flag & P_CONTROLT))
> + p = td->td_proc;
> + if (!(p->p_flag & P_CONTROLT))
>   return

Re: svn commit: r272281 - head/lib/libpam/modules/pam_login_access

2014-10-07 Thread Dag-Erling Smørgrav
Dimitry Andric  writes:
> And why is 'user' not a char * to begin with? :)

man 3 pam_get_item + C rules about casting pointers.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r272281 - head/lib/libpam/modules/pam_login_access

2014-10-07 Thread Dag-Erling Smørgrav
Bruce Evans  writes:
> Other bugs in PAM_VERBOSE_ERROR()'s function [...]

PAM_VERBOSE_ERROR should die.  The only reason I didn't kill it way back
when was to avoid extensive modifications to existing modules.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r272710 - head/usr.sbin/bhyve

2014-10-07 Thread Neel Natu
Author: neel
Date: Tue Oct  7 17:08:53 2014
New Revision: 272710
URL: https://svnweb.freebsd.org/changeset/base/272710

Log:
  Implement the FLUSH operation in the virtio-block emulation.
  
  This gets rid of the following error message during FreeBSD guest bootup:
  "vtbd0: hard error cmd=flush fsbn 0"
  
  Reported by:  rodrigc
  Reviewed by:  grehan

Modified:
  head/usr.sbin/bhyve/pci_virtio_block.c

Modified: head/usr.sbin/bhyve/pci_virtio_block.c
==
--- head/usr.sbin/bhyve/pci_virtio_block.c  Tue Oct  7 16:46:11 2014
(r272709)
+++ head/usr.sbin/bhyve/pci_virtio_block.c  Tue Oct  7 17:08:53 2014
(r272710)
@@ -94,6 +94,8 @@ struct vtblk_config {
 struct virtio_blk_hdr {
 #defineVBH_OP_READ 0
 #defineVBH_OP_WRITE1
+#defineVBH_OP_FLUSH4
+#defineVBH_OP_FLUSH_OUT5
 #defineVBH_OP_IDENT8   
 #defineVBH_FLAG_BARRIER0x8000  /* OR'ed into vbh_type 
*/
uint32_tvbh_type;
@@ -217,6 +219,10 @@ pci_vtblk_proc(struct pci_vtblk_softc *s
MIN(iov[1].iov_len, sizeof(sc->vbsc_ident)));
err = 0;
break;
+   case VBH_OP_FLUSH:
+   case VBH_OP_FLUSH_OUT:
+   err = fsync(sc->vbsc_fd);
+   break;
default:
err = -ENOSYS;
break;
___
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: r272712 - in head/sys: arm/altera/socfpga arm/conf arm/samsung/exynos boot/fdt/dts/arm dev/mmc dev/mmc/host

2014-10-07 Thread Ruslan Bukin
Author: br
Date: Tue Oct  7 17:39:30 2014
New Revision: 272712
URL: https://svnweb.freebsd.org/changeset/base/272712

Log:
  Add driver for Synopsys DesignWare Mobile Storage Host Controller.
  
  Sponsored by: DARPA, AFRL

Added:
  head/sys/dev/mmc/host/
  head/sys/dev/mmc/host/dwmmc.c   (contents, props changed)
  head/sys/dev/mmc/host/dwmmc.h   (contents, props changed)
Modified:
  head/sys/arm/altera/socfpga/files.socfpga
  head/sys/arm/altera/socfpga/socfpga_machdep.c
  head/sys/arm/conf/EXYNOS5.common
  head/sys/arm/conf/SOCKIT
  head/sys/arm/samsung/exynos/exynos5_machdep.c
  head/sys/arm/samsung/exynos/files.exynos5
  head/sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts
  head/sys/boot/fdt/dts/arm/exynos5420-peach-pit.dts
  head/sys/boot/fdt/dts/arm/exynos5420.dtsi
  head/sys/boot/fdt/dts/arm/socfpga-sockit.dts
  head/sys/boot/fdt/dts/arm/socfpga.dtsi
  head/sys/dev/mmc/mmc.c

Modified: head/sys/arm/altera/socfpga/files.socfpga
==
--- head/sys/arm/altera/socfpga/files.socfpga   Tue Oct  7 17:23:11 2014
(r272711)
+++ head/sys/arm/altera/socfpga/files.socfpga   Tue Oct  7 17:39:30 2014
(r272712)
@@ -19,3 +19,4 @@ arm/altera/socfpga/socfpga_manager.c  st
 arm/altera/socfpga/socfpga_rstmgr.cstandard
 
 dev/dwc/if_dwc.c   optional dwc
+dev/mmc/host/dwmmc.c   optional dwmmc

Modified: head/sys/arm/altera/socfpga/socfpga_machdep.c
==
--- head/sys/arm/altera/socfpga/socfpga_machdep.c   Tue Oct  7 17:23:11 
2014(r272711)
+++ head/sys/arm/altera/socfpga/socfpga_machdep.c   Tue Oct  7 17:39:30 
2014(r272712)
@@ -89,6 +89,9 @@ platform_devmap_init(void)
 */
arm_devmap_add_entry(0xffb0, 0x10);
 
+   /* dwmmc */
+   arm_devmap_add_entry(0xff70, 0x10);
+
return (0);
 }
 

Modified: head/sys/arm/conf/EXYNOS5.common
==
--- head/sys/arm/conf/EXYNOS5.commonTue Oct  7 17:23:11 2014
(r272711)
+++ head/sys/arm/conf/EXYNOS5.commonTue Oct  7 17:39:30 2014
(r272712)
@@ -80,7 +80,7 @@ options   NFS_ROOT# NFS usable as /, re
 
 device mmc # mmc/sd bus
 device mmcsd   # mmc/sd flash cards
-device sdhci   # generic sdhci
+device dwmmc
 
 optionsROOTDEVNAME=\"ufs:/dev/da0\"
 

Modified: head/sys/arm/conf/SOCKIT
==
--- head/sys/arm/conf/SOCKITTue Oct  7 17:23:11 2014(r272711)
+++ head/sys/arm/conf/SOCKITTue Oct  7 17:39:30 2014(r272712)
@@ -82,7 +82,7 @@ options   NFS_ROOT# NFS usable as /, re
 
 device mmc # mmc/sd bus
 device mmcsd   # mmc/sd flash cards
-device sdhci   # generic sdhci
+device dwmmc
 
 optionsROOTDEVNAME=\"ufs:/dev/da0\"
 

Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c
==
--- head/sys/arm/samsung/exynos/exynos5_machdep.c   Tue Oct  7 17:23:11 
2014(r272711)
+++ head/sys/arm/samsung/exynos/exynos5_machdep.c   Tue Oct  7 17:39:30 
2014(r272712)
@@ -78,6 +78,9 @@ platform_devmap_init(void)
/* UART */
arm_devmap_add_entry(0x12C0, 0x10);
 
+   /* DWMMC */
+   arm_devmap_add_entry(0x1220, 0x10);
+
return (0);
 }
 

Modified: head/sys/arm/samsung/exynos/files.exynos5
==
--- head/sys/arm/samsung/exynos/files.exynos5   Tue Oct  7 17:23:11 2014
(r272711)
+++ head/sys/arm/samsung/exynos/files.exynos5   Tue Oct  7 17:39:30 2014
(r272712)
@@ -33,4 +33,4 @@ arm/samsung/exynos/chrome_ec.coptiona
 arm/samsung/exynos/chrome_ec_spi.c optionalchrome_ec_spi
 arm/samsung/exynos/chrome_kb.c optionalchrome_kb
 
-#dev/sdhci/sdhci_fdt.c optionalsdhci
+dev/mmc/host/dwmmc.c   optionaldwmmc

Modified: head/sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts
==
--- head/sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts   Tue Oct  7 
17:23:11 2014(r272711)
+++ head/sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts   Tue Oct  7 
17:39:30 2014(r272712)
@@ -47,8 +47,19 @@
status = "okay";
};
 
-   sdhci@1222 {
-   status = "disabled";
+   mmc2: dwmmc@1222 {
+   

svn commit: r272713 - head/sys/dev/hwpmc

2014-10-07 Thread Bjoern A. Zeeb
Author: bz
Date: Tue Oct  7 18:00:34 2014
New Revision: 272713
URL: https://svnweb.freebsd.org/changeset/base/272713

Log:
  Since introducing the extra mapping in r250103 for architectural performance
  events we have actually counted 'Branch Instruction Retired' when people
  asked for 'Unhalted core cycles' using the 'unhalted-core-cycles' event mask
  mnemonic.
  
  Reviewed by:  jimharris
  Discussed with:   gnn, rwatson
  MFC after:3 days
  Sponsored by: DARPA/AFRL

Modified:
  head/sys/dev/hwpmc/hwpmc_core.c

Modified: head/sys/dev/hwpmc/hwpmc_core.c
==
--- head/sys/dev/hwpmc/hwpmc_core.c Tue Oct  7 17:39:30 2014
(r272712)
+++ head/sys/dev/hwpmc/hwpmc_core.c Tue Oct  7 18:00:34 2014
(r272713)
@@ -1796,7 +1796,7 @@ iap_is_event_architectural(enum pmc_even
switch (pe) {
case PMC_EV_IAP_ARCH_UNH_COR_CYC:
ae = CORE_AE_UNHALTED_CORE_CYCLES;
-   *map = PMC_EV_IAP_EVENT_C4H_00H;
+   *map = PMC_EV_IAP_EVENT_3CH_00H;
break;
case PMC_EV_IAP_ARCH_INS_RET:
ae = CORE_AE_INSTRUCTION_RETIRED;
___
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: r272715 - head/sys/dev/vt

2014-10-07 Thread Aleksandr Rybalko
Author: ray
Date: Tue Oct  7 18:47:53 2014
New Revision: 272715
URL: https://svnweb.freebsd.org/changeset/base/272715

Log:
  Allow vt(4) to disable terminal bell with `sysctl kern.vt.bell_enable=0`,
  similar as syscons(4) do.
  
  Submitted by: Tiwei Bie 
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt_core.c
==
--- head/sys/dev/vt/vt_core.c   Tue Oct  7 18:22:05 2014(r272714)
+++ head/sys/dev/vt/vt_core.c   Tue Oct  7 18:47:53 2014(r272715)
@@ -120,6 +120,7 @@ const struct terminal_class vt_termclass
 
 static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "vt(9) parameters");
 VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as 
Alt)");
+VT_SYSCTL_INT(enable_bell, 1, "Enable bell");
 VT_SYSCTL_INT(debug, 0, "vt(9) debug level");
 VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode");
 VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend");
@@ -904,6 +905,9 @@ vtterm_bell(struct terminal *tm)
struct vt_window *vw = tm->tm_softc;
struct vt_device *vd = vw->vw_device;
 
+   if (!vt_enable_bell)
+   return;
+
if (vd->vd_flags & VDF_QUIET_BELL)
return;
 
@@ -915,6 +919,9 @@ vtterm_beep(struct terminal *tm, u_int p
 {
u_int freq, period;
 
+   if (!vt_enable_bell)
+   return;
+
if ((param == 0) || ((param & 0x) == 0)) {
vtterm_bell(tm);
return;
___
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: r272716 - in head/sys/dev/usb: . net

2014-10-07 Thread Gavin Atkinson
Author: gavin
Date: Tue Oct  7 19:07:50 2014
New Revision: 272716
URL: https://svnweb.freebsd.org/changeset/base/272716

Log:
  Support the Vodafone R215 LET USB dongle, which is apparently a rebadged
  E5372 with different product IDs.
  
  Interestingly, the standard E5372 IDs (12d1:1506) are currently listed in
  u3g.c and are the same as the E3131.  However, the R215/E5372 is an NCM
  device and works well with cdce(4) whereas the E3131 isn't.  More work
  may be needed to better identify the other device IDs.
  
  MFC after:1 week

Modified:
  head/sys/dev/usb/net/if_cdce.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/net/if_cdce.c
==
--- head/sys/dev/usb/net/if_cdce.c  Tue Oct  7 18:47:53 2014
(r272715)
+++ head/sys/dev/usb/net/if_cdce.c  Tue Oct  7 19:07:50 2014
(r272716)
@@ -273,6 +273,7 @@ static const struct usb_ether_methods cd
 
 static const STRUCT_USB_HOST_ID cdce_switch_devs[] = {
{USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E3272_INIT, 
MSC_EJECT_HUAWEI2)},
+   {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_R215_INIT, 
MSC_EJECT_HUAWEI2)},
 };
 
 static const STRUCT_USB_HOST_ID cdce_host_devs[] = {

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsTue Oct  7 18:47:53 2014(r272715)
+++ head/sys/dev/usb/usbdevsTue Oct  7 19:07:50 2014(r272716)
@@ -2353,6 +2353,8 @@ product HUAWEI E3131  0x1506  3G modem
 product HUAWEI K3765_INIT  0x1520  K3765 Initial
 product HUAWEI K4505_INIT  0x1521  K4505 Initial
 product HUAWEI E3272_INIT  0x155b  LTE modem initial
+product HUAWEI R215_INIT   0x1582  LTE modem initial
+product HUAWEI R2150x1588  LTE modem
 product HUAWEI ETS2055 0x1803  CDMA modem
 product HUAWEI E1730x1c05  3G modem
 product HUAWEI E173_INIT   0x1c0b  3G modem initial
___
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: r272717 - head/usr.sbin/autofs

2014-10-07 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Oct  7 19:08:02 2014
New Revision: 272717
URL: https://svnweb.freebsd.org/changeset/base/272717

Log:
  Remove call to access(2) which didn't serve any purpose, and make it more
  tolerant to errors.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/autofs/common.c

Modified: head/usr.sbin/autofs/common.c
==
--- head/usr.sbin/autofs/common.c   Tue Oct  7 19:07:50 2014
(r272716)
+++ head/usr.sbin/autofs/common.c   Tue Oct  7 19:08:02 2014
(r272717)
@@ -169,17 +169,12 @@ create_directory(const char *path)
if (component == NULL)
break;
concat(&partial, &component);
-   //log_debugx("checking \"%s\" for existence", partial);
-   error = access(partial, F_OK);
-   if (error == 0)
-   continue;
-   if (errno != ENOENT)
-   log_err(1, "cannot access %s", partial);
-   log_debugx("directory %s does not exist, creating",
-   partial);
+   //log_debugx("creating \"%s\"", partial);
error = mkdir(partial, 0755);
-   if (error != 0)
-   log_err(1, "cannot create %s", partial);
+   if (error != 0 && errno != EEXIST) {
+   log_warn("cannot create %s", partial);
+   return;
+   }
}
 
free(tofree);
___
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: r272718 - head/sys/kern

2014-10-07 Thread Jung-uk Kim
Author: jkim
Date: Tue Oct  7 20:13:47 2014
New Revision: 272718
URL: https://svnweb.freebsd.org/changeset/base/272718

Log:
  Make kern.nswbuf tunable from loader.
  
  MFC after:1 week

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Tue Oct  7 19:08:02 2014(r272717)
+++ head/sys/kern/vfs_bio.c Tue Oct  7 20:13:47 2014(r272718)
@@ -667,6 +667,10 @@ bd_speedup(void)
mtx_unlock(&bdlock);
 }
 
+#ifndef NSWBUF_MIN
+#defineNSWBUF_MIN  16
+#endif
+
 #ifdef __i386__
 #defineTRANSIENT_DENOM 5
 #else
@@ -778,11 +782,10 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon
 * swbufs are used as temporary holders for I/O, such as paging I/O.
 * We have no less then 16 and no more then 256.
 */
-   nswbuf = max(min(nbuf/4, 256), 16);
-#ifdef NSWBUF_MIN
+   nswbuf = min(nbuf / 4, 256);
+   TUNABLE_INT_FETCH("kern.nswbuf", &nswbuf);
if (nswbuf < NSWBUF_MIN)
nswbuf = NSWBUF_MIN;
-#endif
 
/*
 * Reserve space for the buffer cache buffers
___
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: r272649 - head/contrib/byacc

2014-10-07 Thread Craig Rodrigues
On Mon, Oct 6, 2014 at 7:49 AM, Baptiste Daroussin  wrote:

>
> Why a direct commit instead of a proper import of 20141005 version? it
> would
> have imho been better, simpler and easier to maintain.
>

Because according to Thomas Dickey, he did not fix all
the memory related problems in snapshot 20141005.  Specifically there are
still
some issues not fixed when realloc() is called.
I was going to wait for the next snapshot.
However, I wanted to get that one fix into FreeBSD to fix the kyua tests,
which have been failing under Jenkins.  See:
https://jenkins.freebsd.org/jenkins/job/FreeBSD_HEAD-tests2/
(see runs #10 and #11).

--
Craig
___
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: r272719 - in head/sys/dev/cxgbe: common tom

2014-10-07 Thread Navdeep Parhar
Author: np
Date: Tue Oct  7 21:26:22 2014
New Revision: 272719
URL: https://svnweb.freebsd.org/changeset/base/272719

Log:
  cxgbe/tom: don't leak resources tied to an active open request that
  cannot be sent to the chip because a prerequisite L2 resolution
  failed.
  
  Submitted by: Hariprasad at chelsio dot com (original version)
  MFC after:2 weeks.

Modified:
  head/sys/dev/cxgbe/common/t4_msg.h
  head/sys/dev/cxgbe/tom/t4_connect.c
  head/sys/dev/cxgbe/tom/t4_tom.c
  head/sys/dev/cxgbe/tom/t4_tom.h
  head/sys/dev/cxgbe/tom/t4_tom_l2t.c

Modified: head/sys/dev/cxgbe/common/t4_msg.h
==
--- head/sys/dev/cxgbe/common/t4_msg.h  Tue Oct  7 20:13:47 2014
(r272718)
+++ head/sys/dev/cxgbe/common/t4_msg.h  Tue Oct  7 21:26:22 2014
(r272719)
@@ -273,6 +273,7 @@ union opcode_tid {
 
 /* extract the TID from a CPL command */
 #define GET_TID(cmd) (G_TID(ntohl(OPCODE_TID(cmd
+#define GET_OPCODE(cmd) ((cmd)->ot.opcode)
 
 /* partitioning of TID fields that also carry a queue id */
 #define S_TID_TID0

Modified: head/sys/dev/cxgbe/tom/t4_connect.c
==
--- head/sys/dev/cxgbe/tom/t4_connect.c Tue Oct  7 20:13:47 2014
(r272718)
+++ head/sys/dev/cxgbe/tom/t4_connect.c Tue Oct  7 21:26:22 2014
(r272719)
@@ -115,8 +115,8 @@ do_act_establish(struct sge_iq *iq, cons
 {
struct adapter *sc = iq->adapter;
const struct cpl_act_establish *cpl = (const void *)(rss + 1);
-   unsigned int tid = GET_TID(cpl);
-   unsigned int atid = G_TID_TID(ntohl(cpl->tos_atid));
+   u_int tid = GET_TID(cpl);
+   u_int atid = G_TID_TID(ntohl(cpl->tos_atid));
struct toepcb *toep = lookup_atid(sc, atid);
struct inpcb *inp = toep->inp;
 
@@ -178,17 +178,34 @@ act_open_rpl_status_to_errno(int status)
}
 }
 
+void
+act_open_failure_cleanup(struct adapter *sc, u_int atid, u_int status)
+{
+   struct toepcb *toep = lookup_atid(sc, atid);
+   struct inpcb *inp = toep->inp;
+   struct toedev *tod = &toep->td->tod;
+
+   free_atid(sc, atid);
+   toep->tid = -1;
+
+   if (status != EAGAIN)
+   INP_INFO_WLOCK(&V_tcbinfo);
+   INP_WLOCK(inp);
+   toe_connect_failed(tod, inp, status);
+   final_cpl_received(toep);   /* unlocks inp */
+   if (status != EAGAIN)
+   INP_INFO_WUNLOCK(&V_tcbinfo);
+}
+
 static int
 do_act_open_rpl(struct sge_iq *iq, const struct rss_header *rss,
 struct mbuf *m)
 {
struct adapter *sc = iq->adapter;
const struct cpl_act_open_rpl *cpl = (const void *)(rss + 1);
-   unsigned int atid = G_TID_TID(G_AOPEN_ATID(be32toh(cpl->atid_status)));
-   unsigned int status = G_AOPEN_STATUS(be32toh(cpl->atid_status));
+   u_int atid = G_TID_TID(G_AOPEN_ATID(be32toh(cpl->atid_status)));
+   u_int status = G_AOPEN_STATUS(be32toh(cpl->atid_status));
struct toepcb *toep = lookup_atid(sc, atid);
-   struct inpcb *inp = toep->inp;
-   struct toedev *tod = &toep->td->tod;
int rc;
 
KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__));
@@ -200,20 +217,11 @@ do_act_open_rpl(struct sge_iq *iq, const
if (negative_advice(status))
return (0);
 
-   free_atid(sc, atid);
-   toep->tid = -1;
-
if (status && act_open_has_tid(status))
release_tid(sc, GET_TID(cpl), toep->ctrlq);
 
rc = act_open_rpl_status_to_errno(status);
-   if (rc != EAGAIN)
-   INP_INFO_WLOCK(&V_tcbinfo);
-   INP_WLOCK(inp);
-   toe_connect_failed(tod, inp, rc);
-   final_cpl_received(toep);   /* unlocks inp */
-   if (rc != EAGAIN)
-   INP_INFO_WUNLOCK(&V_tcbinfo);
+   act_open_failure_cleanup(sc, atid, rc);
 
return (0);
 }

Modified: head/sys/dev/cxgbe/tom/t4_tom.c
==
--- head/sys/dev/cxgbe/tom/t4_tom.c Tue Oct  7 20:13:47 2014
(r272718)
+++ head/sys/dev/cxgbe/tom/t4_tom.c Tue Oct  7 21:26:22 2014
(r272719)
@@ -98,6 +98,7 @@ static void t4_clip_task(void *, int);
 static void update_clip_table(struct adapter *, struct tom_data *);
 static void destroy_clip_table(struct adapter *, struct tom_data *);
 static void free_tom_data(struct adapter *, struct tom_data *);
+static void reclaim_wr_resources(void *, int);
 
 static int in6_ifaddr_gen;
 static eventhandler_tag ifaddr_evhandler;
@@ -903,6 +904,8 @@ free_tom_data(struct adapter *sc, struct
if (td->listen_mask != 0)
hashdestroy(td->listen_hash, M_CXGBE, td->listen_mask);
 
+   if (mtx_initialized(&td->unsent_wr_lock))
+   mtx_destroy(&td->unsent_wr_lock);
if (mtx_initialized(&td->lctx_hash_lock))
mtx_destroy(&td->lctx_hash_lock);
if (mtx_initialized(&td->toep_li

svn commit: r272720 - head/sys/netinet

2014-10-07 Thread Sean Bruno
Author: sbruno
Date: Tue Oct  7 21:50:28 2014
New Revision: 272720
URL: https://svnweb.freebsd.org/changeset/base/272720

Log:
  Implement PLPMTUD blackhole detection (RFC 4821), inspired by code
  from xnu sources.  If we encounter a network where ICMP is blocked
  the Needs Frag indicator may not propagate back to us.  Attempt to
  downshift the mss once to a preconfigured value.
  
  Default this feature to off for now while we do not have a full PLPMTUD
  implementation in our stack.
  
  Adds the following new sysctl's for control:
  net.inet.tcp.pmtud_blackhole_detection -- turns on/off this feature
  net.inet.tcp.pmtud_blackhole_mss   -- mss to try for ipv4
  net.inet.tcp.v6pmtud_blackhole_mss -- mss to try for ipv6
  
  Adds the following new sysctl's for monitoring:
  -- Number of times the code was activated to attempt a mss downshift
  net.inet.tcp.pmtud_blackhole_activated
  -- Number of times the blackhole mss was used in an attempt to downshift
  net.inet.tcp.pmtud_blackhole_min_activated
  -- Number of times that we failed to connect after we downshifted the mss
  net.inet.tcp.pmtud_blackhole_failed
  
  Phabricator:  https://reviews.freebsd.org/D506
  Reviewed by:  rpaulo bz
  MFC after:2 weeks
  Relnotes: yes
  Sponsored by: Limelight Networks

Modified:
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_timer.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Tue Oct  7 21:26:22 2014
(r272719)
+++ head/sys/netinet/tcp_output.c   Tue Oct  7 21:50:28 2014
(r272720)
@@ -675,6 +675,12 @@ just_return:
 
 send:
SOCKBUF_LOCK_ASSERT(&so->so_snd);
+   if (len > 0) {
+   if (len >= tp->t_maxseg)
+   tp->t_flags2 |= TF2_PLPMTU_MAXSEGSNT;
+   else
+   tp->t_flags2 &= ~TF2_PLPMTU_MAXSEGSNT;
+   }
/*
 * Before ESTABLISHED, force sending of initial options
 * unless TCP set not to do any options.
@@ -1303,8 +1309,12 @@ send:
 *
 * NB: Don't set DF on small MTU/MSS to have a safe fallback.
 */
-   if (V_path_mtu_discovery && tp->t_maxopd > V_tcp_minmss)
+   if (V_path_mtu_discovery && tp->t_maxopd > V_tcp_minmss) {
ip->ip_off |= htons(IP_DF);
+   tp->t_flags2 |= TF2_PLPMTU_PMTUD;
+   } else {
+   tp->t_flags2 &= ~TF2_PLPMTU_PMTUD;
+   }
 
if (tp->t_state == TCPS_SYN_SENT)
TCP_PROBE5(connect__request, NULL, tp, ip, tp, th);

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cTue Oct  7 21:26:22 2014
(r272719)
+++ head/sys/netinet/tcp_timer.cTue Oct  7 21:50:28 2014
(r272720)
@@ -66,6 +66,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef INET6
+#include 
+#endif
 #include 
 #ifdef TCPDEBUG
 #include 
@@ -127,6 +130,54 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, rexm
 &tcp_rexmit_drop_options, 0,
 "Drop TCP options from 3rd and later retransmitted SYN");
 
+static VNET_DEFINE(int, tcp_pmtud_blackhole_detect);
+#defineV_tcp_pmtud_blackhole_detectVNET(tcp_pmtud_blackhole_detect)
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_detection,
+CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_VNET,
+&VNET_NAME(tcp_pmtud_blackhole_detect), 0,
+"Path MTU Discovery Black Hole Detection Enabled");
+
+static VNET_DEFINE(int, tcp_pmtud_blackhole_activated);
+#defineV_tcp_pmtud_blackhole_activated \
+VNET(tcp_pmtud_blackhole_activated)
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_activated,
+CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_VNET,
+&VNET_NAME(tcp_pmtud_blackhole_activated), 0,
+"Path MTU Discovery Black Hole Detection, Activation Count");
+
+static VNET_DEFINE(int, tcp_pmtud_blackhole_activated_min_mss);
+#defineV_tcp_pmtud_blackhole_activated_min_mss \
+VNET(tcp_pmtud_blackhole_activated_min_mss)
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_activated_min_mss,
+CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_VNET,
+&VNET_NAME(tcp_pmtud_blackhole_activated_min_mss), 0,
+"Path MTU Discovery Black Hole Detection, Activation Count at min MSS");
+
+static VNET_DEFINE(int, tcp_pmtud_blackhole_failed);
+#defineV_tcp_pmtud_blackhole_failedVNET(tcp_pmtud_blackhole_failed)
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_failed,
+CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_VNET,
+&VNET_NAME(tcp_pmtud_blackhole_failed), 0,
+"Path MTU Discovery Black Hole Detection, Failure Count");
+
+#ifdef INET
+static VNET_DEFINE(int, tcp_pmtud_blackhole_mss) = 1200;
+#defineV_tcp_pmtud_blackhole_mss   VNET(tcp_pmtud_blackhole_mss)
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_mss,
+CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_VNET,
+&

Re: svn commit: r272649 - head/contrib/byacc

2014-10-07 Thread Baptiste Daroussin
On Tue, Oct 07, 2014 at 02:02:34PM -0700, Craig Rodrigues wrote:
> On Mon, Oct 6, 2014 at 7:49 AM, Baptiste Daroussin  wrote:
> 
> >
> > Why a direct commit instead of a proper import of 20141005 version? it
> > would
> > have imho been better, simpler and easier to maintain.
> >
> 
> Because according to Thomas Dickey, he did not fix all
> the memory related problems in snapshot 20141005.  Specifically there are
> still
> some issues not fixed when realloc() is called.
> I was going to wait for the next snapshot.
> However, I wanted to get that one fix into FreeBSD to fix the kyua tests,
> which have been failing under Jenkins.  See:
> https://jenkins.freebsd.org/jenkins/job/FreeBSD_HEAD-tests2/
> (see runs #10 and #11).

In that case I will import the new one which has the fix (do you confirm?)

Best regards,
Bapt


pgpVhsW6mvrbq.pgp
Description: PGP signature


Re: svn commit: r272384 - head/usr.bin/mkimg

2014-10-07 Thread Dmitry Morozovsky
On Fri, 3 Oct 2014, Ed Maste wrote:

> On 2 October 2014 10:43, Ed Maste  wrote:
> >
> > I've been using brooks' NO_ROOT support along with makefs / mkimg to
> > build and test changes by creating an image to boot in QEMU.  This
> > change provides a noticeable improvement in the cycle time.
> 
> I've had a couple of inquiries about the workflow I've been using, so
> I've added a brief set of steps to my Wiki page at
> https://wiki.freebsd.org/EdMaste/BuildVM .
> 
> With -DNO_ROOT for the install targets an mtree file named METALOG
> file is created at the top of DESTDIR.  Files are installed owned by
> the user, without special flags.  Makefs reads the METALOG file and
> applies the desired ownership, permissions and flags in the generated
> file system.
> 
> Then mkimg creates an image with a GPT partition table, the UFS
> filesystem created by makefs, and the various boot loader bits for
> legacy and UEFI boot.

Wouldn't it be useful for automating backing up config directories? I'd think 
about copying, say, /etc and /usr/local/etc to sometemporary place, changing 
owner to non-privileged user, and then commit changes (removals should be 
treated specially, of course) to some kind of SCM?

Or, does such project exist already?  I failed to find it, but maybe my 
goole-fu is lacking necessary components ;)

-- 
Sincerely,
D.Marck [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer: ma...@freebsd.org ]

*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- ma...@rinet.ru ***

___
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: r272721 - in head/sys/dev: alc ale

2014-10-07 Thread Pyun YongHyeon
Author: yongari
Date: Wed Oct  8 01:03:32 2014
New Revision: 272721
URL: https://svnweb.freebsd.org/changeset/base/272721

Log:
  Fix a long standing bug in MAC statistics register access.  One
  additional register was erroneously added in the MAC register set
  such that 7 TX statistics counters were wrong.

Modified:
  head/sys/dev/alc/if_alc.c
  head/sys/dev/alc/if_alcreg.h
  head/sys/dev/ale/if_ale.c
  head/sys/dev/ale/if_alereg.h

Modified: head/sys/dev/alc/if_alc.c
==
--- head/sys/dev/alc/if_alc.c   Tue Oct  7 21:50:28 2014(r272720)
+++ head/sys/dev/alc/if_alc.c   Wed Oct  8 01:03:32 2014(r272721)
@@ -1287,8 +1287,6 @@ alc_sysctl_node(struct alc_softc *sc)
&stats->tx_late_colls, "Late collisions");
ALC_SYSCTL_STAT_ADD32(ctx, child, "excess_colls",
&stats->tx_excess_colls, "Excessive collisions");
-   ALC_SYSCTL_STAT_ADD32(ctx, child, "abort",
-   &stats->tx_abort, "Aborted frames due to Excessive collisions");
ALC_SYSCTL_STAT_ADD32(ctx, child, "underruns",
&stats->tx_underrun, "FIFO underruns");
ALC_SYSCTL_STAT_ADD32(ctx, child, "desc_underruns",
@@ -2599,7 +2597,6 @@ alc_stats_update(struct alc_softc *sc)
stat->tx_multi_colls += smb->tx_multi_colls;
stat->tx_late_colls += smb->tx_late_colls;
stat->tx_excess_colls += smb->tx_excess_colls;
-   stat->tx_abort += smb->tx_abort;
stat->tx_underrun += smb->tx_underrun;
stat->tx_desc_underrun += smb->tx_desc_underrun;
stat->tx_lenerrs += smb->tx_lenerrs;
@@ -2612,17 +2609,10 @@ alc_stats_update(struct alc_softc *sc)
 
if_inc_counter(ifp, IFCOUNTER_COLLISIONS, smb->tx_single_colls +
smb->tx_multi_colls * 2 + smb->tx_late_colls +
-   smb->tx_abort * HDPX_CFG_RETRY_DEFAULT);
+   smb->tx_excess_colls * HDPX_CFG_RETRY_DEFAULT);
 
-   /*
-* XXX
-* tx_pkts_truncated counter looks suspicious. It constantly
-* increments with no sign of Tx errors. This may indicate
-* the counter name is not correct one so I've removed the
-* counter in output errors.
-*/
-   if_inc_counter(ifp, IFCOUNTER_OERRORS,
-   smb->tx_abort + smb->tx_late_colls + smb->tx_underrun);
+   if_inc_counter(ifp, IFCOUNTER_OERRORS, smb->tx_late_colls +
+   smb->tx_excess_colls + smb->tx_underrun + smb->tx_pkts_truncated);
 
if_inc_counter(ifp, IFCOUNTER_IPACKETS, smb->rx_frames);
 

Modified: head/sys/dev/alc/if_alcreg.h
==
--- head/sys/dev/alc/if_alcreg.hTue Oct  7 21:50:28 2014
(r272720)
+++ head/sys/dev/alc/if_alcreg.hWed Oct  8 01:03:32 2014
(r272721)
@@ -860,7 +860,6 @@ struct smb {
uint32_t tx_multi_colls;
uint32_t tx_late_colls;
uint32_t tx_excess_colls;
-   uint32_t tx_abort;
uint32_t tx_underrun;
uint32_t tx_desc_underrun;
uint32_t tx_lenerrs;

Modified: head/sys/dev/ale/if_ale.c
==
--- head/sys/dev/ale/if_ale.c   Tue Oct  7 21:50:28 2014(r272720)
+++ head/sys/dev/ale/if_ale.c   Wed Oct  8 01:03:32 2014(r272721)
@@ -946,8 +946,6 @@ ale_sysctl_node(struct ale_softc *sc)
&stats->tx_late_colls, "Late collisions");
ALE_SYSCTL_STAT_ADD32(ctx, child, "excess_colls",
&stats->tx_excess_colls, "Excessive collisions");
-   ALE_SYSCTL_STAT_ADD32(ctx, child, "abort",
-   &stats->tx_abort, "Aborted frames due to Excessive collisions");
ALE_SYSCTL_STAT_ADD32(ctx, child, "underruns",
&stats->tx_underrun, "FIFO underruns");
ALE_SYSCTL_STAT_ADD32(ctx, child, "desc_underruns",
@@ -2197,7 +2195,6 @@ ale_stats_update(struct ale_softc *sc)
stat->tx_multi_colls += smb->tx_multi_colls;
stat->tx_late_colls += smb->tx_late_colls;
stat->tx_excess_colls += smb->tx_excess_colls;
-   stat->tx_abort += smb->tx_abort;
stat->tx_underrun += smb->tx_underrun;
stat->tx_desc_underrun += smb->tx_desc_underrun;
stat->tx_lenerrs += smb->tx_lenerrs;
@@ -2210,17 +2207,10 @@ ale_stats_update(struct ale_softc *sc)
 
if_inc_counter(ifp, IFCOUNTER_COLLISIONS, smb->tx_single_colls +
smb->tx_multi_colls * 2 + smb->tx_late_colls +
-   smb->tx_abort * HDPX_CFG_RETRY_DEFAULT);
+   smb->tx_excess_colls * HDPX_CFG_RETRY_DEFAULT);
 
-   /*
-* XXX
-* tx_pkts_truncated counter looks suspicious. It constantly
-* increments with no sign of Tx errors. This may indicate
-* the counter name is not correct one so I've removed the
-* counter in output errors.
-*/
-   if_inc_counter(ifp, IFCOUNTER_OERRORS,
-   smb->tx_abort + smb->tx_late_colls + smb->tx_

svn commit: r272728 - head/usr.bin/w

2014-10-07 Thread Eitan Adler
Author: eadler
Date: Wed Oct  8 05:04:31 2014
New Revision: 272728
URL: https://svnweb.freebsd.org/changeset/base/272728

Log:
  don't reinvent the wheel: rely on basename(3)
  
  Reviewed by:  nwhitehorn

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

Modified: head/usr.bin/w/w.c
==
--- head/usr.bin/w/w.c  Wed Oct  8 04:42:56 2014(r272727)
+++ head/usr.bin/w/w.c  Wed Oct  8 05:04:31 2014(r272728)
@@ -68,6 +68,7 @@ static const char sccsid[] = "@(#)w.c 8.
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -121,7 +122,6 @@ static struct entry {
 static void pr_header(time_t *, int);
 static struct stat *ttystat(char *);
 static void usage(int);
-static int  this_is_uptime(const char *s);
 
 char *fmt_argv(char **, char *, char *, size_t);   /* ../../bin/ps/fmt.c */
 
@@ -144,7 +144,7 @@ main(int argc, char *argv[])
use_comma = (*nl_langinfo(RADIXCHAR) != ',');
 
/* Are we w(1) or uptime(1)? */
-   if (this_is_uptime(argv[0]) == 0) {
+   if (strcmp(basename(argv[0]), "uptime") == 0) {
wcmd = 0;
p = "";
} else {
@@ -512,17 +512,3 @@ usage(int wcmd)
(void)fprintf(stderr, "usage: uptime\n");
exit(1);
 }
-
-static int 
-this_is_uptime(const char *s)
-{
-   const char *u;
-
-   if ((u = strrchr(s, '/')) != NULL)
-   ++u;
-   else
-   u = s;
-   if (strcmp(u, "uptime") == 0)
-   return (0);
-   return (-1);
-}
___
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: r272729 - head/sys/dev/pci

2014-10-07 Thread Pyun YongHyeon
Author: yongari
Date: Wed Oct  8 05:34:39 2014
New Revision: 272729
URL: https://svnweb.freebsd.org/changeset/base/272729

Log:
  Add new quirk PCI_QUIRK_MSI_INTX_BUG to pci(4).
  QAC AR816x/E2200 controller has a silicon bug that MSI interrupt
  does not assert if PCIM_CMD_INTxDIS bit of command register is set.
  
  Reviewed by:  jhb

Modified:
  head/sys/dev/pci/pci.c

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Wed Oct  8 05:04:31 2014(r272728)
+++ head/sys/dev/pci/pci.c  Wed Oct  8 05:34:39 2014(r272729)
@@ -207,6 +207,7 @@ struct pci_quirk {
 #definePCI_QUIRK_ENABLE_MSI_VM 3 /* Older chipset in VM where MSI 
works */
 #definePCI_QUIRK_UNMAP_REG 4 /* Ignore PCI map register */
 #definePCI_QUIRK_DISABLE_MSIX  5 /* MSI-X doesn't work */
+#definePCI_QUIRK_MSI_INTX_BUG  5 /* PCIM_CMD_INTxDIS disables MSI */
int arg1;
int arg2;
 };
@@ -266,6 +267,15 @@ static const struct pci_quirk pci_quirks
 */
{ 0x43851002, PCI_QUIRK_UNMAP_REG,  0x14,   0 },
 
+   /*
+* Atheros AR8161/AR8162/E2200 ethernet controller has a bug that
+* MSI interrupt does not assert if PCIM_CMD_INTxDIS bit of the
+* command register is set.
+*/
+   { 0x10911969, PCI_QUIRK_MSI_INTX_BUG,   0,  0 },
+   { 0xE0911969, PCI_QUIRK_MSI_INTX_BUG,   0,  0 },
+   { 0x10901969, PCI_QUIRK_MSI_INTX_BUG,   0,  0 },
+
{ 0 }
 };
 
@@ -3856,8 +3866,14 @@ pci_setup_intr(device_t dev, device_t ch
mte->mte_handlers++;
}
 
-   /* Make sure that INTx is disabled if we are using MSI/MSIX */
-   pci_set_command_bit(dev, child, PCIM_CMD_INTxDIS);
+   if (!pci_has_quirk(pci_get_devid(dev),
+   PCI_QUIRK_MSI_INTX_BUG)) {
+   /*
+* Make sure that INTx is disabled if we are
+* using MSI/MSIX
+*/
+   pci_set_command_bit(dev, child, PCIM_CMD_INTxDIS);
+   }
bad:
if (error) {
(void)bus_generic_teardown_intr(dev, child, irq,
___
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: r272730 - head/sys/dev/alc

2014-10-07 Thread Pyun YongHyeon
Author: yongari
Date: Wed Oct  8 05:47:01 2014
New Revision: 272730
URL: https://svnweb.freebsd.org/changeset/base/272730

Log:
  Add support for QAC AR816x/AR817x Gigabit/Fast Ethernet controllers.
  These controllers seem to have the same feature of AR813x/AR815x and
  improved RSS support(4 TX queues and 8 RX queues).  alc(4) supports
  all hardware features except RSS.  I didn't implement RX checksum
  offloading for AR816x/AR817x just because I couldn't get
  confirmation from the Vendor whether AR816x/AR817x corrected its
  predecessor's RX checksum offloading bug on fragmented packets.
  This change adds supports for the following controllers.
   o AR8161 PCIe Gigabit Ethernet controller
   o AR8162 PCIe Fast Ethernet controller
   o AR8171 PCIe Gigabit Ethernet controller
   o AR8172 PCIe Fast Ethernet controller
   o Killer E2200 Gigabit Ethernet controller
  
  Tested by:Many
  Relnotes: yes
  MFC after:2 weeks
  HW donated by:Qualcomm Atheros Communications, Inc.

Modified:
  head/sys/dev/alc/if_alc.c
  head/sys/dev/alc/if_alcreg.h
  head/sys/dev/alc/if_alcvar.h

Modified: head/sys/dev/alc/if_alc.c
==
--- head/sys/dev/alc/if_alc.c   Wed Oct  8 05:34:39 2014(r272729)
+++ head/sys/dev/alc/if_alc.c   Wed Oct  8 05:47:01 2014(r272730)
@@ -111,17 +111,31 @@ static struct alc_ident alc_ident_table[
"Atheros AR8152 v1.1 PCIe Fast Ethernet" },
{ VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8152_B2, 6 * 1024,
"Atheros AR8152 v2.0 PCIe Fast Ethernet" },
+   { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8161, 9 * 1024,
+   "Atheros AR8161 PCIe Gigabit Ethernet" },
+   { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8162, 9 * 1024,
+   "Atheros AR8161 PCIe Fast Ethernet" },
+   { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8171, 9 * 1024,
+   "Atheros AR8161 PCIe Gigabit Ethernet" },
+   { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8172, 9 * 1024,
+   "Atheros AR8161 PCIe Fast Ethernet" },
+   { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2200, 9 * 1024,
+   "Killer E2200 Gigabit Ethernet" },
{ 0, 0, 0, NULL}
 };
 
-static voidalc_aspm(struct alc_softc *, int);
+static voidalc_aspm(struct alc_softc *, int, int);
+static voidalc_aspm_813x(struct alc_softc *, int);
+static voidalc_aspm_816x(struct alc_softc *, int);
 static int alc_attach(device_t);
 static int alc_check_boundary(struct alc_softc *);
+static voidalc_config_msi(struct alc_softc *);
 static int alc_detach(device_t);
 static voidalc_disable_l0s_l1(struct alc_softc *);
 static int alc_dma_alloc(struct alc_softc *);
 static voidalc_dma_free(struct alc_softc *);
 static voidalc_dmamap_cb(void *, bus_dma_segment_t *, int, int);
+static voidalc_dsp_fixup(struct alc_softc *, int);
 static int alc_encap(struct alc_softc *, struct mbuf **);
 static struct alc_ident *
alc_find_ident(device_t);
@@ -130,6 +144,9 @@ static struct mbuf *
alc_fixup_rx(struct ifnet *, struct mbuf *);
 #endif
 static voidalc_get_macaddr(struct alc_softc *);
+static voidalc_get_macaddr_813x(struct alc_softc *);
+static voidalc_get_macaddr_816x(struct alc_softc *);
+static voidalc_get_macaddr_par(struct alc_softc *);
 static voidalc_init(void *);
 static voidalc_init_cmb(struct alc_softc *);
 static voidalc_init_locked(struct alc_softc *);
@@ -141,14 +158,26 @@ static void   alc_int_task(void *, int);
 static int alc_intr(void *);
 static int alc_ioctl(struct ifnet *, u_long, caddr_t);
 static voidalc_mac_config(struct alc_softc *);
+static uint32_talc_mii_readreg_813x(struct alc_softc *, int, int);
+static uint32_talc_mii_readreg_816x(struct alc_softc *, int, int);
+static uint32_talc_mii_writereg_813x(struct alc_softc *, int, int, 
int);
+static uint32_talc_mii_writereg_816x(struct alc_softc *, int, int, 
int);
 static int alc_miibus_readreg(device_t, int, int);
 static voidalc_miibus_statchg(device_t);
 static int alc_miibus_writereg(device_t, int, int, int);
+static uint32_talc_miidbg_readreg(struct alc_softc *, int);
+static uint32_talc_miidbg_writereg(struct alc_softc *, int, int);
+static uint32_talc_miiext_readreg(struct alc_softc *, int, int);
+static uint32_talc_miiext_writereg(struct alc_softc *, int, int, int);
 static int alc_mediachange(struct ifnet *);
+static int alc_mediachange_locked(struct alc_softc *);
 static voidalc_mediastatus(struct ifnet *, struct ifmediareq *);
 static int alc_newbuf(struct alc_softc *, struct alc_rxdesc *);
+static voidalc_osc_reset(struct alc_softc *);
 static voidalc_phy_down(struct alc_softc *);
 static voidalc_phy_reset(struct alc_softc *);
+static voidalc_phy_reset_813x(struct alc_softc *);
+static void  

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

2014-10-07 Thread Pyun YongHyeon
Author: yongari
Date: Wed Oct  8 05:49:10 2014
New Revision: 272731
URL: https://svnweb.freebsd.org/changeset/base/272731

Log:
  Document newly added controller AR816x/AR817x.

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

Modified: head/share/man/man4/alc.4
==
--- head/share/man/man4/alc.4   Wed Oct  8 05:47:01 2014(r272730)
+++ head/share/man/man4/alc.4   Wed Oct  8 05:49:10 2014(r272731)
@@ -24,12 +24,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 9, 2010
+.Dd October 8, 2014
 .Dt ALC 4
 .Os
 .Sh NAME
 .Nm alc
-.Nd Atheros AR813x/AR815x Gigabit/Fast Ethernet driver
+.Nd Atheros AR813x/AR815x/AR816x/AR817x Gigabit/Fast Ethernet driver
 .Sh SYNOPSIS
 To compile this driver into the kernel,
 place the following lines in your
@@ -48,8 +48,8 @@ if_alc_load="YES"
 .Sh DESCRIPTION
 The
 .Nm
-device driver provides support for Atheros AR813x and AR815x PCI
-Express Gigabit/Fast Ethernet controllers.
+device driver provides support for Atheros AR813x, AR815x, AR816x
+and AR817x PCI Express Gigabit/Fast Ethernet controllers.
 .Pp
 All LOMs supported by the
 .Nm
@@ -58,9 +58,9 @@ segmentation offload (TSO), hardware VLA
 features, Wake On Lan (WOL) and an interrupt moderation mechanism
 as well as a 64-bit multicast hash filter.
 .Pp
-The AR813x and AR815x supports Jumbo Frames (up to 9216 and 6144
-bytes, respectively), which can be configured via the interface
-MTU setting.
+The AR813x, AR815x, AR816x and AR817x supports Jumbo Frames (up to
+9216, 6144, 9216 and 9216 bytes, respectively), which can be
+configured via the interface MTU setting.
 Selecting an MTU larger than 1500 bytes with the
 .Xr ifconfig 8
 utility configures the adapter to receive and transmit Jumbo Frames.
@@ -112,6 +112,16 @@ Atheros AR8151 v2.0 PCI Express Gigabit 
 Atheros AR8152 v1.1 PCI Express Fast Ethernet controller
 .It
 Atheros AR8152 v2.0 PCI Express Fast Ethernet controller
+.It
+Atheros AR8161 PCI Express Gigabit Ethernet controller
+.It
+Atheros AR8162 PCI Express Fast Ethernet controller
+.It
+Atheros AR8171 PCI Express Gigabit Ethernet controller
+.It
+Atheros AR8172 PCI Express Fast Ethernet controller
+.It
+Killer E2200 Gigabit Ethernet controller
 .El
 .Sh LOADER TUNABLES
 Tunables can be set at the
___
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: r272732 - head/sys/dev/pci

2014-10-07 Thread Pyun YongHyeon
Author: yongari
Date: Wed Oct  8 05:53:04 2014
New Revision: 272732
URL: https://svnweb.freebsd.org/changeset/base/272732

Log:
  Oops, fix typo made in r272729.

Modified:
  head/sys/dev/pci/pci.c

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Wed Oct  8 05:49:10 2014(r272731)
+++ head/sys/dev/pci/pci.c  Wed Oct  8 05:53:04 2014(r272732)
@@ -207,7 +207,7 @@ struct pci_quirk {
 #definePCI_QUIRK_ENABLE_MSI_VM 3 /* Older chipset in VM where MSI 
works */
 #definePCI_QUIRK_UNMAP_REG 4 /* Ignore PCI map register */
 #definePCI_QUIRK_DISABLE_MSIX  5 /* MSI-X doesn't work */
-#definePCI_QUIRK_MSI_INTX_BUG  5 /* PCIM_CMD_INTxDIS disables MSI */
+#definePCI_QUIRK_MSI_INTX_BUG  6 /* PCIM_CMD_INTxDIS disables MSI */
int arg1;
int arg2;
 };
___
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"