svn commit: r248187 - head/sys/dev/sound/pci/hda

2013-03-12 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar 12 08:45:42 2013
New Revision: 248187
URL: http://svnweb.freebsd.org/changeset/base/248187

Log:
  More Lenovo headphones redirection quirks: Lenovo T430, Lenovo T430S.
  
  Submitted by: Sergey Nasonov , T430
  Submitted by: Johannes Dieterich , T430S

Modified:
  head/sys/dev/sound/pci/hda/hdaa_patches.c
  head/sys/dev/sound/pci/hda/hdac.h

Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c
==
--- head/sys/dev/sound/pci/hda/hdaa_patches.c   Tue Mar 12 06:58:49 2013
(r248186)
+++ head/sys/dev/sound/pci/hda/hdaa_patches.c   Tue Mar 12 08:45:42 2013
(r248187)
@@ -344,7 +344,9 @@ hdac_pin_patch(struct hdaa_widget *w)
break;
}
} else if (id == HDA_CODEC_ALC269 &&
-   subid == LENOVO_X1CRBN_SUBVENDOR) {
+   (subid == LENOVO_X1CRBN_SUBVENDOR ||
+   subid == LENOVO_T430_SUBVENDOR ||
+   subid == LENOVO_T430S_SUBVENDOR)) {
switch (nid) {
case 21:
patch = "as=1 seq=15";

Modified: head/sys/dev/sound/pci/hda/hdac.h
==
--- head/sys/dev/sound/pci/hda/hdac.h   Tue Mar 12 06:58:49 2013
(r248186)
+++ head/sys/dev/sound/pci/hda/hdac.h   Tue Mar 12 08:45:42 2013
(r248187)
@@ -225,6 +225,8 @@
 #define LENOVO_X220_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
 #define LENOVO_X300_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
 #defineLENOVO_T420_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
+#defineLENOVO_T430_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3)
+#defineLENOVO_T430S_SUBVENDOR  HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb)
 #defineLENOVO_T520_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21cf)
 #define LENOVO_ALL_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x)
 
___
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: r248188 - in head/sys: dev/iscsi/initiator fs/nfs xdr

2013-03-12 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar 12 08:59:51 2013
New Revision: 248188
URL: http://svnweb.freebsd.org/changeset/base/248188

Log:
  Finish r243882: mechanically substitute flags from historic mbuf
  allocator with malloc(9) flags within sys.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/dev/iscsi/initiator/isc_soc.c
  head/sys/fs/nfs/nfsport.h
  head/sys/xdr/xdr_mbuf.c

Modified: head/sys/dev/iscsi/initiator/isc_soc.c
==
--- head/sys/dev/iscsi/initiator/isc_soc.c  Tue Mar 12 08:45:42 2013
(r248187)
+++ head/sys/dev/iscsi/initiator/isc_soc.c  Tue Mar 12 08:59:51 2013
(r248188)
@@ -91,7 +91,7 @@ isc_sendPDU(isc_session_t *sp, pduq_t *p
  /* 
   | mbuf for the iSCSI header
   */
- MGETHDR(mh, M_TRYWAIT, MT_DATA);
+ MGETHDR(mh, M_WAITOK, MT_DATA);
  mh->m_pkthdr.rcvif = NULL;
  mh->m_next = NULL;
  mh->m_len = sizeof(union ipdu_u);
@@ -132,7 +132,7 @@ isc_sendPDU(isc_session_t *sp, pduq_t *p
   while(len > 0) {
   int l;
 
-  MGET(md, M_TRYWAIT, MT_DATA);
+  MGET(md, M_WAITOK, MT_DATA);
   md->m_ext.ref_cnt = &ou_refcnt;
   l = min(MCLBYTES, len);
   debug(4, "setting ext_free(arg=%p len/l=%d/%d)", pq->buf, len, 
l);
@@ -150,7 +150,7 @@ isc_sendPDU(isc_session_t *sp, pduq_t *p
   off += l;
   }
  if(((pp->ds_len & 03) != 0) || ISOK2DIG(sp->dataDigest, pp)) {
-  MGET(md, M_TRYWAIT, MT_DATA);
+  MGET(md, M_WAITOK, MT_DATA);
   if(pp->ds_len & 03)
len = 4 - (pp->ds_len & 03);
   else

Modified: head/sys/fs/nfs/nfsport.h
==
--- head/sys/fs/nfs/nfsport.h   Tue Mar 12 08:45:42 2013(r248187)
+++ head/sys/fs/nfs/nfsport.h   Tue Mar 12 08:59:51 2013(r248188)
@@ -140,32 +140,32 @@
  * Allocate mbufs. Must succeed and never set the mbuf ptr to NULL.
  */
 #defineNFSMGET(m)  do {\
-   MGET((m), M_TRYWAIT, MT_DATA);  \
+   MGET((m), M_WAITOK, MT_DATA);   \
while ((m) == NULL ) {  \
(void) nfs_catnap(PZERO, 0, "nfsmget"); \
-   MGET((m), M_TRYWAIT, MT_DATA);  \
+   MGET((m), M_WAITOK, MT_DATA);   \
}   \
} while (0)
 #defineNFSMGETHDR(m)   do {\
-   MGETHDR((m), M_TRYWAIT, MT_DATA);   \
+   MGETHDR((m), M_WAITOK, MT_DATA);\
while ((m) == NULL ) {  \
(void) nfs_catnap(PZERO, 0, "nfsmget"); \
-   MGETHDR((m), M_TRYWAIT, MT_DATA);   \
+   MGETHDR((m), M_WAITOK, MT_DATA);\
}   \
} while (0)
 #defineNFSMCLGET(m, w) do {\
-   MGET((m), M_TRYWAIT, MT_DATA);  \
+   MGET((m), M_WAITOK, MT_DATA);   \
while ((m) == NULL ) {  \
(void) nfs_catnap(PZERO, 0, "nfsmget"); \
-   MGET((m), M_TRYWAIT, MT_DATA);  \
+   MGET((m), M_WAITOK, MT_DATA);   \
}   \
MCLGET((m), (w));   \
} while (0)
 #defineNFSMCLGETHDR(m, w) do { \
-   MGETHDR((m), M_TRYWAIT, MT_DATA);   \
+   MGETHDR((m), M_WAITOK, MT_DATA);\
while ((m) == NULL ) {  \
(void) nfs_catnap(PZERO, 0, "nfsmget"); \
-   MGETHDR((m), M_TRYWAIT, MT_DATA);   \
+   MGETHDR((m), M_WAITOK, MT_DATA);\
}   \
} while (0)
 #defineNFSMTOD mtod

Modified: head/sys/xdr/xdr_mbuf.c
==
--- head/sys/xdr/xdr_mbuf.c Tue Mar 12 08:45:42 2013(r248187)
+++ head/sys/xdr/xdr_mbuf.c Tue Mar 12 08:59:51 2013(r248188)
@@ -228,9 +228,9 @@ xdrmbuf_putbytes(XDR *xdrs, const char *
 
if (xdrs->x_handy == m->m_len && M_TRAILINGSPACE(m) == 0) {
if (!m->m_next) {
-   MGET(n, M_TRYWAIT, m->m_type);
+   MGET(n, M_WAITOK, m->m_type);
if (m->m

svn commit: r248189 - head/sys/arm/at91

2013-03-12 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar 12 10:05:36 2013
New Revision: 248189
URL: http://svnweb.freebsd.org/changeset/base/248189

Log:
  Use m_get2() to get an mbuf of appropriate size.
  
  Reviewed by:  marius
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/arm/at91/if_ate.c

Modified: head/sys/arm/at91/if_ate.c
==
--- head/sys/arm/at91/if_ate.c  Tue Mar 12 08:59:51 2013(r248188)
+++ head/sys/arm/at91/if_ate.c  Tue Mar 12 10:05:36 2013(r248189)
@@ -899,12 +899,9 @@ ate_intr(void *xsc)
/* FCS is not coppied into mbuf. */
remain = (sc->rx_descs[idx].status & ETH_LEN_MASK) - 4;
 
-   /* Get an appropriately sized mbuf  */
-   if (remain + ETHER_ALIGN >= MINCLSIZE)
-   mb = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
-   else
-   MGETHDR(mb, M_NOWAIT, MT_DATA);
-
+   /* Get an appropriately sized mbuf. */
+   mb = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR,
+   remain + ETHER_ALIGN);
if (mb == NULL) {
sc->ifp->if_iqdrops++;
rxdhead->status = 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: r248193 - in head/sys: kern sys

2013-03-12 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar 12 12:12:16 2013
New Revision: 248193
URL: http://svnweb.freebsd.org/changeset/base/248193

Log:
  The m_extadd() can fail due to memory allocation failure, thus:
  - Make it return int, not void.
  - Add wait parameter.
  - Update MEXTADD() macro appropriately, defaults to M_NOWAIT, as
before this change.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/kern/uipc_mbuf.c
  head/sys/sys/mbuf.h

Modified: head/sys/kern/uipc_mbuf.c
==
--- head/sys/kern/uipc_mbuf.c   Tue Mar 12 12:10:32 2013(r248192)
+++ head/sys/kern/uipc_mbuf.c   Tue Mar 12 12:12:16 2013(r248193)
@@ -255,25 +255,30 @@ m_freem(struct mbuf *mb)
  * Returns:
  *Nothing.
  */
-void
+int
 m_extadd(struct mbuf *mb, caddr_t buf, u_int size,
-void (*freef)(void *, void *), void *arg1, void *arg2, int flags, int type)
+void (*freef)(void *, void *), void *arg1, void *arg2, int flags, int type,
+int wait)
 {
KASSERT(type != EXT_CLUSTER, ("%s: EXT_CLUSTER not allowed", __func__));
 
if (type != EXT_EXTREF)
-   mb->m_ext.ref_cnt = (u_int *)uma_zalloc(zone_ext_refcnt, 
M_NOWAIT);
-   if (mb->m_ext.ref_cnt != NULL) {
-   *(mb->m_ext.ref_cnt) = 1;
-   mb->m_flags |= (M_EXT | flags);
-   mb->m_ext.ext_buf = buf;
-   mb->m_data = mb->m_ext.ext_buf;
-   mb->m_ext.ext_size = size;
-   mb->m_ext.ext_free = freef;
-   mb->m_ext.ext_arg1 = arg1;
-   mb->m_ext.ext_arg2 = arg2;
-   mb->m_ext.ext_type = type;
-}
+   mb->m_ext.ref_cnt = uma_zalloc(zone_ext_refcnt, wait);
+
+   if (mb->m_ext.ref_cnt == NULL)
+   return (ENOMEM);
+
+   *(mb->m_ext.ref_cnt) = 1;
+   mb->m_flags |= (M_EXT | flags);
+   mb->m_ext.ext_buf = buf;
+   mb->m_data = mb->m_ext.ext_buf;
+   mb->m_ext.ext_size = size;
+   mb->m_ext.ext_free = freef;
+   mb->m_ext.ext_arg1 = arg1;
+   mb->m_ext.ext_arg2 = arg2;
+   mb->m_ext.ext_type = type;
+
+   return (0);
 }
 
 /*

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Tue Mar 12 12:10:32 2013(r248192)
+++ head/sys/sys/mbuf.h Tue Mar 12 12:12:16 2013(r248193)
@@ -655,7 +655,8 @@ m_last(struct mbuf *m)
 #defineMGETHDR(m, how, type)   ((m) = m_gethdr((how), (type)))
 #defineMCLGET(m, how)  m_clget((m), (how))
 #defineMEXTADD(m, buf, size, free, arg1, arg2, flags, type)
\
-m_extadd((m), (caddr_t)(buf), (size), (free),(arg1),(arg2),(flags), (type))
+(void )m_extadd((m), (caddr_t)(buf), (size), (free), (arg1), (arg2),\
+(flags), (type), M_NOWAIT)
 #definem_getm(m, len, how, type)   
\
 m_getm2((m), (len), (how), (type), M_PKTHDR)
 
@@ -780,8 +781,8 @@ int  m_apply(struct mbuf *, int, int,
int (*)(void *, void *, u_int), void *);
 int m_append(struct mbuf *, int, c_caddr_t);
 voidm_cat(struct mbuf *, struct mbuf *);
-voidm_extadd(struct mbuf *, caddr_t, u_int,
-   void (*)(void *, void *), void *, void *, int, int);
+int m_extadd(struct mbuf *, caddr_t, u_int,
+   void (*)(void *, void *), void *, void *, int, int, int);
 struct mbuf*m_collapse(struct mbuf *, int, int);
 voidm_copyback(struct mbuf *, int, int, c_caddr_t);
 voidm_copydata(const struct mbuf *, int, int, caddr_t);
___
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: r248194 - head/sys/kern

2013-03-12 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar 12 12:15:24 2013
New Revision: 248194
URL: http://svnweb.freebsd.org/changeset/base/248194

Log:
  In kern_sendfile() use m_extadd() instead of MEXTADD() macro, supplying
  appropriate wait argument and checking return value. Before this change
  m_extadd() could fail, and kern_sendfile() ignored that.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==
--- head/sys/kern/uipc_syscalls.c   Tue Mar 12 12:12:16 2013
(r248193)
+++ head/sys/kern/uipc_syscalls.c   Tue Mar 12 12:15:24 2013
(r248194)
@@ -,8 +,14 @@ retry_space:
sf_buf_mext((void *)sf_buf_kva(sf), sf);
break;
}
-   MEXTADD(m0, sf_buf_kva(sf), PAGE_SIZE, sf_buf_mext,
-   sfs, sf, M_RDONLY, EXT_SFBUF);
+   if (m_extadd(m0, (caddr_t )sf_buf_kva(sf), PAGE_SIZE,
+   sf_buf_mext, sfs, sf, M_RDONLY, EXT_SFBUF,
+   (mnw ? M_NOWAIT : M_WAITOK)) != 0) {
+   error = (mnw ? EAGAIN : ENOBUFS);
+   sf_buf_mext((void *)sf_buf_kva(sf), sf);
+   m_freem(m0);
+   break;
+   }
m0->m_data = (char *)sf_buf_kva(sf) + pgoff;
m0->m_len = xfsize;
 
___
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: r248195 - head/sys/rpc

2013-03-12 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar 12 12:17:19 2013
New Revision: 248195
URL: http://svnweb.freebsd.org/changeset/base/248195

Log:
  Use m_get(), m_gethdr() and m_getcl() instead of historic macros.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/rpc/clnt_dg.c
  head/sys/rpc/clnt_vc.c
  head/sys/rpc/rpc_generic.c
  head/sys/rpc/rpcm_subs.h
  head/sys/rpc/svc.c
  head/sys/rpc/svc_dg.c
  head/sys/rpc/svc_vc.c

Modified: head/sys/rpc/clnt_dg.c
==
--- head/sys/rpc/clnt_dg.c  Tue Mar 12 12:15:24 2013(r248194)
+++ head/sys/rpc/clnt_dg.c  Tue Mar 12 12:17:19 2013(r248195)
@@ -431,7 +431,7 @@ call_again:
 send_again:
mtx_unlock(&cs->cs_lock);
 
-   MGETHDR(mreq, M_WAITOK, MT_DATA);
+   mreq = m_gethdr(M_WAITOK, MT_DATA);
KASSERT(cu->cu_mcalllen <= MHLEN, ("RPC header too big"));
bcopy(cu->cu_mcallc, mreq->m_data, cu->cu_mcalllen);
mreq->m_len = cu->cu_mcalllen;

Modified: head/sys/rpc/clnt_vc.c
==
--- head/sys/rpc/clnt_vc.c  Tue Mar 12 12:15:24 2013(r248194)
+++ head/sys/rpc/clnt_vc.c  Tue Mar 12 12:17:19 2013(r248195)
@@ -349,7 +349,7 @@ call_again:
/*
 * Leave space to pre-pend the record mark.
 */
-   MGETHDR(mreq, M_WAITOK, MT_DATA);
+   mreq = m_gethdr(M_WAITOK, MT_DATA);
mreq->m_data += sizeof(uint32_t);
KASSERT(ct->ct_mpos + sizeof(uint32_t) <= MHLEN,
("RPC header too big"));

Modified: head/sys/rpc/rpc_generic.c
==
--- head/sys/rpc/rpc_generic.c  Tue Mar 12 12:15:24 2013(r248194)
+++ head/sys/rpc/rpc_generic.c  Tue Mar 12 12:17:19 2013(r248195)
@@ -750,9 +750,7 @@ clnt_call_private(
struct mbuf *mrep;
enum clnt_stat stat;
 
-   MGET(mreq, M_WAITOK, MT_DATA);
-   MCLGET(mreq, M_WAITOK);
-   mreq->m_len = 0;
+   mreq = m_getcl(M_WAITOK, MT_DATA, 0);
 
xdrmbuf_create(&xdrs, mreq, XDR_ENCODE);
if (!xargs(&xdrs, argsp)) {

Modified: head/sys/rpc/rpcm_subs.h
==
--- head/sys/rpc/rpcm_subs.hTue Mar 12 12:15:24 2013(r248194)
+++ head/sys/rpc/rpcm_subs.hTue Mar 12 12:17:19 2013(r248195)
@@ -80,7 +80,7 @@
 
 #definerpcm_build(a,c,s) \
{ if ((s) > M_TRAILINGSPACE(mb)) { \
-   MGET(mb2, M_WAITOK, MT_DATA); \
+   mb2 = m_get(M_WAITOK, MT_DATA); \
if ((s) > MLEN) \
panic("build > MLEN"); \
mb->m_next = mb2; \

Modified: head/sys/rpc/svc.c
==
--- head/sys/rpc/svc.c  Tue Mar 12 12:15:24 2013(r248194)
+++ head/sys/rpc/svc.c  Tue Mar 12 12:17:19 2013(r248195)
@@ -563,9 +563,7 @@ svc_sendreply(struct svc_req *rqstp, xdr
rply.acpted_rply.ar_results.where = NULL;
rply.acpted_rply.ar_results.proc = (xdrproc_t) xdr_void;
 
-   MGET(m, M_WAITOK, MT_DATA);
-   MCLGET(m, M_WAITOK);
-   m->m_len = 0;
+   m = m_getcl(M_WAITOK, MT_DATA, 0);
xdrmbuf_create(&xdrs, m, XDR_ENCODE);
ok = xdr_results(&xdrs, xdr_location);
XDR_DESTROY(&xdrs);

Modified: head/sys/rpc/svc_dg.c
==
--- head/sys/rpc/svc_dg.c   Tue Mar 12 12:15:24 2013(r248194)
+++ head/sys/rpc/svc_dg.c   Tue Mar 12 12:17:19 2013(r248195)
@@ -238,8 +238,7 @@ svc_dg_reply(SVCXPRT *xprt, struct rpc_m
bool_t stat = TRUE;
int error;
 
-   MGETHDR(mrep, M_WAITOK, MT_DATA);
-   mrep->m_len = 0;
+   mrep = m_gethdr(M_WAITOK, MT_DATA);
 
xdrmbuf_create(&xdrs, mrep, XDR_ENCODE);
 

Modified: head/sys/rpc/svc_vc.c
==
--- head/sys/rpc/svc_vc.c   Tue Mar 12 12:15:24 2013(r248194)
+++ head/sys/rpc/svc_vc.c   Tue Mar 12 12:17:19 2013(r248195)
@@ -796,8 +796,7 @@ svc_vc_reply(SVCXPRT *xprt, struct rpc_m
/*
 * Leave space for record mark.
 */
-   MGETHDR(mrep, M_WAITOK, MT_DATA);
-   mrep->m_len = 0;
+   mrep = m_gethdr(M_WAITOK, MT_DATA);
mrep->m_data += sizeof(uint32_t);
 
xdrmbuf_create(&xdrs, mrep, XDR_ENCODE);
@@ -850,8 +849,7 @@ svc_vc_backchannel_reply(SVCXPRT *xprt, 
/*
 * Leave space for record mark.
 */
-   MGETHDR(mrep, M_WAITOK, MT_DATA);
-   mrep->m_len = 0;
+   mrep = m_gethdr(M_WAITOK, MT_DATA);
mrep->m_data += sizeof(uint32_t);
 
xdrmbuf_create(&xdrs, mrep, XDR_ENCODE);
___
svn-src-head@f

svn commit: r248196 - head/sys/nfs

2013-03-12 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar 12 12:19:23 2013
New Revision: 248196
URL: http://svnweb.freebsd.org/changeset/base/248196

Log:
  Use m_get2() to get mbuf of appropriate size.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/nfs/krpc_subr.c

Modified: head/sys/nfs/krpc_subr.c
==
--- head/sys/nfs/krpc_subr.cTue Mar 12 12:17:19 2013(r248195)
+++ head/sys/nfs/krpc_subr.cTue Mar 12 12:19:23 2013(r248196)
@@ -459,9 +459,7 @@ xdr_string_encode(char *str, int len)
if (mlen > MCLBYTES)/* If too big, we just can't do it. */
return (NULL);
 
-   m = m_get(M_WAITOK, MT_DATA);
-   if (mlen > MLEN)
-   MCLGET(m, M_WAITOK);
+   m = m_get2(M_WAITOK, MT_DATA, 0, mlen);
xs = mtod(m, struct xdr_string *);
m->m_len = mlen;
xs->len = txdr_unsigned(len);
___
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: r248197 - head/sys/vm

2013-03-12 Thread Attilio Rao
Author: attilio
Date: Tue Mar 12 12:20:49 2013
New Revision: 248197
URL: http://svnweb.freebsd.org/changeset/base/248197

Log:
  Simplify vm_page_is_valid().
  
  Sponsored by: EMC / Isilon storage division
  Reviewed by:  alc

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Tue Mar 12 12:19:23 2013(r248196)
+++ head/sys/vm/vm_page.c   Tue Mar 12 12:20:49 2013(r248197)
@@ -2898,10 +2898,7 @@ vm_page_is_valid(vm_page_t m, int base, 
 
VM_OBJECT_ASSERT_WLOCKED(m->object);
bits = vm_page_bits(base, size);
-   if (m->valid && ((m->valid & bits) == bits))
-   return 1;
-   else
-   return 0;
+   return (m->valid != 0 && (m->valid & bits) == bits);
 }
 
 /*
___
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: r248198 - head/sys/nfsclient

2013-03-12 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar 12 12:23:47 2013
New Revision: 248198
URL: http://svnweb.freebsd.org/changeset/base/248198

Log:
  - Use m_get2() instead of nfsm_reqhead().
  - Use m_get(), m_getcl() instead of historic macros.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/nfsclient/nfs_subs.c
  head/sys/nfsclient/nfs_vfsops.c
  head/sys/nfsclient/nfs_vnops.c
  head/sys/nfsclient/nfsm_subs.h

Modified: head/sys/nfsclient/nfs_subs.c
==
--- head/sys/nfsclient/nfs_subs.c   Tue Mar 12 12:20:49 2013
(r248197)
+++ head/sys/nfsclient/nfs_subs.c   Tue Mar 12 12:23:47 2013
(r248198)
@@ -172,23 +172,6 @@ nfs_xid_gen(void)
 }
 
 /*
- * Create the header for an rpc request packet
- * The hsiz is the size of the rest of the nfs request header.
- * (just used to decide if a cluster is a good idea)
- */
-struct mbuf *
-nfsm_reqhead(struct vnode *vp, u_long procid, int hsiz)
-{
-   struct mbuf *mb;
-
-   MGET(mb, M_WAITOK, MT_DATA);
-   if (hsiz >= MINCLSIZE)
-   MCLGET(mb, M_WAITOK);
-   mb->m_len = 0;
-   return (mb);
-}
-
-/*
  * copies a uio scatter/gather list to an mbuf chain.
  * NOTE: can ony handle iovcnt == 1
  */
@@ -218,10 +201,10 @@ nfsm_uiotombuf(struct uio *uiop, struct 
while (left > 0) {
mlen = M_TRAILINGSPACE(mp);
if (mlen == 0) {
-   MGET(mp, M_WAITOK, MT_DATA);
if (clflg)
-   MCLGET(mp, M_WAITOK);
-   mp->m_len = 0;
+   mp = m_getcl(M_WAITOK, MT_DATA, 0);
+   else
+   mp = m_get(M_WAITOK, MT_DATA);
mp2->m_next = mp;
mp2 = mp;
mlen = M_TRAILINGSPACE(mp);
@@ -251,8 +234,7 @@ nfsm_uiotombuf(struct uio *uiop, struct 
}
if (rem > 0) {
if (rem > M_TRAILINGSPACE(mp)) {
-   MGET(mp, M_WAITOK, MT_DATA);
-   mp->m_len = 0;
+   mp = m_get(M_WAITOK, MT_DATA);
mp2->m_next = mp;
}
cp = mtod(mp, caddr_t)+mp->m_len;
@@ -296,10 +278,13 @@ nfsm_strtmbuf(struct mbuf **mb, char **b
}
/* Loop around adding mbufs */
while (siz > 0) {
-   MGET(m1, M_WAITOK, MT_DATA);
-   if (siz > MLEN)
-   MCLGET(m1, M_WAITOK);
-   m1->m_len = NFSMSIZ(m1);
+   if (siz > MLEN) {
+   m1 = m_getcl(M_WAITOK, MT_DATA, 0);
+   m1->m_len = MCLBYTES;
+   } else {
+   m1 = m_get(M_WAITOK, MT_DATA);
+   m1->m_len = MLEN;
+   }
m2->m_next = m1;
m2 = m1;
tl = mtod(m1, u_int32_t *);

Modified: head/sys/nfsclient/nfs_vfsops.c
==
--- head/sys/nfsclient/nfs_vfsops.c Tue Mar 12 12:20:49 2013
(r248197)
+++ head/sys/nfsclient/nfs_vfsops.c Tue Mar 12 12:23:47 2013
(r248198)
@@ -298,7 +298,7 @@ nfs_statfs(struct mount *mp, struct stat
} else
mtx_unlock(&nmp->nm_mtx);
nfsstats.rpccnt[NFSPROC_FSSTAT]++;
-   mreq = nfsm_reqhead(vp, NFSPROC_FSSTAT, NFSX_FH(v3));
+   mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3));
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
@@ -356,7 +356,7 @@ nfs_fsinfo(struct nfsmount *nmp, struct 
u_int64_t maxfsize;

nfsstats.rpccnt[NFSPROC_FSINFO]++;
-   mreq = nfsm_reqhead(vp, NFSPROC_FSINFO, NFSX_FH(1));
+   mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(1));
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, 1);

Modified: head/sys/nfsclient/nfs_vnops.c
==
--- head/sys/nfsclient/nfs_vnops.c  Tue Mar 12 12:20:49 2013
(r248197)
+++ head/sys/nfsclient/nfs_vnops.c  Tue Mar 12 12:23:47 2013
(r248198)
@@ -294,7 +294,7 @@ nfs3_access_otw(struct vnode *vp, int wm
struct nfsnode *np = VTONFS(vp);
 
nfsstats.rpccnt[NFSPROC_ACCESS]++;
-   mreq = nfsm_reqhead(vp, NFSPROC_ACCESS, NFSX_FH(v3) + NFSX_UNSIGNED);
+   mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3) + NFSX_UNSIGNED);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
@@ -714,7 +714,7 @@ nfs_getattr(struct vop_getattr_args *ap)
goto nfsmout;
}
nfsstats.rpccnt[NFSPROC_GETATTR]++;
-   mreq = nfsm_reqhead(vp, NFSPROC_GETATTR, NFSX_FH(v3));
+   mreq = m_get2(M_WAITOK, MT_DATA,

svn commit: r248200 - head/games/fortune/datfiles

2013-03-12 Thread John Baldwin
Author: jhb
Date: Tue Mar 12 12:35:02 2013
New Revision: 248200
URL: http://svnweb.freebsd.org/changeset/base/248200

Log:
  Remove fortunes-o from the base system.  Debating what does or does not
  belong in this file is not a useful exercise or conducive to producing a
  high quality advanced operating system.
  
  While here, simplify the make rules to autocompute BLDS and FILES from a
  single DB variable.
  
  Approved by:  core
  MFC after:1 week

Deleted:
  head/games/fortune/datfiles/fortunes-o.fake
  head/games/fortune/datfiles/fortunes-o.real
  head/games/fortune/datfiles/fortunes-o.sp.ok
Modified:
  head/games/fortune/datfiles/Makefile

Modified: head/games/fortune/datfiles/Makefile
==
--- head/games/fortune/datfiles/MakefileTue Mar 12 12:33:50 2013
(r248199)
+++ head/games/fortune/datfiles/MakefileTue Mar 12 12:35:02 2013
(r248200)
@@ -1,37 +1,22 @@
 #  @(#)Makefile8.2 (Berkeley) 4/19/94
 # $FreeBSD$
 
-FILES= fortunes freebsd-tips murphy startrek zippy
-BLDS=  fortunes.dat murphy.dat startrek.dat zippy.dat \
-   fortunes-o fortunes-o.dat freebsd-tips.dat
+DB=fortunes freebsd-tips murphy startrek zippy
 
 # TO AVOID INSTALLING THE POTENTIALLY OFFENSIVE FORTUNES, COMMENT OUT THE
-# THREE LINES AND UNCOMMENT THE FOURTH LINE.
+# NEXT LINE.
+DB+=   limerick murphy-o gerrold.limerick
 
-# THE THREE LINES:
-FILES+=limerick murphy-o gerrold.limerick
-BLDS+= limerick.dat murphy-o.dat gerrold.limerick.dat
-TYPE=  real
-
-# THE FOURTH LINE:
-#TYPE= fake
-
-FILES+=${BLDS}
+BLDS=  ${DB:S/$/.dat/}
+FILES= ${DB} ${BLDS}
 CLEANFILES+=${BLDS}
 
 FILESDIR=  ${SHAREDIR}/games/fortune
 
-.for f in fortunes freebsd-tips gerrold.limerick limerick murphy murphy-o 
startrek zippy
+.for f in ${DB}
 $f.dat: $f
PATH=$$PATH:/usr/games:${.OBJDIR}/../strfile \
strfile -Cs ${.ALLSRC} ${.TARGET}
 .endfor
 
-fortunes-o.dat: fortunes-o
-   PATH=$$PATH:/usr/games:${.OBJDIR}/../strfile \
-   strfile -Csx ${.ALLSRC} ${.TARGET}
-
-fortunes-o: fortunes-o.${TYPE}
-   LC_ALL=C tr a-zA-Z n-za-mN-ZA-M < ${.ALLSRC} > ${.TARGET}
-
 .include 
___
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: r248201 - head/share/misc

2013-03-12 Thread Eitan Adler
Author: eadler
Date: Tue Mar 12 13:03:31 2013
New Revision: 248201
URL: http://svnweb.freebsd.org/changeset/base/248201

Log:
  Update Ruslan's last name per request.
  
  Submitted by: rm

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotTue Mar 12 12:35:02 2013
(r248200)
+++ head/share/misc/committers-ports.dotTue Mar 12 13:03:31 2013
(r248201)
@@ -171,7 +171,7 @@ philip [label="Philip Paeps\nphilip@Free
 rafan [label="Rong-En Fan\nra...@freebsd.org\n2006/06/23"]
 rakuco [label="Raphael Kubo da Costa\nrak...@freebsd.org\n2011/08/22"]
 rene [label="Rene Ladan\nr...@freebsd.org\n2010/04/11"]
-rm [label="Ruslan Mahmatkhanov\n...@freebsd.org\n2011/11/06"]
+rm [label="Ruslan Makhmatkhanov\n...@freebsd.org\n2011/11/06"]
 rnoland [label="Robert Noland\nrnol...@freebsd.org\n2008/07/21"]
 romain [label="Romain Tartiere\nrom...@freebsd.org\n2010/01/24"]
 sahil [label="Sahil Tandon\nsa...@freebsd.org\n2010/04/11"]
___
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: r248207 - in head/sys: arm/at91 kern net netinet/libalias netpfil/pf nfs nfsclient sys

2013-03-12 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar 12 13:42:47 2013
New Revision: 248207
URL: http://svnweb.freebsd.org/changeset/base/248207

Log:
  Functions m_getm2() and m_get2() have different order of arguments,
  and that can drive someone crazy. While m_get2() is young and not
  documented yet, change its order of arguments to match m_getm2().
  
  Sorry for churn, but better now than later.

Modified:
  head/sys/arm/at91/if_ate.c
  head/sys/kern/uipc_mbuf.c
  head/sys/net/bpf.c
  head/sys/netinet/libalias/alias.c
  head/sys/netpfil/pf/if_pfsync.c
  head/sys/nfs/krpc_subr.c
  head/sys/nfsclient/nfs_vfsops.c
  head/sys/nfsclient/nfs_vnops.c
  head/sys/sys/mbuf.h

Modified: head/sys/arm/at91/if_ate.c
==
--- head/sys/arm/at91/if_ate.c  Tue Mar 12 13:29:24 2013(r248206)
+++ head/sys/arm/at91/if_ate.c  Tue Mar 12 13:42:47 2013(r248207)
@@ -900,8 +900,8 @@ ate_intr(void *xsc)
remain = (sc->rx_descs[idx].status & ETH_LEN_MASK) - 4;
 
/* Get an appropriately sized mbuf. */
-   mb = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR,
-   remain + ETHER_ALIGN);
+   mb = m_get2(remain + ETHER_ALIGN, M_NOWAIT, MT_DATA,
+   M_PKTHDR);
if (mb == NULL) {
sc->ifp->if_iqdrops++;
rxdhead->status = 0;

Modified: head/sys/kern/uipc_mbuf.c
==
--- head/sys/kern/uipc_mbuf.c   Tue Mar 12 13:29:24 2013(r248206)
+++ head/sys/kern/uipc_mbuf.c   Tue Mar 12 13:42:47 2013(r248207)
@@ -88,7 +88,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, m_defrag
  * m_get2() allocates minimum mbuf that would fit "size" argument.
  */
 struct mbuf *
-m_get2(int how, short type, int flags, int size)
+m_get2(int size, int how, short type, int flags)
 {
struct mb_args args;
struct mbuf *m, *n;

Modified: head/sys/net/bpf.c
==
--- head/sys/net/bpf.c  Tue Mar 12 13:29:24 2013(r248206)
+++ head/sys/net/bpf.c  Tue Mar 12 13:42:47 2013(r248207)
@@ -525,7 +525,7 @@ bpf_movein(struct uio *uio, int linktype
if (len < hlen || len - hlen > ifp->if_mtu)
return (EMSGSIZE);
 
-   m = m_get2(M_WAITOK, MT_DATA, M_PKTHDR, len);
+   m = m_get2(len, M_WAITOK, MT_DATA, M_PKTHDR);
if (m == NULL)
return (EIO);
m->m_pkthdr.len = m->m_len = len;

Modified: head/sys/netinet/libalias/alias.c
==
--- head/sys/netinet/libalias/alias.c   Tue Mar 12 13:29:24 2013
(r248206)
+++ head/sys/netinet/libalias/alias.c   Tue Mar 12 13:42:47 2013
(r248207)
@@ -1760,7 +1760,7 @@ m_megapullup(struct mbuf *m, int len) {
if (m->m_next == NULL && M_WRITABLE(m) && M_TRAILINGSPACE(m) >= RESERVE)
return (m);
 
-   mcl = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, len + RESERVE);
+   mcl = m_get2(len + RESERVE, M_NOWAIT, MT_DATA, M_PKTHDR);
if (mcl == NULL)
goto bad;
  

Modified: head/sys/netpfil/pf/if_pfsync.c
==
--- head/sys/netpfil/pf/if_pfsync.c Tue Mar 12 13:29:24 2013
(r248206)
+++ head/sys/netpfil/pf/if_pfsync.c Tue Mar 12 13:42:47 2013
(r248207)
@@ -1505,7 +1505,7 @@ pfsync_sendout(int schedswi)
return;
}
 
-   m = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, max_linkhdr + sc->sc_len);
+   m = m_get2(max_linkhdr + sc->sc_len, M_NOWAIT, MT_DATA, M_PKTHDR);
if (m == NULL) {
sc->sc_ifp->if_oerrors++;
V_pfsyncstats.pfsyncs_onomem++;

Modified: head/sys/nfs/krpc_subr.c
==
--- head/sys/nfs/krpc_subr.cTue Mar 12 13:29:24 2013(r248206)
+++ head/sys/nfs/krpc_subr.cTue Mar 12 13:42:47 2013(r248207)
@@ -459,7 +459,7 @@ xdr_string_encode(char *str, int len)
if (mlen > MCLBYTES)/* If too big, we just can't do it. */
return (NULL);
 
-   m = m_get2(M_WAITOK, MT_DATA, 0, mlen);
+   m = m_get2(mlen, M_WAITOK, MT_DATA, 0);
xs = mtod(m, struct xdr_string *);
m->m_len = mlen;
xs->len = txdr_unsigned(len);

Modified: head/sys/nfsclient/nfs_vfsops.c
==
--- head/sys/nfsclient/nfs_vfsops.c Tue Mar 12 13:29:24 2013
(r248206)
+++ head/sys/nfsclient/nfs_vfsops.c Tue Mar 12 13:42:47 2013
(r248207)
@@ -298,7 +298,7 @@ nfs_statfs(struct mount *mp, struct stat
} else
mtx_unlock(&nmp->nm_mtx);
nfsstat

svn commit: r248209 - head/sys

2013-03-12 Thread Bryan Venteicher
Author: bryanv
Date: Tue Mar 12 14:21:52 2013
New Revision: 248209
URL: http://svnweb.freebsd.org/changeset/base/248209

Log:
  Remove netncp cscope entry missed in r248097
  
  Reviewed by:  attilio

Modified:
  head/sys/Makefile

Modified: head/sys/Makefile
==
--- head/sys/Makefile   Tue Mar 12 13:46:30 2013(r248208)
+++ head/sys/Makefile   Tue Mar 12 14:21:52 2013(r248209)
@@ -10,7 +10,7 @@ SUBDIR=   boot
 # Directories to include in cscope name file and TAGS.
 CSCOPEDIRS=boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \
geom gnu isa kern libkern modules net net80211 netatalk \
-   netgraph netinet netinet6 netipsec netipx netnatm netncp \
+   netgraph netinet netinet6 netipsec netipx netnatm \
netsmb nfs nfsclient nfsserver nlm ofed opencrypto \
pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR}
 .if !defined(CSCOPE_ARCHDIR)
___
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: r248196 - head/sys/nfs

2013-03-12 Thread Andre Oppermann

On 12.03.2013 13:19, Gleb Smirnoff wrote:

Author: glebius
Date: Tue Mar 12 12:19:23 2013
New Revision: 248196
URL: http://svnweb.freebsd.org/changeset/base/248196

Log:
   Use m_get2() to get mbuf of appropriate size.


The problem with m_get2() is that it will attempt to use jumbo mbufs
larger than PAGE_SIZE if the request size is sufficiently large.

In light of the recent issues with jumbo > PAGE_SIZE allocations on
loaded systems I don't think it is appropriate to extend this practice
further.

Anything that needs more than PAGE_SIZE (where PAGE_SIZE == 4K) mbuf
space should allocate an mbuf chain with m_getm2().  That is what we
have mbuf chains for.

Sufficient availability of mbufs > PAGE_SIZE cannot be guaranteed after
some uptime and/or a loaded system due to memory fragmentation.  Allocation
can fail non-deterministically for mbufs > PAGE_SIZE long before smaller
mbufs become unavailable due to overall (kernel) memory exhaustion.

Mbufs > PAGE_SIZE are not only contiguous in kernel address space but
also in real memory address space.  They are intended jumbo frames on
poor NIC's without scatter-capable DMA engines.

When you put the m_get2() function proposal for review and comments I
already highlighted these issues and put forward serious concerns about
this.

Please change m_get2() to limit itself to mbuf allocations <= PAGE_SIZE.

--
Andre

Please note that I applaud your general clean up of mbuf related allocation
functions and users thereof. :-)

___
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: r248210 - head/sys/sys

2013-03-12 Thread Attilio Rao
Author: attilio
Date: Tue Mar 12 14:30:36 2013
New Revision: 248210
URL: http://svnweb.freebsd.org/changeset/base/248210

Log:
  Bump __FreeBSD_version after r248084, breaking VM KPI to introduce
  read/write lockers.
  
  Sponsored by: EMC / Isilon storage division
  Requested by: flo

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hTue Mar 12 14:21:52 2013(r248209)
+++ head/sys/sys/param.hTue Mar 12 14:30:36 2013(r248210)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 129  /* Master, propagated to newvers */
+#define __FreeBSD_version 130  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
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: r248196 - head/sys/nfs

2013-03-12 Thread Gleb Smirnoff
  Andre,

On Tue, Mar 12, 2013 at 03:23:16PM +0100, Andre Oppermann wrote:
A> On 12.03.2013 13:19, Gleb Smirnoff wrote:
A> > Author: glebius
A> > Date: Tue Mar 12 12:19:23 2013
A> > New Revision: 248196
A> > URL: http://svnweb.freebsd.org/changeset/base/248196
A> >
A> > Log:
A> >Use m_get2() to get mbuf of appropriate size.
A> 
A> The problem with m_get2() is that it will attempt to use jumbo mbufs
A> larger than PAGE_SIZE if the request size is sufficiently large.
A> 
A> In light of the recent issues with jumbo > PAGE_SIZE allocations on
A> loaded systems I don't think it is appropriate to extend this practice
A> further.
A> 
A> Anything that needs more than PAGE_SIZE (where PAGE_SIZE == 4K) mbuf
A> space should allocate an mbuf chain with m_getm2().  That is what we
A> have mbuf chains for.
A> 
A> Sufficient availability of mbufs > PAGE_SIZE cannot be guaranteed after
A> some uptime and/or a loaded system due to memory fragmentation.  Allocation
A> can fail non-deterministically for mbufs > PAGE_SIZE long before smaller
A> mbufs become unavailable due to overall (kernel) memory exhaustion.
A> 
A> Mbufs > PAGE_SIZE are not only contiguous in kernel address space but
A> also in real memory address space.  They are intended jumbo frames on
A> poor NIC's without scatter-capable DMA engines.
A> 
A> When you put the m_get2() function proposal for review and comments I
A> already highlighted these issues and put forward serious concerns about
A> this.
A> 
A> Please change m_get2() to limit itself to mbuf allocations <= PAGE_SIZE.

I already got similar patch in my queue. We have a lot of code that could
benefit from using both m_get2() and m_getm2() that are limited to not
use jumbos at all.

If you are concerned about using jumbos that are > PAGE_SIZE, then I can
extend API in my patch.  ... done.

Patch attached.

The NFS code itself guarantees that it won't request > than MCLBYTES,
so using bare m_get2() here is safe. I can add flag there later for
clarity.

-- 
Totus tuus, Glebius.
Index: kern/uipc_mbuf.c
===
--- kern/uipc_mbuf.c	(revision 248207)
+++ kern/uipc_mbuf.c	(working copy)
@@ -93,15 +93,20 @@ m_get2(int size, int how, short type, int flags)
 	struct mb_args args;
 	struct mbuf *m, *n;
 	uma_zone_t zone;
+	int nojumbos, pgjumbos;
 
-	args.flags = flags;
+	nojumbos = (flags & M_NOJUMBO) ? 1 : 0;
+	pgjumbos = (flags & M_PGJUMBONLY) ? 1 : 0;
+
+	args.flags = flags & (M_PKTHDR | M_EOR);
 	args.type = type;
 
 	if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0))
 		return (uma_zalloc_arg(zone_mbuf, &args, how));
 	if (size <= MCLBYTES)
 		return (uma_zalloc_arg(zone_pack, &args, how));
-	if (size > MJUM16BYTES)
+
+	if (nojumbos || (pgjumbos && size > MJUMPAGESIZE) || size > MJUM16BYTES)
 		return (NULL);
 
 	m = uma_zalloc_arg(zone_mbuf, &args, how);
@@ -168,9 +173,12 @@ struct mbuf *
 m_getm2(struct mbuf *m, int len, int how, short type, int flags)
 {
 	struct mbuf *mb, *nm = NULL, *mtail = NULL;
+	int usejumbos;
 
 	KASSERT(len >= 0, ("%s: len is < 0", __func__));
 
+	usejumbos = (flags & M_NOJUMBO) ? 0 : 1;
+
 	/* Validate flags. */
 	flags &= (M_PKTHDR | M_EOR);
 
@@ -180,7 +188,7 @@ m_getm2(struct mbuf *m, int len, int how, short ty
 
 	/* Loop and append maximum sized mbufs to the chain tail. */
 	while (len > 0) {
-		if (len > MCLBYTES)
+		if (usejumbos && len > MCLBYTES)
 			mb = m_getjcl(how, type, (flags & M_PKTHDR),
 			MJUMPAGESIZE);
 		else if (len >= MINCLSIZE)
Index: sys/mbuf.h
===
--- sys/mbuf.h	(revision 248207)
+++ sys/mbuf.h	(working copy)
@@ -206,6 +206,13 @@ struct mbuf {
 #define	M_HASHTYPEBITS	0x0F00 /* mask of bits holding flowid hash type */
 
 /*
+ * Flags to pass with mbuf flags to some functions, not written in
+ * an mbuf itself.
+ */
+#define	M_NOJUMBO	M_PROTO1
+#define	M_PGJUMBONLY	M_PROTO2
+
+/*
  * For RELENG_{6,7} steal these flags for limited multiple routing table
  * support. In RELENG_8 and beyond, use just one flag and a tag.
  */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r248196 - head/sys/nfs

2013-03-12 Thread Andre Oppermann

On 12.03.2013 16:00, Gleb Smirnoff wrote:

   Andre,

On Tue, Mar 12, 2013 at 03:23:16PM +0100, Andre Oppermann wrote:
A> On 12.03.2013 13:19, Gleb Smirnoff wrote:
A> > Author: glebius
A> > Date: Tue Mar 12 12:19:23 2013
A> > New Revision: 248196
A> > URL: http://svnweb.freebsd.org/changeset/base/248196
A> >
A> > Log:
A> >Use m_get2() to get mbuf of appropriate size.
A>
A> The problem with m_get2() is that it will attempt to use jumbo mbufs
A> larger than PAGE_SIZE if the request size is sufficiently large.
A>
A> In light of the recent issues with jumbo > PAGE_SIZE allocations on
A> loaded systems I don't think it is appropriate to extend this practice
A> further.
A>
A> Anything that needs more than PAGE_SIZE (where PAGE_SIZE == 4K) mbuf
A> space should allocate an mbuf chain with m_getm2().  That is what we
A> have mbuf chains for.
A>
A> Sufficient availability of mbufs > PAGE_SIZE cannot be guaranteed after
A> some uptime and/or a loaded system due to memory fragmentation.  Allocation
A> can fail non-deterministically for mbufs > PAGE_SIZE long before smaller
A> mbufs become unavailable due to overall (kernel) memory exhaustion.
A>
A> Mbufs > PAGE_SIZE are not only contiguous in kernel address space but
A> also in real memory address space.  They are intended jumbo frames on
A> poor NIC's without scatter-capable DMA engines.
A>
A> When you put the m_get2() function proposal for review and comments I
A> already highlighted these issues and put forward serious concerns about
A> this.
A>
A> Please change m_get2() to limit itself to mbuf allocations <= PAGE_SIZE.

I already got similar patch in my queue. We have a lot of code that could
benefit from using both m_get2() and m_getm2() that are limited to not
use jumbos at all.


Indeed.  That's why I applaud your work in converting them.


If you are concerned about using jumbos that are > PAGE_SIZE, then I can
extend API in my patch.  ... done.

Patch attached.

The NFS code itself guarantees that it won't request > than MCLBYTES,
so using bare m_get2() here is safe. I can add flag there later for
clarity.


Using PAGE_SIZE clusters is perfectly fine and no flag to prevent that
is necessary.  In fact we're doing it for years on socket writes without
complaints (through m_getm2()).

However I think that m_get2() should never ever even try to attempt to
allocate mbuf clusters larger than PAGE_SIZE.  Not even with flags.

All mbufs > PAGE_SIZE should be exclusively and only ever be used by drivers
for NIC's with "challenged" DMA engines.  Possibly only available through a
dedicated API to prevent all other uses of it.

--
Andre

___
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: r248196 - head/sys/nfs

2013-03-12 Thread Gleb Smirnoff
On Tue, Mar 12, 2013 at 04:31:05PM +0100, Andre Oppermann wrote:
A> > If you are concerned about using jumbos that are > PAGE_SIZE, then I can
A> > extend API in my patch.  ... done.
A> >
A> > Patch attached.
A> >
A> > The NFS code itself guarantees that it won't request > than MCLBYTES,
A> > so using bare m_get2() here is safe. I can add flag there later for
A> > clarity.
A> 
A> Using PAGE_SIZE clusters is perfectly fine and no flag to prevent that
A> is necessary.  In fact we're doing it for years on socket writes without
A> complaints (through m_getm2()).

mbuf usage isn't limited to sockets. There is some code that right now utilizes
only mbufs and standard clusters, netipsec for example.

I'd like to remove a lot of handmade mbuf allocating, in different places in
kernel and this can be done with M_NOJUMBO flag. I don't have time to dig more
deep into large chunks of code trying to understand whether it is possible to
convert them into using PAGE_SIZE clusters or not, I just want to reduce
amount of pasted hand allocating.

We have very common case when we allocate either mbuf or mbuf + cluster,
depending on size. Everywhere this is made by hand, but can be substituted
with m_get2(len, ..., M_NOJUMBO);

A> However I think that m_get2() should never ever even try to attempt to
A> allocate mbuf clusters larger than PAGE_SIZE.  Not even with flags.
A> 
A> All mbufs > PAGE_SIZE should be exclusively and only ever be used by drivers
A> for NIC's with "challenged" DMA engines.  Possibly only available through a
A> dedicated API to prevent all other uses of it.

Have you done any benchmarking that proves that scatter-gather on the level of
busdma is any worse than chaining on mbuf level?

Dealing with contiguous in virtual memory mbuf is handy, for protocols that
look through entire payload, for example pfsync. I guess NFS may also benefit
from that.

P.S. Ok about the patch?

-- 
Totus tuus, Glebius.
___
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: r248196 - head/sys/nfs

2013-03-12 Thread Andre Oppermann

On 12.03.2013 16:50, Gleb Smirnoff wrote:

On Tue, Mar 12, 2013 at 04:31:05PM +0100, Andre Oppermann wrote:
A> > If you are concerned about using jumbos that are > PAGE_SIZE, then I can
A> > extend API in my patch.  ... done.
A> >
A> > Patch attached.
A> >
A> > The NFS code itself guarantees that it won't request > than MCLBYTES,
A> > so using bare m_get2() here is safe. I can add flag there later for
A> > clarity.
A>
A> Using PAGE_SIZE clusters is perfectly fine and no flag to prevent that
A> is necessary.  In fact we're doing it for years on socket writes without
A> complaints (through m_getm2()).

mbuf usage isn't limited to sockets. There is some code that right now utilizes
only mbufs and standard clusters, netipsec for example.


Yes, I understand that.


I'd like to remove a lot of handmade mbuf allocating, in different places in
kernel and this can be done with M_NOJUMBO flag. I don't have time to dig more
deep into large chunks of code trying to understand whether it is possible to
convert them into using PAGE_SIZE clusters or not, I just want to reduce
amount of pasted hand allocating.


Reducing the amount of hand allocation is very good.


We have very common case when we allocate either mbuf or mbuf + cluster,
depending on size. Everywhere this is made by hand, but can be substituted
with m_get2(len, ..., M_NOJUMBO);


I guess what I'm trying to say is that not wanting jumbo > PAGE_SIZE is
normal and shouldn't be specified all the time.

This makes the API look like this:

 m_get2(len, ..., 0);   /* w/o flags I get at most MJUMPAGESIZE */

If someone really, really, really knows what he is doing he can say
he wants jumbo > PAGE_SIZE returned with M_JUMBOOK or such.  However
IMHO even that shouldn't be offered and m_getm2() should be used for
a chain.


A> However I think that m_get2() should never ever even try to attempt to
A> allocate mbuf clusters larger than PAGE_SIZE.  Not even with flags.
A>
A> All mbufs > PAGE_SIZE should be exclusively and only ever be used by drivers
A> for NIC's with "challenged" DMA engines.  Possibly only available through a
A> dedicated API to prevent all other uses of it.

Have you done any benchmarking that proves that scatter-gather on the level of
busdma is any worse than chaining on mbuf level?


The problem is different.  With our current jumbo mbufs > PAGE_SIZE there
isn't any scatter-gather at busdma level because they are contiguous at
physical *and* KVA level.  Allocating such jumbo mbufs shifts the burden
of mbuf chains to the VM and pmap layer in trying to come up with such
contiguous patches of physical memory.  This fails quickly after some
activity and memory fragmentation on the machine as we've seen in recent
days even with 96GB of RAM available.  It gets worse the more load the
machine has.  Which is exactly what we *don't* want.


Dealing with contiguous in virtual memory mbuf is handy, for protocols that
look through entire payload, for example pfsync. I guess NFS may also benefit
from that.


Of course it is handy.  However that carries other tradeoffs, some significant,
in other parts of the system.  And then for incoming packets it depends on the
MTU size.  For NFS, as far as I've read through the code today, the control
messages tend to be rather small.  The vast bulk of the data is transported
between mbuf and VFS/filesystem.


P.S. Ok about the patch?


No.  m_getm2() doesn't need the flag at all.  PAGE_SIZE mbufs are always
good.  Calling m_get2() without flag should return at most a PAGE_SIZE
mbuf.  The (ab)use of M_PROTO1|2 flags is icky and may conflict with
protocol specific uses.

--
Andre

___
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: r248214 - head/usr.bin/grep/regex

2013-03-12 Thread Mark Johnston
Author: markj
Date: Tue Mar 12 19:18:10 2013
New Revision: 248214
URL: http://svnweb.freebsd.org/changeset/base/248214

Log:
  Revert r246917, as it is causing incorrect behaviour as reported on
  freebsd-current.
  
  PR:   bin/175213
  Approved by:  emaste (co-mentor)

Modified:
  head/usr.bin/grep/regex/tre-fastmatch.c

Modified: head/usr.bin/grep/regex/tre-fastmatch.c
==
--- head/usr.bin/grep/regex/tre-fastmatch.c Tue Mar 12 18:57:12 2013
(r248213)
+++ head/usr.bin/grep/regex/tre-fastmatch.c Tue Mar 12 19:18:10 2013
(r248214)
@@ -103,7 +103,7 @@ static int  fastcmp(const fastmatch_t *fg
   ((!fg->reversed  \
 ? ((type == STR_WIDE) ? ((j + fg->wlen) > len) \
  : ((j + fg->len) > len))  \
-: (j <= 0)))
+: (j < 0)))
 
 /*
  * Checks whether the new position after shifting in the input string
___
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: r248196 - head/sys/nfs

2013-03-12 Thread Gleb Smirnoff
  Andre,

On Tue, Mar 12, 2013 at 05:33:04PM +0100, Andre Oppermann wrote:
A> > We have very common case when we allocate either mbuf or mbuf + cluster,
A> > depending on size. Everywhere this is made by hand, but can be substituted
A> > with m_get2(len, ..., M_NOJUMBO);
A> 
A> I guess what I'm trying to say is that not wanting jumbo > PAGE_SIZE is
A> normal and shouldn't be specified all the time.
A> 
A> This makes the API look like this:
A> 
A>   m_get2(len, ..., 0);   /* w/o flags I get at most MJUMPAGESIZE */
A> 
A> If someone really, really, really knows what he is doing he can say
A> he wants jumbo > PAGE_SIZE returned with M_JUMBOOK or such.  However
A> IMHO even that shouldn't be offered and m_getm2() should be used for
A> a chain.

Once again: there are cases when chain is not anticipated, a single
contigous mbuf is.

A> > A> However I think that m_get2() should never ever even try to attempt to
A> > A> allocate mbuf clusters larger than PAGE_SIZE.  Not even with flags.
A> > A>
A> > A> All mbufs > PAGE_SIZE should be exclusively and only ever be used by 
drivers
A> > A> for NIC's with "challenged" DMA engines.  Possibly only available 
through a
A> > A> dedicated API to prevent all other uses of it.
A> >
A> > Have you done any benchmarking that proves that scatter-gather on the 
level of
A> > busdma is any worse than chaining on mbuf level?
A> 
A> The problem is different.  With our current jumbo mbufs > PAGE_SIZE there
A> isn't any scatter-gather at busdma level because they are contiguous at
A> physical *and* KVA level.  Allocating such jumbo mbufs shifts the burden
A> of mbuf chains to the VM and pmap layer in trying to come up with such
A> contiguous patches of physical memory.  This fails quickly after some
A> activity and memory fragmentation on the machine as we've seen in recent
A> days even with 96GB of RAM available.  It gets worse the more load the
A> machine has.  Which is exactly what we *don't* want.

I somehow missed the r174247. How did that work since jumbo clusters were
introduced and up to r174247 (3 years)?

AFAIK, it worked fine before jumbos were not physically contigous. Most
modern NICs can use several descriptors per one packet, and that's what
we do when using PAGE_SIZE clusters. But we arm it manually. With a virtually
contigous single mbuf we can just do bus_dmamap_load_mbuf_sg() and do not
care about physical continuity in the stack and upper part of a driver.

I should probably consult gallatin@ and youngari@ on this.

A> > Dealing with contiguous in virtual memory mbuf is handy, for protocols that
A> > look through entire payload, for example pfsync. I guess NFS may also 
benefit
A> > from that.
A> 
A> Of course it is handy.  However that carries other tradeoffs, some 
significant,
A> in other parts of the system.  And then for incoming packets it depends on 
the
A> MTU size.  For NFS, as far as I've read through the code today, the control
A> messages tend to be rather small.  The vast bulk of the data is transported
A> between mbuf and VFS/filesystem.
A> 
A> > P.S. Ok about the patch?
A> 
A> No.  m_getm2() doesn't need the flag at all.  PAGE_SIZE mbufs are always
A> good.

Let me repeat: there is a lot of code, that does handmade allocation of
an mbuf chain of an arbitrary length using mbufs and common clusters. This
code can be cut and use m_getm2(), if we can restrict it to avoid page size
clusters. I don't have time to dig deeper in the code and analyze and test
whether it can support page sized clusters in chains.

Example: netipsec/key.c:key_alloc_mbuf().

A> Calling m_get2() without flag should return at most a PAGE_SIZE
A> mbuf.

This is not logical. A default limit in the middle of possible values
isn't logical.

A> The (ab)use of M_PROTO1|2 flags is icky and may conflict with
A> protocol specific uses.

Please review the patch. The flag isn't stored anywhere, it is just
extension of m_getm2() and m_get2() API.

-- 
Totus tuus, Glebius.
___
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: r247814 - in head: . sys/amd64/conf sys/cam/ctl sys/conf sys/i386/conf

2013-03-12 Thread Pawel Jakub Dawidek
On Mon, Mar 04, 2013 at 09:18:45PM +, Kenneth D. Merry wrote:
> Author: ken
> Date: Mon Mar  4 21:18:45 2013
> New Revision: 247814
> URL: http://svnweb.freebsd.org/changeset/base/247814
> 
> Log:
>   Re-enable CTL in GENERIC on i386 and amd64, but turn on the CTL disable
>   tunable by default.
>   
>   This will allow GENERIC configurations to boot on small memory boxes, but
>   not require end users who want to use CTL to recompile their kernel.  They
>   can simply set kern.cam.ctl.disable=0 in loader.conf.

Could you rename it to kern.cam.ctl.enable(d)? There was discussion at
some point about sysctl/tunable names and the consensus was, AFAIR, to
use positive(?) names as they are more obvious.

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl


pgpAAJfQqQ6zU.pgp
Description: PGP signature


Re: svn commit: r248196 - head/sys/nfs

2013-03-12 Thread John Baldwin
On Tuesday, March 12, 2013 12:33:04 pm Andre Oppermann wrote:
> On 12.03.2013 16:50, Gleb Smirnoff wrote:
> > On Tue, Mar 12, 2013 at 04:31:05PM +0100, Andre Oppermann wrote:
> > A> > If you are concerned about using jumbos that are > PAGE_SIZE, then I 
> > can
> > A> > extend API in my patch.  ... done.
> > A> >
> > A> > Patch attached.
> > A> >
> > A> > The NFS code itself guarantees that it won't request > than MCLBYTES,
> > A> > so using bare m_get2() here is safe. I can add flag there later for
> > A> > clarity.
> > A>
> > A> Using PAGE_SIZE clusters is perfectly fine and no flag to prevent that
> > A> is necessary.  In fact we're doing it for years on socket writes without
> > A> complaints (through m_getm2()).
> >
> > mbuf usage isn't limited to sockets. There is some code that right now 
> > utilizes
> > only mbufs and standard clusters, netipsec for example.
> 
> Yes, I understand that.
> 
> > I'd like to remove a lot of handmade mbuf allocating, in different places in
> > kernel and this can be done with M_NOJUMBO flag. I don't have time to dig 
> > more
> > deep into large chunks of code trying to understand whether it is possible 
> > to
> > convert them into using PAGE_SIZE clusters or not, I just want to reduce
> > amount of pasted hand allocating.
> 
> Reducing the amount of hand allocation is very good.
> 
> > We have very common case when we allocate either mbuf or mbuf + cluster,
> > depending on size. Everywhere this is made by hand, but can be substituted
> > with m_get2(len, ..., M_NOJUMBO);
> 
> I guess what I'm trying to say is that not wanting jumbo > PAGE_SIZE is
> normal and shouldn't be specified all the time.
> 
> This makes the API look like this:
> 
>   m_get2(len, ..., 0);/* w/o flags I get at most MJUMPAGESIZE */
> 
> If someone really, really, really knows what he is doing he can say
> he wants jumbo > PAGE_SIZE returned with M_JUMBOOK or such.  However
> IMHO even that shouldn't be offered and m_getm2() should be used for
> a chain.

I agree, large clusters should require opting-in, they should not be
provided by default (if at all as Andre suggests).

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


Re: svn commit: r248196 - head/sys/nfs

2013-03-12 Thread Andre Oppermann

On 12.03.2013 20:49, Gleb Smirnoff wrote:

   Andre,

On Tue, Mar 12, 2013 at 05:33:04PM +0100, Andre Oppermann wrote:
A> > We have very common case when we allocate either mbuf or mbuf + cluster,
A> > depending on size. Everywhere this is made by hand, but can be substituted
A> > with m_get2(len, ..., M_NOJUMBO);
A>
A> I guess what I'm trying to say is that not wanting jumbo > PAGE_SIZE is
A> normal and shouldn't be specified all the time.
A>
A> This makes the API look like this:
A>
A>   m_get2(len, ..., 0);/* w/o flags I get at most MJUMPAGESIZE */
A>
A> If someone really, really, really knows what he is doing he can say
A> he wants jumbo > PAGE_SIZE returned with M_JUMBOOK or such.  However
A> IMHO even that shouldn't be offered and m_getm2() should be used for
A> a chain.

Once again: there are cases when chain is not anticipated, a single
contigous mbuf is.


My statement was at a design level.  So far only 2K sized contiguous mbufs
(as in classic clusters) were available.  This can be relaxed to 4K page
sized mbuf clusters without any trouble.  Not that we have any of those
requiring more than 2K clusters today.

What I'm saying is that everything that requires > 4K clusters is broken
by design.  It should be designed differently to use chains of mbufs not
more than 4K each.

There are architectures whose page size is larger than 4K.  However the
majority is at 4K.


A> > A> However I think that m_get2() should never ever even try to attempt to
A> > A> allocate mbuf clusters larger than PAGE_SIZE.  Not even with flags.
A> > A>
A> > A> All mbufs > PAGE_SIZE should be exclusively and only ever be used by 
drivers
A> > A> for NIC's with "challenged" DMA engines.  Possibly only available 
through a
A> > A> dedicated API to prevent all other uses of it.
A> >
A> > Have you done any benchmarking that proves that scatter-gather on the 
level of
A> > busdma is any worse than chaining on mbuf level?
A>
A> The problem is different.  With our current jumbo mbufs > PAGE_SIZE there
A> isn't any scatter-gather at busdma level because they are contiguous at
A> physical *and* KVA level.  Allocating such jumbo mbufs shifts the burden
A> of mbuf chains to the VM and pmap layer in trying to come up with such
A> contiguous patches of physical memory.  This fails quickly after some
A> activity and memory fragmentation on the machine as we've seen in recent
A> days even with 96GB of RAM available.  It gets worse the more load the
A> machine has.  Which is exactly what we *don't* want.

I somehow missed the r174247. How did that work since jumbo clusters were
introduced and up to r174247 (3 years)?


jumbo != jumbo.  They are simply called jumbo because they are larger than
the traditional 2K cluster.  The PAGE_SIZE jumbo is special in that it is
the largest mbuf that doesn't require any special VM or physical trickery
to be allocated.  This it is available as long as you have a single free
page in the system.  A page can be divided into two classic 2K clusters.
The only difference to a 4K PAGE_SIZE jumbo being that it requires two
256B mbuf for descriptors instead of one.


AFAIK, it worked fine before jumbos were not physically contigous. Most
modern NICs can use several descriptors per one packet, and that's what
we do when using PAGE_SIZE clusters. But we arm it manually. With a virtually
contigous single mbuf we can just do bus_dmamap_load_mbuf_sg() and do not
care about physical continuity in the stack and upper part of a driver.


Jumbos always were physically contiguous.  That was the very reason for
their existence.  They were invented to allow early NIC's with limited
DMA capabilities to handle jumbo ethernet frames.  Today they should only
be used for DMA challenged NIC's and nothing else.

For PAGE_SIZE jumbo's there is only one descriptor being used.  A page is
largest physical unit on the CPU architecture that always is contiguous.

What you apparently want is a new type of jumbo mbuf that is only contiguous
in virtual address space but not physically.  In theory that could be done,
but it's totally different from the current jumbo mbufs we already have.
While you get rid of the severe physical memory fragmentation problem the
KVA fragmentation problem remains lurking somewhere in the back.

Actually you could probably even do arbitrarily sized KVM contiguous-only
mbufs on demand.  The overhead cost is then simply shifted to the VM from
the mbuf user that had to work with mbuf chains.


I should probably consult gallatin@ and youngari@ on this.

A> > Dealing with contiguous in virtual memory mbuf is handy, for protocols that
A> > look through entire payload, for example pfsync. I guess NFS may also 
benefit
A> > from that.
A>
A> Of course it is handy.  However that carries other tradeoffs, some 
significant,
A> in other parts of the system.  And then for incoming packets it depends on 
the
A> MTU size.  For NFS, as far as I've read through the code today, the control
A> messages tend to be rather small.  

svn commit: r248219 - head/share/misc

2013-03-12 Thread Eitan Adler
Author: eadler
Date: Tue Mar 12 23:07:34 2013
New Revision: 248219
URL: http://svnweb.freebsd.org/changeset/base/248219

Log:
  Welcome Bryan to the team.

Modified:
  head/share/misc/organization.dot

Modified: head/share/misc/organization.dot
==
--- head/share/misc/organization.dotTue Mar 12 22:18:31 2013
(r248218)
+++ head/share/misc/organization.dotTue Mar 12 23:07:34 2013
(r248219)
@@ -30,7 +30,7 @@ coresecretary [label="Core Team Secretar
 doccommitters [label="Doc/www Committers\ndoc-committ...@freebsd.org"]
 doceng [label="Documentation Engineering Team\ndoc...@freebsd.org\ngjb, 
blackend,\ngabor, hrs"]
 portscommitters [label="Ports Committers\nports-committ...@freebsd.org"]
-portmgr [label="Port Management Team\nport...@freebsd.org\ntabthorpe, marcus, 
bapt, \nerwin, pav,\nitetcu, miwi"]
+portmgr [label="Port Management Team\nport...@freebsd.org\ntabthorpe, marcus, 
bapt,\nerwin, pav, bdrewery,\nitetcu, miwi"]
 portmgrsecretary [label="Port Management Team 
Secretary\nportmgr-secret...@freebsd.org\ntabthorpe"]
 re [label="Primary Release Engineering Team\n...@freebsd.org\nkib, blackend, 
jpaetzel, hrs, kensmith"]
 secteam [label="Security Team\nsect...@freebsd.org\nsimon, qingli, 
delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"]
___
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: r248220 - head/share/misc

2013-03-12 Thread Eitan Adler
Author: eadler
Date: Tue Mar 12 23:14:18 2013
New Revision: 248220
URL: http://svnweb.freebsd.org/changeset/base/248220

Log:
  Remove pav from portmgr whom had also stepped down a few months ago.
  
  Thank you for your years of service.
  
  Reported by:  rene

Modified:
  head/share/misc/organization.dot

Modified: head/share/misc/organization.dot
==
--- head/share/misc/organization.dotTue Mar 12 23:07:34 2013
(r248219)
+++ head/share/misc/organization.dotTue Mar 12 23:14:18 2013
(r248220)
@@ -30,7 +30,7 @@ coresecretary [label="Core Team Secretar
 doccommitters [label="Doc/www Committers\ndoc-committ...@freebsd.org"]
 doceng [label="Documentation Engineering Team\ndoc...@freebsd.org\ngjb, 
blackend,\ngabor, hrs"]
 portscommitters [label="Ports Committers\nports-committ...@freebsd.org"]
-portmgr [label="Port Management Team\nport...@freebsd.org\ntabthorpe, marcus, 
bapt,\nerwin, pav, bdrewery,\nitetcu, miwi"]
+portmgr [label="Port Management Team\nport...@freebsd.org\ntabthorpe, marcus, 
bapt,\nerwin, bdrewery,\nitetcu, miwi"]
 portmgrsecretary [label="Port Management Team 
Secretary\nportmgr-secret...@freebsd.org\ntabthorpe"]
 re [label="Primary Release Engineering Team\n...@freebsd.org\nkib, blackend, 
jpaetzel, hrs, kensmith"]
 secteam [label="Security Team\nsect...@freebsd.org\nsimon, qingli, 
delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"]
___
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: r248226 - head/sys/dev/bge

2013-03-12 Thread Pyun YongHyeon
Author: yongari
Date: Wed Mar 13 01:40:01 2013
New Revision: 248226
URL: http://svnweb.freebsd.org/changeset/base/248226

Log:
  r241438 broke IPMI access on Sun Fire X2200 M2(BCM5715).
  Fix the IPMI regression by sending BGE_FW_DRV_STATE_UNLOAD to
  ASF/IPMI firmware in driver attach phase.  Sending heartheat to
  ASF/IPMI is enabled only after upping interface so
  setting driver state to BGE_FW_DRV_STATE_START in attach phase
  broke IPMI access.
  While I'm here, add NVRAM arbitration lock before performing
  controller reset. ASF/IPMI firmware may be able to access the NVRAM
  while controller reset is in progress.  Without the arbitration
  lock before resetting the controller, ASF/IPMI may not initialize
  properly.
  
  Special thanks to Miroslav Lachman who provided full remote
  debugging environments.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Wed Mar 13 01:38:32 2013(r248225)
+++ head/sys/dev/bge/if_bge.c   Wed Mar 13 01:40:01 2013(r248226)
@@ -3594,15 +3594,15 @@ bge_attach(device_t dev)
}
 
bge_stop_fw(sc);
-   bge_sig_pre_reset(sc, BGE_RESET_START);
+   bge_sig_pre_reset(sc, BGE_RESET_SHUTDOWN);
if (bge_reset(sc)) {
device_printf(sc->bge_dev, "chip reset failed\n");
error = ENXIO;
goto fail;
}
 
-   bge_sig_legacy(sc, BGE_RESET_START);
-   bge_sig_post_reset(sc, BGE_RESET_START);
+   bge_sig_legacy(sc, BGE_RESET_SHUTDOWN);
+   bge_sig_post_reset(sc, BGE_RESET_SHUTDOWN);
 
if (bge_chipinit(sc)) {
device_printf(sc->bge_dev, "chip initialization failed\n");
@@ -3960,6 +3960,20 @@ bge_reset(struct bge_softc *sc)
} else
write_op = bge_writereg_ind;
 
+   if (sc->bge_asicrev != BGE_ASICREV_BCM5700 &&
+   sc->bge_asicrev != BGE_ASICREV_BCM5701) {
+   CSR_WRITE_4(sc, BGE_NVRAM_SWARB, BGE_NVRAMSWARB_SET1);
+   for (i = 0; i < 8000; i++) {
+   if (CSR_READ_4(sc, BGE_NVRAM_SWARB) &
+   BGE_NVRAMSWARB_GNT1)
+   break;
+   DELAY(20);
+   }
+   if (i == 8000) {
+   if (bootverbose)
+   device_printf(dev, "NVRAM lock timedout!\n");
+   }
+   }
/* Take APE lock when performing reset. */
bge_ape_lock(sc, BGE_APE_LOCK_GRC);
 
___
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: r248227 - head/sys/dev/re

2013-03-12 Thread Pyun YongHyeon
Author: yongari
Date: Wed Mar 13 02:11:45 2013
New Revision: 248227
URL: http://svnweb.freebsd.org/changeset/base/248227

Log:
  Disable TX IP header checksum offloading on RL_HWREV_8168CP. The
  controller generates wrong checksummed frame if the IP packet has
  IP options.
  
  Submitted by: Alexander Bluhm via brad@openbsd

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==
--- head/sys/dev/re/if_re.c Wed Mar 13 01:40:01 2013(r248226)
+++ head/sys/dev/re/if_re.c Wed Mar 13 02:11:45 2013(r248227)
@@ -1587,7 +1587,8 @@ re_attach(device_t dev)
 * packet has IP options so disable TX IP checksum offloading.
 */
if (sc->rl_hwrev->rl_rev == RL_HWREV_8168C ||
-   sc->rl_hwrev->rl_rev == RL_HWREV_8168C_SPIN2)
+   sc->rl_hwrev->rl_rev == RL_HWREV_8168C_SPIN2 ||
+   sc->rl_hwrev->rl_rev == RL_HWREV_8168CP)
ifp->if_hwassist = CSUM_TCP | CSUM_UDP;
else
ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP;
@@ -3419,7 +3420,8 @@ re_ioctl(struct ifnet *ifp, u_long comma
if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) {
rev = sc->rl_hwrev->rl_rev;
if (rev == RL_HWREV_8168C ||
-   rev == RL_HWREV_8168C_SPIN2)
+   rev == RL_HWREV_8168C_SPIN2 ||
+   rev == RL_HWREV_8168CP)
ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
else
ifp->if_hwassist |= RE_CSUM_FEATURES;
___
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: r248230 - head/sys/kern

2013-03-12 Thread Alexander Motin
Author: mav
Date: Wed Mar 13 06:42:01 2013
New Revision: 248230
URL: http://svnweb.freebsd.org/changeset/base/248230

Log:
  Fix incorrect assertion that caused panic when periodic-only timers used.

Modified:
  head/sys/kern/kern_et.c

Modified: head/sys/kern/kern_et.c
==
--- head/sys/kern/kern_et.c Wed Mar 13 03:27:32 2013(r248229)
+++ head/sys/kern/kern_et.c Wed Mar 13 06:42:01 2013(r248230)
@@ -168,7 +168,7 @@ et_start(struct eventtimer *et, sbintime
KASSERT(period >= 0, ("et_start: negative period"));
KASSERT((et->et_flags & ET_FLAGS_PERIODIC) || period == 0,
("et_start: period specified for oneshot-only timer"));
-   KASSERT((et->et_flags & ET_FLAGS_ONESHOT) && period == 0,
+   KASSERT((et->et_flags & ET_FLAGS_ONESHOT) || period != 0,
("et_start: period not specified for periodic-only timer"));
if (period != 0) {
if (period < et->et_min_period)
___
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"