svn commit: r254513 - stable/9/include

2013-08-19 Thread Ed Maste
Author: emaste
Date: Mon Aug 19 07:00:13 2013
New Revision: 254513
URL: http://svnweb.freebsd.org/changeset/base/254513

Log:
  MFC r251192: Fix misspelling of structure field name.

Modified:
  stable/9/include/stdatomic.h
Directory Properties:
  stable/9/include/   (props changed)

Modified: stable/9/include/stdatomic.h
==
--- stable/9/include/stdatomic.hMon Aug 19 05:48:42 2013
(r254512)
+++ stable/9/include/stdatomic.hMon Aug 19 07:00:13 2013
(r254513)
@@ -123,7 +123,7 @@ enum memory_order {
 
 #if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS)
 #defineatomic_is_lock_free(obj) \
-   __atomic_is_lock_free(sizeof((obj)-__val), (obj)-val)
+   __atomic_is_lock_free(sizeof((obj)-__val), (obj)-__val)
 #else
 #defineatomic_is_lock_free(obj) \
((void)(obj), sizeof((obj)-__val) = sizeof(void *))
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254514 - head/sys/arm/conf

2013-08-19 Thread Andrew Turner
Author: andrew
Date: Mon Aug 19 08:28:35 2013
New Revision: 254514
URL: http://svnweb.freebsd.org/changeset/base/254514

Log:
  Enable VFP on the Arndale Board.

Modified:
  head/sys/arm/conf/ARNDALE

Modified: head/sys/arm/conf/ARNDALE
==
--- head/sys/arm/conf/ARNDALE   Mon Aug 19 07:00:13 2013(r254513)
+++ head/sys/arm/conf/ARNDALE   Mon Aug 19 08:28:35 2013(r254514)
@@ -50,6 +50,7 @@ options   _KPOSIX_PRIORITY_SCHEDULING #Po
 optionsKBD_INSTALL_CDEV
 optionsPREEMPTION
 optionsFREEBSD_BOOT_LOADER
+optionsVFP # vfp/neon
 
 # Debugging
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254515 - in stable/9/sys: i386/include kern sys

2013-08-19 Thread Andre Oppermann
Author: andre
Date: Mon Aug 19 09:49:51 2013
New Revision: 254515
URL: http://svnweb.freebsd.org/changeset/base/254515

Log:
  MFC a bundle of commits that bring autotuning to mbufs, maxfiles/sockets
  and maxusers to the 9-stable branch.  It is committed as bundle because
  these patches build on each other and only provide the functionality in
  their entirety.  Some are bug fixes to aspects of earlier commits.
  
  MFC r242029 (alfred):
  
   Allow autotune maxusers  384 on 64 bit machines.
  
  MFC r242847 (alfred):
  
   Allow maxusers to scale on machines with large address space.
  
  MFC r243631 (andre):
  
   Base the mbuf related limits on the available physical memory or
   kernel memory, whichever is lower.  The overall mbuf related memory
   limit must be set so that mbufs (and clusters of various sizes)
   can't exhaust physical RAM or KVM.
  
   At the same time divorce maxfiles from maxusers and set maxfiles to
   physpages / 8 with a floor based on maxusers.  This way busy servers
   can make use of the significantly increased mbuf limits with a much
   larger number of open sockets.
  
  MFC r243639 (andre):
  
   Complete r243631 by applying the remainder of kern_mbuf.c that got
   lost while merging into the commit tree.
  
  MFC r243668 (andre):
  
   Using a long is the wrong type to represent the realmem and maxmbufmem
   variable as they may overflow on i386/PAE and i386 with  2GB RAM.
  
  MFC r243995, r243996, r243997 (pjd):
  
   Style cleanups, Make use of the fact that uma_zone_set_max(9) already
   returns actual limit set.
  
  MFC r244080 (andre):
  
   Prevent long type overflow of realmem calculation on ILP32 by forcing
   calculation to be in quad_t space.  Fix style issue with second parameter
   to qmin().
  
  MFC r245469 (alfred):
  
   Do not autotune ncallout to be greater than 18508.
  
  MFC r245575 (andre):
  
   Move the mbuf memory limit calculations from init_param2() to
   tunable_mbinit() where it is next to where it is used later.
  
  MFC r246207 (andre):
  
   Remove unused VM_MAX_AUTOTUNE_NMBCLUSTERS define.
  
  MFC r249843 (andre):
  
   Base the calculation of maxmbufmem in part on kmem_map size
   instead of kernel_map size to prevent kernel memory exhaustion
   by mbufs and a subsequent panic on physical page allocation
   failure.
  
  MFC r253204 (andre):
  
   Fix style issues, a typo in kern.ipc.nmbufs and correctly plave and
   expose the value of the tunable maxmbufmem as kern.ipc.maxmbufmem
   through sysctl.
  
  MFC r253207 (andre):
  
   Make use of the fact that uma_zone_set_max(9) already returns the
   rounded limit making a call to uma_zone_get_max(9) unnecessary.
  
  Tested by:alfred (iXsystems)

Modified:
  stable/9/sys/i386/include/vmparam.h
  stable/9/sys/kern/kern_mbuf.c
  stable/9/sys/kern/subr_param.c
  stable/9/sys/kern/uipc_socket.c
  stable/9/sys/sys/eventhandler.h
  stable/9/sys/sys/mbuf.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/9/sys/i386/include/vmparam.h
==
--- stable/9/sys/i386/include/vmparam.h Mon Aug 19 08:28:35 2013
(r254514)
+++ stable/9/sys/i386/include/vmparam.h Mon Aug 19 09:49:51 2013
(r254515)
@@ -202,4 +202,8 @@
 
 #defineZERO_REGION_SIZE(64 * 1024) /* 64KB */
 
+#ifndef VM_MAX_AUTOTUNE_MAXUSERS
+#define VM_MAX_AUTOTUNE_MAXUSERS 384
+#endif
+
 #endif /* _MACHINE_VMPARAM_H_ */

Modified: stable/9/sys/kern/kern_mbuf.c
==
--- stable/9/sys/kern/kern_mbuf.c   Mon Aug 19 08:28:35 2013
(r254514)
+++ stable/9/sys/kern/kern_mbuf.c   Mon Aug 19 09:49:51 2013
(r254515)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2004, 2005,
- * Bosko Milekic bmile...@freebsd.org.  All rights reserved.
+ * Bosko Milekic bmile...@freebsd.org.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -47,6 +47,7 @@ __FBSDID($FreeBSD$);
 #include vm/vm_extern.h
 #include vm/vm_kern.h
 #include vm/vm_page.h
+#include vm/vm_map.h
 #include vm/uma.h
 #include vm/uma_int.h
 #include vm/uma_dbg.h
@@ -76,7 +77,7 @@ __FBSDID($FreeBSD$);
  *  [ Cluster Zone  ]   [ Zone ]   [ Mbuf Master Zone ]
  *|   \ |
  *  [ Cluster Keg   ]  \   /
- *| [ Mbuf Keg   ]
+ *| [ Mbuf Keg   ]
  *  [ Cluster Slabs ] |
  *|  [ Mbuf Slabs ]
  * \(VM)_/
@@ -96,39 +97,64 @@ __FBSDID($FreeBSD$);
  *
  */
 
+int nmbufs;/* limits number of mbufs */
 int nmbclusters;   /* limits number of mbuf 

svn commit: r254516 - in head/sys/dev: bce bxe mge ti

2013-08-19 Thread Andre Oppermann
Author: andre
Date: Mon Aug 19 10:20:20 2013
New Revision: 254516
URL: http://svnweb.freebsd.org/changeset/base/254516

Log:
  Remove unused and incomplete support for delayed fragment checksums
  from bce(4), bxe(4), mge(4) and ti(4) drivers.

Modified:
  head/sys/dev/bce/if_bce.c
  head/sys/dev/bxe/if_bxe.c
  head/sys/dev/mge/if_mge.c
  head/sys/dev/ti/if_ti.c

Modified: head/sys/dev/bce/if_bce.c
==
--- head/sys/dev/bce/if_bce.c   Mon Aug 19 09:49:51 2013(r254515)
+++ head/sys/dev/bce/if_bce.c   Mon Aug 19 10:20:20 2013(r254516)
@@ -9821,9 +9821,7 @@ bce_dump_mbuf(struct bce_softc *sc, stru
if (mp-m_flags  M_PKTHDR) {
BCE_PRINTF(- m_pkthdr: len = %d, flags = 0x%b, 
csum_flags = %b\n, mp-m_pkthdr.len,
-   mp-m_flags, \20\12M_BCAST\13M_MCAST\14M_FRAG
-   \15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG
-   \22M_PROMISC\23M_NOFREE,
+   mp-m_flags, M_FLAG_PRINTF,
mp-m_pkthdr.csum_flags,
\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP
\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED

Modified: head/sys/dev/bxe/if_bxe.c
==
--- head/sys/dev/bxe/if_bxe.c   Mon Aug 19 09:49:51 2013(r254515)
+++ head/sys/dev/bxe/if_bxe.c   Mon Aug 19 10:20:20 2013(r254516)
@@ -16265,9 +16265,7 @@ void bxe_dump_mbuf(struct bxe_softc *sc,
if (m-m_flags  M_PKTHDR) {
 BXE_PRINTF(- m_pkthdr: len = %d, flags = 0x%b, 
csum_flags = %b\n, m-m_pkthdr.len,
-   m-m_flags, \20\12M_BCAST\13M_MCAST\14M_FRAG
-   \15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG
-   \22M_PROMISC\23M_NOFREE,
+   m-m_flags, M_FLAG_PRINTF,
m-m_pkthdr.csum_flags,
\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP
\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED

Modified: head/sys/dev/mge/if_mge.c
==
--- head/sys/dev/mge/if_mge.c   Mon Aug 19 09:49:51 2013(r254515)
+++ head/sys/dev/mge/if_mge.c   Mon Aug 19 10:20:20 2013(r254516)
@@ -1703,9 +1703,7 @@ mge_offload_setup_descriptor(struct mge_
 
ip = (struct ip *)(m0-m_data + ehlen);
cmd_status |= MGE_TX_IP_HDR_SIZE(ip-ip_hl);
-
-   if ((m0-m_flags  M_FRAG) == 0)
-   cmd_status |= MGE_TX_NOT_FRAGMENT;
+   cmd_status |= MGE_TX_NOT_FRAGMENT;
}
 
if (csum_flags  CSUM_IP)

Modified: head/sys/dev/ti/if_ti.c
==
--- head/sys/dev/ti/if_ti.c Mon Aug 19 09:49:51 2013(r254515)
+++ head/sys/dev/ti/if_ti.c Mon Aug 19 10:20:20 2013(r254516)
@@ -3159,24 +3159,6 @@ ti_start_locked(struct ifnet *ifp)
break;
 
/*
-* XXX
-* safety overkill.  If this is a fragmented packet chain
-* with delayed TCP/UDP checksums, then only encapsulate
-* it if we have enough descriptors to handle the entire
-* chain at once.
-* (paranoia -- may not actually be needed)
-*/
-   if (m_head-m_flags  M_FIRSTFRAG 
-   m_head-m_pkthdr.csum_flags  (CSUM_DELAY_DATA)) {
-   if ((TI_TX_RING_CNT - sc-ti_txcnt) 
-   m_head-m_pkthdr.csum_data + 16) {
-   IFQ_DRV_PREPEND(ifp-if_snd, m_head);
-   ifp-if_drv_flags |= IFF_DRV_OACTIVE;
-   break;
-   }
-   }
-
-   /*
 * Pack the data into the transmit ring. If we
 * don't have room, set the OACTIVE flag and wait
 * for the NIC to drain the ring.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254517 - head/sys/netinet

2013-08-19 Thread Andre Oppermann
Author: andre
Date: Mon Aug 19 10:30:15 2013
New Revision: 254517
URL: http://svnweb.freebsd.org/changeset/base/254517

Log:
  Remove unused M_FRAG, M_FIRSTFRAG and M_LASTFRAG tagging from ip_fragment().
  There wasn't any real driver (and hardware) support for it.  Modern hardware
  does full fragmentation/segmentation offload instead.

Modified:
  head/sys/netinet/ip_output.c

Modified: head/sys/netinet/ip_output.c
==
--- head/sys/netinet/ip_output.cMon Aug 19 10:20:20 2013
(r254516)
+++ head/sys/netinet/ip_output.cMon Aug 19 10:30:15 2013
(r254517)
@@ -784,7 +784,7 @@ smart_frag_failure:
IPSTAT_INC(ips_odropped);
goto done;
}
-   m-m_flags |= (m0-m_flags  M_MCAST) | M_FRAG;
+   m-m_flags |= (m0-m_flags  M_MCAST);
/*
 * In the first mbuf, leave room for the link header, then
 * copy the original IP header including options. The payload
@@ -801,10 +801,9 @@ smart_frag_failure:
m-m_len = mhlen;
/* XXX do we need to add ip_off below ? */
mhip-ip_off = ((off - hlen)  3) + ip_off;
-   if (off + len = ip_len) {  /* last fragment */
+   if (off + len = ip_len)
len = ip_len - off;
-   m-m_flags |= M_LASTFRAG;
-   } else
+   else
mhip-ip_off |= IP_MF;
mhip-ip_len = htons((u_short)(len + mhlen));
m-m_next = m_copym(m0, off, len, M_NOWAIT);
@@ -831,10 +830,6 @@ smart_frag_failure:
}
IPSTAT_ADD(ips_ofragments, nfrags);
 
-   /* set first marker for fragment chain */
-   m0-m_flags |= M_FIRSTFRAG | M_FRAG;
-   m0-m_pkthdr.csum_data = nfrags;
-
/*
 * Update first fragment by trimming what's been copied out
 * and updating header.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254518 - head/sys/netinet

2013-08-19 Thread Andre Oppermann
Author: andre
Date: Mon Aug 19 10:34:10 2013
New Revision: 254518
URL: http://svnweb.freebsd.org/changeset/base/254518

Log:
  Move ip_reassemble()'s use of the global M_FRAG mbuf flag to a protocol layer
  specific flag instead.  The flag is only relevant while the packet stays in
  the IP reassembly queue.
  
  Discussed with:   trociny, glebius

Modified:
  head/sys/netinet/ip_input.c
  head/sys/netinet/ip_var.h

Modified: head/sys/netinet/ip_input.c
==
--- head/sys/netinet/ip_input.c Mon Aug 19 10:30:15 2013(r254517)
+++ head/sys/netinet/ip_input.c Mon Aug 19 10:34:10 2013(r254518)
@@ -911,9 +911,9 @@ found:
IPSTAT_INC(ips_toosmall); /* XXX */
goto dropfrag;
}
-   m-m_flags |= M_FRAG;
+   m-m_flags |= M_IP_FRAG;
} else
-   m-m_flags = ~M_FRAG;
+   m-m_flags = ~M_IP_FRAG;
ip-ip_off = htons(ntohs(ip-ip_off)  3);
 
/*
@@ -1060,7 +1060,7 @@ found:
next += ntohs(GETIP(q)-ip_len);
}
/* Make sure the last packet didn't have the IP_MF flag */
-   if (p-m_flags  M_FRAG) {
+   if (p-m_flags  M_IP_FRAG) {
if (fp-ipq_nfrags  V_maxfragsperpacket) {
IPSTAT_ADD(ips_fragdropped, fp-ipq_nfrags);
ip_freef(head, fp);

Modified: head/sys/netinet/ip_var.h
==
--- head/sys/netinet/ip_var.h   Mon Aug 19 10:30:15 2013(r254517)
+++ head/sys/netinet/ip_var.h   Mon Aug 19 10:34:10 2013(r254518)
@@ -167,6 +167,7 @@ voidkmod_ipstat_dec(int statnum);
  */
 #defineM_FASTFWD_OURS  M_PROTO1/* changed dst to local 
*/
 #defineM_IP_NEXTHOPM_PROTO2/* explicit ip nexthop 
*/
+#defineM_IP_FRAG   M_PROTO4/* fragment reassembly 
*/
 
 #ifdef __NO_STRICT_ALIGNMENT
 #define IP_HDR_ALIGNED_P(ip)   1
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254519 - in head/sys: netinet netinet6 sys

2013-08-19 Thread Andre Oppermann
Author: andre
Date: Mon Aug 19 11:08:36 2013
New Revision: 254519
URL: http://svnweb.freebsd.org/changeset/base/254519

Log:
  Move the global M_SKIP_FIREWALL mbuf flags to a protocol layer specific
  flag instead.  The flag is only used within the IP and IPv6 layer 3
  protocols.
  
  Because some firewall packages treat IPv4 and IPv6 packets the same the
  flag should have the same value for both.
  
  Discussed with:   trociny, glebius

Modified:
  head/sys/netinet/ip_var.h
  head/sys/netinet6/ip6_var.h
  head/sys/sys/mbuf.h

Modified: head/sys/netinet/ip_var.h
==
--- head/sys/netinet/ip_var.h   Mon Aug 19 10:34:10 2013(r254518)
+++ head/sys/netinet/ip_var.h   Mon Aug 19 11:08:36 2013(r254519)
@@ -163,10 +163,12 @@ void  kmod_ipstat_dec(int statnum);
 #define IP_ALLOWBROADCAST  SO_BROADCAST/* 0x20 can send broadcast 
packets */
 
 /*
- * mbuf flag used by ip_fastfwd
+ * IPv4 protocol layer specific mbuf flags.
  */
 #defineM_FASTFWD_OURS  M_PROTO1/* changed dst to local 
*/
 #defineM_IP_NEXTHOPM_PROTO2/* explicit ip nexthop 
*/
+#defineM_SKIP_FIREWALL M_PROTO3/* skip firewall 
processing,
+  keep in sync with IP6 */
 #defineM_IP_FRAG   M_PROTO4/* fragment reassembly 
*/
 
 #ifdef __NO_STRICT_ALIGNMENT

Modified: head/sys/netinet6/ip6_var.h
==
--- head/sys/netinet6/ip6_var.h Mon Aug 19 10:34:10 2013(r254518)
+++ head/sys/netinet6/ip6_var.h Mon Aug 19 11:08:36 2013(r254519)
@@ -293,7 +293,12 @@ struct ip6aux {
 #defineIPV6_FORWARDING 0x02/* most of IPv6 header exists */
 #defineIPV6_MINMTU 0x04/* use minimum MTU 
(IPV6_USE_MIN_MTU) */
 
-#defineM_IP6_NEXTHOP   M_PROTO7/* explicit ip nexthop 
*/
+/*
+ * IPv6 protocol layer specific mbuf flags.
+ */
+#defineM_IP6_NEXTHOP   M_PROTO2/* explicit ip nexthop 
*/
+#defineM_SKIP_FIREWALL M_PROTO3/* skip firewall 
processing,
+  keep in sync with IPv4 */
 
 #ifdef __NO_STRICT_ALIGNMENT
 #define IP6_HDR_ALIGNED_P(ip)  1

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Mon Aug 19 10:34:10 2013(r254518)
+++ head/sys/sys/mbuf.h Mon Aug 19 11:08:36 2013(r254519)
@@ -196,7 +196,7 @@ struct mbuf {
 #defineM_FRAG  0x0800 /* packet is a fragment of a larger 
packet */
 #defineM_FIRSTFRAG 0x1000 /* packet is first fragment */
 #defineM_LASTFRAG  0x2000 /* packet is last fragment */
-#defineM_SKIP_FIREWALL 0x4000 /* skip firewall processing */
+/* 0x4000free */
 /* 0x8000free */
 #defineM_VLANTAG   0x0001 /* ether_vtag is valid */
 #defineM_PROMISC   0x0002 /* packet was not for us */
@@ -253,7 +253,7 @@ struct mbuf {
  * Flags preserved when copying m_pkthdr.
  */
 #defineM_COPYFLAGS \
-(M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_SKIP_FIREWALL|M_BCAST|M_MCAST|\
+(M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_BCAST|M_MCAST|\
  M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_VLANTAG|M_PROMISC|M_HASHTYPEBITS)
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254520 - in head/sys: kern sys

2013-08-19 Thread Andre Oppermann
Author: andre
Date: Mon Aug 19 11:16:53 2013
New Revision: 254520
URL: http://svnweb.freebsd.org/changeset/base/254520

Log:
  Remove the unused M_NOFREE mbuf flag.  It didn't have any in-tree users
  for a very long time, if ever.
  
  Should such a functionality ever be needed again the appropriate and
  much better way to do it is through a custom EXT_SOMETHING external mbuf
  type together with a dedicated *ext_free function.
  
  Discussed with:   trociny, glebius

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

Modified: head/sys/kern/kern_mbuf.c
==
--- head/sys/kern/kern_mbuf.c   Mon Aug 19 11:08:36 2013(r254519)
+++ head/sys/kern/kern_mbuf.c   Mon Aug 19 11:16:53 2013(r254520)
@@ -474,7 +474,6 @@ mb_dtor_mbuf(void *mem, int size, void *
if ((flags  MB_NOTAGS) == 0  (m-m_flags  M_PKTHDR) != 0)
m_tag_delete_chain(m, NULL);
KASSERT((m-m_flags  M_EXT) == 0, (%s: M_EXT set, __func__));
-   KASSERT((m-m_flags  M_NOFREE) == 0, (%s: M_NOFREE set, __func__));
 #ifdef INVARIANTS
trash_dtor(mem, size, arg);
 #endif

Modified: head/sys/kern/uipc_mbuf.c
==
--- head/sys/kern/uipc_mbuf.c   Mon Aug 19 11:08:36 2013(r254519)
+++ head/sys/kern/uipc_mbuf.c   Mon Aug 19 11:16:53 2013(r254520)
@@ -278,17 +278,10 @@ m_extadd(struct mbuf *mb, caddr_t buf, u
 void
 mb_free_ext(struct mbuf *m)
 {
-   int skipmbuf;

KASSERT((m-m_flags  M_EXT) == M_EXT, (%s: M_EXT not set, __func__));
KASSERT(m-m_ext.ref_cnt != NULL, (%s: ref_cnt not set, __func__));
 
-
-   /*
-* check if the header is embedded in the cluster
-*/ 
-   skipmbuf = (m-m_flags  M_NOFREE);
-   
/* Free attached storage if this mbuf is the only reference to it. */
if (*(m-m_ext.ref_cnt) == 1 ||
atomic_fetchadd_int(m-m_ext.ref_cnt, -1) == 1) {
@@ -329,8 +322,6 @@ mb_free_ext(struct mbuf *m)
(%s: unknown ext_type, __func__));
}
}
-   if (skipmbuf)
-   return;

/*
 * Free this mbuf back to the mbuf zone with all m_ext
@@ -395,7 +386,7 @@ m_demote(struct mbuf *m0, int all)
m_freem(m-m_nextpkt);
m-m_nextpkt = NULL;
}
-   m-m_flags = m-m_flags  (M_EXT|M_RDONLY|M_NOFREE);
+   m-m_flags = m-m_flags  (M_EXT|M_RDONLY);
}
 }
 

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Mon Aug 19 11:08:36 2013(r254519)
+++ head/sys/sys/mbuf.h Mon Aug 19 11:16:53 2013(r254520)
@@ -200,7 +200,7 @@ struct mbuf {
 /* 0x8000free */
 #defineM_VLANTAG   0x0001 /* ether_vtag is valid */
 #defineM_PROMISC   0x0002 /* packet was not for us */
-#defineM_NOFREE0x0004 /* do not free mbuf, embedded in 
cluster */
+/* 0x0004free */
 #defineM_PROTO60x0008 /* protocol-specific */
 #defineM_PROTO70x0010 /* protocol-specific */
 #defineM_PROTO80x0020 /* protocol-specific */
@@ -515,7 +515,7 @@ m_free(struct mbuf *m)
 
if (m-m_flags  M_EXT)
mb_free_ext(m);
-   else if ((m-m_flags  M_NOFREE) == 0)
+   else
uma_zfree(zone_mbuf, m);
return (n);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r254520 - in head/sys: kern sys

2013-08-19 Thread Davide Italiano
On Mon, Aug 19, 2013 at 1:16 PM, Andre Oppermann an...@freebsd.org wrote:
 Author: andre
 Date: Mon Aug 19 11:16:53 2013
 New Revision: 254520
 URL: http://svnweb.freebsd.org/changeset/base/254520

 Log:
   Remove the unused M_NOFREE mbuf flag.  It didn't have any in-tree users
   for a very long time, if ever.

   Should such a functionality ever be needed again the appropriate and
   much better way to do it is through a custom EXT_SOMETHING external mbuf
   type together with a dedicated *ext_free function.

   Discussed with:   trociny, glebius

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

 Modified: head/sys/kern/kern_mbuf.c
 ==
 --- head/sys/kern/kern_mbuf.c   Mon Aug 19 11:08:36 2013(r254519)
 +++ head/sys/kern/kern_mbuf.c   Mon Aug 19 11:16:53 2013(r254520)
 @@ -474,7 +474,6 @@ mb_dtor_mbuf(void *mem, int size, void *
 if ((flags  MB_NOTAGS) == 0  (m-m_flags  M_PKTHDR) != 0)
 m_tag_delete_chain(m, NULL);
 KASSERT((m-m_flags  M_EXT) == 0, (%s: M_EXT set, __func__));
 -   KASSERT((m-m_flags  M_NOFREE) == 0, (%s: M_NOFREE set, __func__));
  #ifdef INVARIANTS
 trash_dtor(mem, size, arg);
  #endif

 Modified: head/sys/kern/uipc_mbuf.c
 ==
 --- head/sys/kern/uipc_mbuf.c   Mon Aug 19 11:08:36 2013(r254519)
 +++ head/sys/kern/uipc_mbuf.c   Mon Aug 19 11:16:53 2013(r254520)
 @@ -278,17 +278,10 @@ m_extadd(struct mbuf *mb, caddr_t buf, u
  void
  mb_free_ext(struct mbuf *m)
  {
 -   int skipmbuf;

 KASSERT((m-m_flags  M_EXT) == M_EXT, (%s: M_EXT not set, 
 __func__));
 KASSERT(m-m_ext.ref_cnt != NULL, (%s: ref_cnt not set, __func__));

 -
 -   /*
 -* check if the header is embedded in the cluster
 -*/
 -   skipmbuf = (m-m_flags  M_NOFREE);
 -
 /* Free attached storage if this mbuf is the only reference to it. */
 if (*(m-m_ext.ref_cnt) == 1 ||
 atomic_fetchadd_int(m-m_ext.ref_cnt, -1) == 1) {
 @@ -329,8 +322,6 @@ mb_free_ext(struct mbuf *m)
 (%s: unknown ext_type, __func__));
 }
 }
 -   if (skipmbuf)
 -   return;

 /*
  * Free this mbuf back to the mbuf zone with all m_ext
 @@ -395,7 +386,7 @@ m_demote(struct mbuf *m0, int all)
 m_freem(m-m_nextpkt);
 m-m_nextpkt = NULL;
 }
 -   m-m_flags = m-m_flags  (M_EXT|M_RDONLY|M_NOFREE);
 +   m-m_flags = m-m_flags  (M_EXT|M_RDONLY);
 }
  }


 Modified: head/sys/sys/mbuf.h
 ==
 --- head/sys/sys/mbuf.h Mon Aug 19 11:08:36 2013(r254519)
 +++ head/sys/sys/mbuf.h Mon Aug 19 11:16:53 2013(r254520)
 @@ -200,7 +200,7 @@ struct mbuf {
  /* 0x8000free */
  #defineM_VLANTAG   0x0001 /* ether_vtag is valid */
  #defineM_PROMISC   0x0002 /* packet was not for us */
 -#defineM_NOFREE0x0004 /* do not free mbuf, embedded in 
 cluster */
 +/* 0x0004free */

I think you should just use M_UNUSED or something similar here for
consistency, like it's happening in td_pflags (sys/sys/proc.h), e.g.:

#define TDP_UNUSED9 0x0100 /* --available-- */


  #defineM_PROTO60x0008 /* protocol-specific */
  #defineM_PROTO70x0010 /* protocol-specific */
  #defineM_PROTO80x0020 /* protocol-specific */
 @@ -515,7 +515,7 @@ m_free(struct mbuf *m)

 if (m-m_flags  M_EXT)
 mb_free_ext(m);
 -   else if ((m-m_flags  M_NOFREE) == 0)
 +   else
 uma_zfree(zone_mbuf, m);
 return (n);
  }



-- 
Davide

There are no solved problems; there are only problems that are more
or less solved -- Henri Poincare
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r254484 - head/lib/libc/net

2013-08-19 Thread Hiroki Sato
Pawel Jakub Dawidek p...@freebsd.org wrote
  in 201308181038.r7iacxkm008...@svn.freebsd.org:

pj Author: pjd
pj Date: Sun Aug 18 10:38:59 2013
pj New Revision: 254484
pj URL: http://svnweb.freebsd.org/changeset/base/254484
pj
pj Log:
pj   Consistently use 'af' as an argument name for address family.
pj   Now both gethostbyname2(3) and gethostbyaddr(3) use the same argument 
name.
pj   The same argument name is also used in implementations of those functions.
pj
pj Modified:
pj   head/lib/libc/net/gethostbyname.3
pj
pj Modified: head/lib/libc/net/gethostbyname.3
pj 
==
pj --- head/lib/libc/net/gethostbyname.3   Sun Aug 18 10:33:46 2013
(r254483)
pj +++ head/lib/libc/net/gethostbyname.3   Sun Aug 18 10:38:59 2013
(r254484)
pj @@ -51,7 +51,7 @@
pj  .Ft struct hostent *
pj  .Fn gethostbyname2 const char *name int af
pj  .Ft struct hostent *
pj -.Fn gethostbyaddr const void *addr socklen_t len int type
pj +.Fn gethostbyaddr const void *addr socklen_t len int af
pj  .Ft struct hostent *
pj  .Fn gethostent void
pj  .Ft void
pj @@ -107,7 +107,7 @@ in binary form
pj  .Tn ASCII
pj  form).
pj  The
pj -.Fa type
pj +.Fa af
pj  argument specifies the address family
pj  (e.g.\
pj  .Dv AF_INET , AF_INET6 ,

 I do not think we need to change this for consistency between the
 manual page and its implementation.  gethostbyaddr()'s int type
 appears literally in POSIX and almost all systems have used that
 definition for a long time.

-- Hiroki


pgpJ3sAnPxnNq.pgp
Description: PGP signature


Re: svn commit: r254520 - in head/sys: kern sys

2013-08-19 Thread Andre Oppermann

On 19.08.2013 13:23, Davide Italiano wrote:

On Mon, Aug 19, 2013 at 1:16 PM, Andre Oppermann an...@freebsd.org wrote:

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Mon Aug 19 11:08:36 2013(r254519)
+++ head/sys/sys/mbuf.h Mon Aug 19 11:16:53 2013(r254520)
@@ -200,7 +200,7 @@ struct mbuf {
  /* 0x8000free */
  #defineM_VLANTAG   0x0001 /* ether_vtag is valid */
  #defineM_PROMISC   0x0002 /* packet was not for us */
-#defineM_NOFREE0x0004 /* do not free mbuf, embedded in 
cluster */
+/* 0x0004free */


I think you should just use M_UNUSED or something similar here for
consistency, like it's happening in td_pflags (sys/sys/proc.h), e.g.:

#define TDP_UNUSED9 0x0100 /* --available-- */


There's a couple of more changes upcoming that will take care of it.

--
Andre

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


svn commit: r254521 - in head/sys: netinet sys

2013-08-19 Thread Andre Oppermann
Author: andre
Date: Mon Aug 19 12:30:18 2013
New Revision: 254521
URL: http://svnweb.freebsd.org/changeset/base/254521

Log:
  Move the SCTP specific definition of M_NOTIFICATION onto a protocol
  specific mbuf flag from sys/mbuf.h to netinet/sctp_os_bsd.h.  It is
  only relevant within SCTP.
  
  Discussed with:   tuexen

Modified:
  head/sys/netinet/sctp_os_bsd.h
  head/sys/sys/mbuf.h

Modified: head/sys/netinet/sctp_os_bsd.h
==
--- head/sys/netinet/sctp_os_bsd.h  Mon Aug 19 11:16:53 2013
(r254520)
+++ head/sys/netinet/sctp_os_bsd.h  Mon Aug 19 12:30:18 2013
(r254521)
@@ -429,6 +429,11 @@ typedef struct rtentry sctp_rtentry_t;
 #define SCTP_ZERO_COPY_SENDQ_EVENT(inp, so)
 
 /*
+ * SCTP protocol specific mbuf flags.
+ */
+#defineM_NOTIFICATION  M_PROTO5/* SCTP notification */
+
+/*
  * IP output routines
  */
 #define SCTP_IP_OUTPUT(result, o_pak, ro, stcb, vrf_id) \

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Mon Aug 19 11:16:53 2013(r254520)
+++ head/sys/sys/mbuf.h Mon Aug 19 12:30:18 2013(r254521)
@@ -207,8 +207,6 @@ struct mbuf {
 #defineM_FLOWID0x0040 /* deprecated: flowid is valid */
 #defineM_HASHTYPEBITS  0x0F00 /* mask of bits holding flowid hash 
type */
 
-#defineM_NOTIFICATION  M_PROTO5/* SCTP notification */
-
 /*
  * Flags to purge when crossing layers.
  */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254522 - head/usr.bin/dtc

2013-08-19 Thread David Chisnall
Author: theraven
Date: Mon Aug 19 12:37:13 2013
New Revision: 254522
URL: http://svnweb.freebsd.org/changeset/base/254522

Log:
  Add support for parameterised device tree sources to the device tree compiler.
  
  Reviewed by:  brooks
  Sponsored by: DARPA, AFRL

Modified:
  head/usr.bin/dtc/dtc.1
  head/usr.bin/dtc/dtc.cc
  head/usr.bin/dtc/fdt.cc
  head/usr.bin/dtc/fdt.hh

Modified: head/usr.bin/dtc/dtc.1
==
--- head/usr.bin/dtc/dtc.1  Mon Aug 19 12:30:18 2013(r254521)
+++ head/usr.bin/dtc/dtc.1  Mon Aug 19 12:37:13 2013(r254522)
@@ -51,6 +51,7 @@
 .Op Fl p Ar bytes
 .Op Fl V Ar blob_version
 .Op Fl W Ar [no-]checker_name
+.Op Fl P Ar predefined_properties
 .Ar input_file
 .Sh DESCRIPTION
 The
@@ -132,6 +133,22 @@ The ASCII representation of the FDT.
 .El
 .It Fl o Ar output_file
 The file to which to write the output.
+.It Fl P Ar predefined_macro
+Defines a macro, in the form
+.Ar name=value
+or
+.Ar name
+to be used for device tree source files that contain conditional components.
+This tool supports two extensions to the standard to support conditional
+compilation of device trees.
+The first is an 
+.Ar /include/if [property]/ file.dts
+directive that is allowed at the start of a file and which will only include
+the specified file if it the specified property is passed with this flag.
+The second is the 
+.Ar $NAME
+format for property values.
+These allow property value to be specified on the command line.
 .It Fl R Ar entries
 The number of empty reservation table entries to pad the table with.
 This is

Modified: head/usr.bin/dtc/dtc.cc
==
--- head/usr.bin/dtc/dtc.cc Mon Aug 19 12:30:18 2013(r254521)
+++ head/usr.bin/dtc/dtc.cc Mon Aug 19 12:37:13 2013(r254522)
@@ -100,7 +100,7 @@ main(int argc, char **argv)
clock_t c0 = clock();
class device_tree tree;
fdt::checking::check_manager checks;
-   const char *options = hqI:O:o:V:d:R:S:p:b:fisvH:W:E:D;
+   const char *options = hqI:O:o:V:d:R:S:p:b:fisvH:W:E:DP:;
 
// Don't forget to update the man page if any more options are added.
while ((ch = getopt(argc, argv, options)) != -1)
@@ -267,6 +267,13 @@ main(int argc, char **argv)
case 'p':
tree.set_blob_padding(strtoll(optarg, 0, 10));
break;
+   case 'P':
+   if (!tree.parse_define(optarg))
+   {
+   fprintf(stderr, Invalid predefine value %s\n,
+   optarg);
+   }
+   break;
default:
fprintf(stderr, Unknown option %c\n, ch);
return EXIT_FAILURE;

Modified: head/usr.bin/dtc/fdt.cc
==
--- head/usr.bin/dtc/fdt.cc Mon Aug 19 12:30:18 2013(r254521)
+++ head/usr.bin/dtc/fdt.cc Mon Aug 19 12:37:13 2013(r254522)
@@ -382,13 +382,45 @@ property::property(input_buffer structs
values.push_back(v);
 }
 
-property::property(input_buffer input, string k, string l) : key(k), label(l),
-   valid(true)
+void property::parse_define(input_buffer input, define_map *defines)
+{
+   input.consume('$');
+   if (!defines)
+   {
+   input.parse_error(No predefined properties to match name\n);
+   valid = false;
+   return;
+   }
+   string name = string::parse_property_name(input);
+   define_map::iterator found;
+   if ((name == string()) ||
+   ((found = defines-find(name)) == defines-end()))
+   {
+   input.parse_error(Undefined property name\n);
+   valid = false;
+   return;
+   }
+   values.push_back((*found).second-values[0]);
+}
+
+property::property(input_buffer input,
+   string k,
+   string l,
+   bool semicolonTerminated,
+   define_map *defines) : key(k), label(l), valid(true)
 {
do {
input.next_token();
switch (input[0])
{
+   case '$':
+   {
+   parse_define(input, defines);
+   if (valid)
+   {
+   break;
+   }
+   }
default:
input.parse_error(Invalid property value.);
valid = false;
@@ -412,7 +444,7 @@ property::property(input_buffer input, 
}
input.next_token();
} while (input.consume(','));
-   if 

Re: svn commit: r254484 - head/lib/libc/net

2013-08-19 Thread Pawel Jakub Dawidek
On Mon, Aug 19, 2013 at 08:43:30PM +0900, Hiroki Sato wrote:
 Pawel Jakub Dawidek p...@freebsd.org wrote
   in 201308181038.r7iacxkm008...@svn.freebsd.org:
 
 pj Author: pjd
 pj Date: Sun Aug 18 10:38:59 2013
 pj New Revision: 254484
 pj URL: http://svnweb.freebsd.org/changeset/base/254484
 pj
 pj Log:
 pj   Consistently use 'af' as an argument name for address family.
 pj   Now both gethostbyname2(3) and gethostbyaddr(3) use the same argument 
 name.
 pj   The same argument name is also used in implementations of those 
 functions.
 pj
 pj Modified:
 pj   head/lib/libc/net/gethostbyname.3
 pj
 pj Modified: head/lib/libc/net/gethostbyname.3
 pj 
 ==
 pj --- head/lib/libc/net/gethostbyname.3 Sun Aug 18 10:33:46 2013
 (r254483)
 pj +++ head/lib/libc/net/gethostbyname.3 Sun Aug 18 10:38:59 2013
 (r254484)
 pj @@ -51,7 +51,7 @@
 pj  .Ft struct hostent *
 pj  .Fn gethostbyname2 const char *name int af
 pj  .Ft struct hostent *
 pj -.Fn gethostbyaddr const void *addr socklen_t len int type
 pj +.Fn gethostbyaddr const void *addr socklen_t len int af
 pj  .Ft struct hostent *
 pj  .Fn gethostent void
 pj  .Ft void
 pj @@ -107,7 +107,7 @@ in binary form
 pj  .Tn ASCII
 pj  form).
 pj  The
 pj -.Fa type
 pj +.Fa af
 pj  argument specifies the address family
 pj  (e.g.\
 pj  .Dv AF_INET , AF_INET6 ,
 
  I do not think we need to change this for consistency between the
  manual page and its implementation.  gethostbyaddr()'s int type
  appears literally in POSIX and almost all systems have used that
  definition for a long time.

The reason I noticed was that address family argument was named 'af' in
gethostbyname2() above, but 'type' in gethostbyaddr() - the same
argument, but two different names.

Originally I changed 'af' to 'type' for gethostbyname2(), but then
decided that 'type' is just too universal and that implementation is
using 'af', so I ended up changing 'type' in gethostbyaddr() to 'af'.

Is POSIX consistent with naming address family argument for
gethostbyaddr() and gethostbyname2()?

I'm happy to change those two to 'type', I just would like the name to
be consistent between those two functions.

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


pgpgvlqZ8yMTg.pgp
Description: PGP signature


svn commit: r254523 - in head/sys: net net80211 netinet netinet6 netpfil/pf ofed/drivers/infiniband/ulp/ipoib sys

2013-08-19 Thread Andre Oppermann
Author: andre
Date: Mon Aug 19 13:27:32 2013
New Revision: 254523
URL: http://svnweb.freebsd.org/changeset/base/254523

Log:
  Add m_clrprotoflags() to clear protocol specific mbuf flags at up and
  downwards layer crossings.
  
  Consistently use it within IP, IPv6 and ethernet protocols.
  
  Discussed with:   trociny, glebius

Modified:
  head/sys/net/if_ethersubr.c
  head/sys/net80211/ieee80211_hostap.c
  head/sys/net80211/ieee80211_input.c
  head/sys/netinet/if_ether.c
  head/sys/netinet/igmp.c
  head/sys/netinet/ip_fastfwd.c
  head/sys/netinet/ip_output.c
  head/sys/netinet/sctp_os_bsd.h
  head/sys/netinet6/ip6_mroute.c
  head/sys/netinet6/mld6.c
  head/sys/netinet6/nd6.c
  head/sys/netinet6/send.c
  head/sys/netpfil/pf/pf.c
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c
  head/sys/sys/mbuf.h

Modified: head/sys/net/if_ethersubr.c
==
--- head/sys/net/if_ethersubr.c Mon Aug 19 12:37:13 2013(r254522)
+++ head/sys/net/if_ethersubr.c Mon Aug 19 13:27:32 2013(r254523)
@@ -774,7 +774,7 @@ ether_demux(struct ifnet *ifp, struct mb
 * Strip off Ethernet header.
 */
m-m_flags = ~M_VLANTAG;
-   m-m_flags = ~(M_PROTOFLAGS);
+   m_clrprotoflags(m);
m_adj(m, ETHER_HDR_LEN);
 
/*

Modified: head/sys/net80211/ieee80211_hostap.c
==
--- head/sys/net80211/ieee80211_hostap.cMon Aug 19 12:37:13 2013
(r254522)
+++ head/sys/net80211/ieee80211_hostap.cMon Aug 19 13:27:32 2013
(r254523)
@@ -355,7 +355,8 @@ hostap_deliver_data(struct ieee80211vap 
struct ifnet *ifp = vap-iv_ifp;
 
/* clear driver/net80211 flags before passing up */
-   m-m_flags = ~(M_80211_RX | M_MCAST | M_BCAST);
+   m-m_flags = ~(M_MCAST | M_BCAST);
+   m_clrprotoflags(m);
 
KASSERT(vap-iv_opmode == IEEE80211_M_HOSTAP,
(gack, opmode %d, vap-iv_opmode));

Modified: head/sys/net80211/ieee80211_input.c
==
--- head/sys/net80211/ieee80211_input.c Mon Aug 19 12:37:13 2013
(r254522)
+++ head/sys/net80211/ieee80211_input.c Mon Aug 19 13:27:32 2013
(r254523)
@@ -250,7 +250,8 @@ ieee80211_deliver_data(struct ieee80211v
struct ifnet *ifp = vap-iv_ifp;
 
/* clear driver/net80211 flags before passing up */
-   m-m_flags = ~(M_80211_RX | M_MCAST | M_BCAST);
+   m-m_flags = ~(M_MCAST | M_BCAST);
+   m_clrprotoflags(m);
 
/* NB: see hostap_deliver_data, this path doesn't handle hostap */
KASSERT(vap-iv_opmode != IEEE80211_M_HOSTAP, (gack, hostap));

Modified: head/sys/netinet/if_ether.c
==
--- head/sys/netinet/if_ether.c Mon Aug 19 12:37:13 2013(r254522)
+++ head/sys/netinet/if_ether.c Mon Aug 19 13:27:32 2013(r254523)
@@ -281,6 +281,7 @@ arprequest(struct ifnet *ifp, const stru
sa.sa_family = AF_ARP;
sa.sa_len = 2;
m-m_flags |= M_BCAST;
+   m_clrprotoflags(m); /* Avoid confusing lower layers. */
(*ifp-if_output)(ifp, m, sa, NULL);
ARPSTAT_INC(txrequests);
 }
@@ -784,6 +785,8 @@ match:
for (; m_hold != NULL; m_hold = m_hold_next) {
m_hold_next = m_hold-m_nextpkt;
m_hold-m_nextpkt = NULL;
+   /* Avoid confusing lower layers. */
+   m_clrprotoflags(m_hold);
(*ifp-if_output)(ifp, m_hold, sa, NULL);
}
} else
@@ -888,6 +891,7 @@ reply:
m-m_pkthdr.rcvif = NULL;
sa.sa_family = AF_ARP;
sa.sa_len = 2;
+   m_clrprotoflags(m); /* Avoid confusing lower layers. */
(*ifp-if_output)(ifp, m, sa, NULL);
ARPSTAT_INC(txreplies);
return;

Modified: head/sys/netinet/igmp.c
==
--- head/sys/netinet/igmp.c Mon Aug 19 12:37:13 2013(r254522)
+++ head/sys/netinet/igmp.c Mon Aug 19 13:27:32 2013(r254523)
@@ -3450,7 +3450,7 @@ igmp_intr(struct mbuf *m)
}
 
igmp_scrub_context(m0);
-   m-m_flags = ~(M_PROTOFLAGS);
+   m_clrprotoflags(m);
m0-m_pkthdr.rcvif = V_loif;
 #ifdef MAC
mac_netinet_igmp_send(ifp, m0);

Modified: head/sys/netinet/ip_fastfwd.c
==
--- head/sys/netinet/ip_fastfwd.c   Mon Aug 19 12:37:13 2013
(r254522)
+++ head/sys/netinet/ip_fastfwd.c   Mon Aug 19 13:27:32 2013
(r254523)
@@ -525,6 +525,10 @@ passout:
if (ip_len = mtu ||
(ifp-if_hwassist  CSUM_FRAGMENT  (ip_off  IP_DF) == 0)) {

svn commit: r254524 - head/sys/sys

2013-08-19 Thread Andre Oppermann
Author: andre
Date: Mon Aug 19 13:56:14 2013
New Revision: 254524
URL: http://svnweb.freebsd.org/changeset/base/254524

Log:
  Add four additional M_PROTOFLAGS[9-12] for protocol specific use.
  
  Discussed with:   trociny, glebius, adrian

Modified:
  head/sys/sys/mbuf.h

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Mon Aug 19 13:27:32 2013(r254523)
+++ head/sys/sys/mbuf.h Mon Aug 19 13:56:14 2013(r254524)
@@ -196,22 +196,24 @@ struct mbuf {
 #defineM_FRAG  0x0800 /* packet is a fragment of a larger 
packet */
 #defineM_FIRSTFRAG 0x1000 /* packet is first fragment */
 #defineM_LASTFRAG  0x2000 /* packet is last fragment */
-/* 0x4000free */
-/* 0x8000free */
+#defineM_PROTO90x4000 /* protocol-specific */
+#defineM_PROTO10   0x8000 /* protocol-specific */
 #defineM_VLANTAG   0x0001 /* ether_vtag is valid */
 #defineM_PROMISC   0x0002 /* packet was not for us */
-/* 0x0004free */
+#defineM_PROTO11   0x0004 /* protocol-specific */
 #defineM_PROTO60x0008 /* protocol-specific */
 #defineM_PROTO70x0010 /* protocol-specific */
 #defineM_PROTO80x0020 /* protocol-specific */
 #defineM_FLOWID0x0040 /* deprecated: flowid is valid */
+#defineM_PROTO12   0x0080 /* protocol-specific */
 #defineM_HASHTYPEBITS  0x0F00 /* mask of bits holding flowid hash 
type */
 
 /*
  * Flags to purge when crossing layers.
  */
 #defineM_PROTOFLAGS \
-(M_PROTO1|M_PROTO2|M_PROTO3|M_PROTO4|M_PROTO5|M_PROTO6|M_PROTO7|M_PROTO8)
+(M_PROTO1|M_PROTO2|M_PROTO3|M_PROTO4|M_PROTO5|M_PROTO6|M_PROTO7|M_PROTO8|\
+ M_PROTO9|M_PROTO10|M_PROTO11|M_PROTO12)
 
 /*
  * Network interface cards are able to hash protocol fields (such as IPv4
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254525 - head/usr.sbin/pkg_install/add

2013-08-19 Thread Glen Barber
Author: gjb
Date: Mon Aug 19 14:04:35 2013
New Revision: 254525
URL: http://svnweb.freebsd.org/changeset/base/254525

Log:
  Add entry for packages-9.2-release directory.
  
  Approved by:  re (implicit)

Modified:
  head/usr.sbin/pkg_install/add/main.c

Modified: head/usr.sbin/pkg_install/add/main.c
==
--- head/usr.sbin/pkg_install/add/main.cMon Aug 19 13:56:14 2013
(r254524)
+++ head/usr.sbin/pkg_install/add/main.cMon Aug 19 14:04:35 2013
(r254525)
@@ -90,6 +90,7 @@ struct {
{ 803000, 803499, /packages-8.3-release },
{ 90, 900499, /packages-9.0-release },
{ 901000, 901499, /packages-9.1-release },
+   { 902000, 902499, /packages-9.2-release },
{ 30, 399000, /packages-3-stable },
{ 40, 499000, /packages-4-stable },
{ 502100, 502128, /packages-5-current },
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254526 - in head/sys: net80211 sys

2013-08-19 Thread Andre Oppermann
Author: andre
Date: Mon Aug 19 14:07:31 2013
New Revision: 254526
URL: http://svnweb.freebsd.org/changeset/base/254526

Log:
  Migrate the net80211 protocol specific use of M_FRAG, M_FIRSTFRAG and
  M_LASTFRAG flags to protocol specific flags.
  
  Remove the now unused M_FRAG, M_FIRSTFRAG and M_LASTFRAG mbuf flags.
  
  Discussed with:   trociny, glebius, adrian

Modified:
  head/sys/net80211/ieee80211_freebsd.h
  head/sys/sys/mbuf.h

Modified: head/sys/net80211/ieee80211_freebsd.h
==
--- head/sys/net80211/ieee80211_freebsd.h   Mon Aug 19 14:04:35 2013
(r254525)
+++ head/sys/net80211/ieee80211_freebsd.h   Mon Aug 19 14:07:31 2013
(r254526)
@@ -234,9 +234,12 @@ struct mbuf *ieee80211_getmgtframe(uint8
 #defineM_FFM_PROTO6/* fast frame */
 #defineM_TXCB  M_PROTO7/* do tx complete 
callback */
 #defineM_AMPDU_MPDUM_PROTO8/* ok for A-MPDU 
aggregation */
+#defineM_FRAG  M_PROTO9/* frame fragmentation 
*/
+#defineM_FIRSTFRAG M_PROTO10   /* first frame fragment 
*/
+#defineM_LASTFRAG  M_PROTO11   /* last frame fragment 
*/
 #defineM_80211_TX \
-   (M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_ENCAP|M_EAPOL|M_PWR_SAV|\
-M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU)
+   (M_ENCAP|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB| \
+M_AMPDU_MPDU|M_FRAG|M_FIRSTFRAG|M_LASTFRAG)
 
 /* rx path usage */
 #defineM_AMPDU M_PROTO1/* A-MPDU subframe */

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Mon Aug 19 14:04:35 2013(r254525)
+++ head/sys/sys/mbuf.h Mon Aug 19 14:07:31 2013(r254526)
@@ -193,9 +193,9 @@ struct mbuf {
 #defineM_PROTO50x0100 /* protocol-specific */
 #defineM_BCAST 0x0200 /* send/received as link-level 
broadcast */
 #defineM_MCAST 0x0400 /* send/received as link-level 
multicast */
-#defineM_FRAG  0x0800 /* packet is a fragment of a larger 
packet */
-#defineM_FIRSTFRAG 0x1000 /* packet is first fragment */
-#defineM_LASTFRAG  0x2000 /* packet is last fragment */
+/* 0x0800free */
+/* 0x1000free */
+/* 0x2000free */
 #defineM_PROTO90x4000 /* protocol-specific */
 #defineM_PROTO10   0x8000 /* protocol-specific */
 #defineM_VLANTAG   0x0001 /* ether_vtag is valid */
@@ -254,7 +254,7 @@ struct mbuf {
  */
 #defineM_COPYFLAGS \
 (M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_BCAST|M_MCAST|\
- M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_VLANTAG|M_PROMISC|M_HASHTYPEBITS)
+ M_VLANTAG|M_PROMISC|M_HASHTYPEBITS)
 
 /*
  * External buffer types: identify ext_buf type.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254527 - in head/sys: net80211 netinet sys

2013-08-19 Thread Andre Oppermann
Author: andre
Date: Mon Aug 19 14:25:11 2013
New Revision: 254527
URL: http://svnweb.freebsd.org/changeset/base/254527

Log:
  Reorder the mbuf defines to make more sense and group related flags
  together.
  
  Add M_FLAG_PRINTF for use with printf(9) %b indentifier.
  
  Use the generic mbuf flags print names in the net80211 code and adjust
  the protocol specific bits for their new positions.
  
  Change SCTP M_PROTO mapping from 5 to 1 to fit within the 16bit field
  they use internally to store some additional information.
  
  Discussed with:   trociny, glebius

Modified:
  head/sys/net80211/ieee80211_freebsd.h
  head/sys/netinet/sctp_os_bsd.h
  head/sys/sys/mbuf.h

Modified: head/sys/net80211/ieee80211_freebsd.h
==
--- head/sys/net80211/ieee80211_freebsd.h   Mon Aug 19 14:07:31 2013
(r254526)
+++ head/sys/net80211/ieee80211_freebsd.h   Mon Aug 19 14:25:11 2013
(r254527)
@@ -250,16 +250,13 @@ struct mbuf *ieee80211_getmgtframe(uint8
 #defineM_80211_RX  (M_AMPDU|M_WEP|M_AMPDU_MPDU)
 
 #defineIEEE80211_MBUF_TX_FLAG_BITS \
-   \20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_ENCAP\6M_WEP\7M_EAPOL \
-   \10M_PWR_SAV\11M_MORE_DATA\12M_BCAST\13M_MCAST\14M_FRAG\15M_FIRSTFRAG 
\
-   \16M_LASTFRAG\17M_SKIP_FIREWALL\20M_FREELIST\21M_VLANTAG\22M_PROMISC \
-   \23M_NOFREE\24M_FF\25M_TXCB\26M_AMPDU_MPDU\27M_FLOWID
+   M_FLAG_BITS \
+   \15M_ENCAP\17M_EAPOL\20M_PWR_SAV\21M_MORE_DATA\22M_FF\23M_TXCB \
+   \24M_AMPDU_MPDU\25M_FRAG\26M_FIRSTFRAG\27M_LASTFRAG
 
 #defineIEEE80211_MBUF_RX_FLAG_BITS \
-   \20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_AMPDU\6M_WEP\7M_PROTO3 \
-   \10M_PROTO4\11M_PROTO5\12M_BCAST\13M_MCAST\14M_FRAG\15M_FIRSTFRAG \
-   \16M_LASTFRAG\17M_SKIP_FIREWALL\20M_FREELIST\21M_VLANTAG\22M_PROMISC \
-   \23M_NOFREE\24M_PROTO6\25M_PROTO7\26M_AMPDU_MPDU\27M_FLOWID
+   M_FLAG_BITS \
+   \15M_AMPDU\16M_WEP\24M_AMPDU_MPDU
 
 /*
  * Store WME access control bits in the vlan tag.

Modified: head/sys/netinet/sctp_os_bsd.h
==
--- head/sys/netinet/sctp_os_bsd.h  Mon Aug 19 14:07:31 2013
(r254526)
+++ head/sys/netinet/sctp_os_bsd.h  Mon Aug 19 14:25:11 2013
(r254527)
@@ -431,7 +431,7 @@ typedef struct rtentry sctp_rtentry_t;
 /*
  * SCTP protocol specific mbuf flags.
  */
-#defineM_NOTIFICATION  M_PROTO5/* SCTP notification */
+#defineM_NOTIFICATION  M_PROTO1/* SCTP notification */
 
 /*
  * IP output routines

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Mon Aug 19 14:07:31 2013(r254526)
+++ head/sys/sys/mbuf.h Mon Aug 19 14:25:11 2013(r254527)
@@ -186,26 +186,25 @@ struct mbuf {
 #defineM_PKTHDR0x0002 /* start of record */
 #defineM_EOR   0x0004 /* end of record */
 #defineM_RDONLY0x0008 /* associated data is marked 
read-only */
-#defineM_PROTO10x0010 /* protocol-specific */
-#defineM_PROTO20x0020 /* protocol-specific */
-#defineM_PROTO30x0040 /* protocol-specific */
-#defineM_PROTO40x0080 /* protocol-specific */
-#defineM_PROTO50x0100 /* protocol-specific */
-#defineM_BCAST 0x0200 /* send/received as link-level 
broadcast */
-#defineM_MCAST 0x0400 /* send/received as link-level 
multicast */
-/* 0x0800free */
-/* 0x1000free */
-/* 0x2000free */
-#defineM_PROTO90x4000 /* protocol-specific */
-#defineM_PROTO10   0x8000 /* protocol-specific */
-#defineM_VLANTAG   0x0001 /* ether_vtag is valid */
-#defineM_PROMISC   0x0002 /* packet was not for us */
-#defineM_PROTO11   0x0004 /* protocol-specific */
-#defineM_PROTO60x0008 /* protocol-specific */
-#defineM_PROTO70x0010 /* protocol-specific */
-#defineM_PROTO80x0020 /* protocol-specific */
-#defineM_FLOWID0x0040 /* deprecated: flowid is valid */
+#defineM_BCAST 0x0010 /* send/received as link-level 
broadcast */
+#defineM_MCAST 0x0020 /* send/received as link-level 
multicast */
+#defineM_PROMISC   0x0040 /* packet was not for us */
+#defineM_VLANTAG   0x0080 /* ether_vtag is valid */
+#defineM_FLOWID0x0100 /* deprecated: flowid is valid */
+
+#defineM_PROTO10x1000 /* protocol-specific */
+#defineM_PROTO20x2000 /* protocol-specific */
+#defineM_PROTO30x4000 

svn commit: r254528 - stable/9/usr.sbin/pkg_install/add

2013-08-19 Thread Glen Barber
Author: gjb
Date: Mon Aug 19 14:38:28 2013
New Revision: 254528
URL: http://svnweb.freebsd.org/changeset/base/254528

Log:
  MFC r254525:
   Add entry for packages-9.2-release directory.
  
  Approved by:  re (implicit)

Modified:
  stable/9/usr.sbin/pkg_install/add/main.c
Directory Properties:
  stable/9/usr.sbin/pkg_install/add/   (props changed)

Modified: stable/9/usr.sbin/pkg_install/add/main.c
==
--- stable/9/usr.sbin/pkg_install/add/main.cMon Aug 19 14:25:11 2013
(r254527)
+++ stable/9/usr.sbin/pkg_install/add/main.cMon Aug 19 14:38:28 2013
(r254528)
@@ -90,6 +90,7 @@ struct {
{ 803000, 803499, /packages-8.3-release },
{ 90, 900499, /packages-9.0-release },
{ 901000, 901499, /packages-9.1-release },
+   { 902000, 902499, /packages-9.2-release },
{ 30, 399000, /packages-3-stable },
{ 40, 499000, /packages-4-stable },
{ 502100, 502128, /packages-5-current },
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254529 - stable/8/usr.sbin/pkg_install/add

2013-08-19 Thread Glen Barber
Author: gjb
Date: Mon Aug 19 14:38:35 2013
New Revision: 254529
URL: http://svnweb.freebsd.org/changeset/base/254529

Log:
  MFC r254525:
   Add entry for packages-9.2-release directory.
  
  Approved by:  re (implicit)

Modified:
  stable/8/usr.sbin/pkg_install/add/main.c
Directory Properties:
  stable/8/usr.sbin/pkg_install/add/   (props changed)

Modified: stable/8/usr.sbin/pkg_install/add/main.c
==
--- stable/8/usr.sbin/pkg_install/add/main.cMon Aug 19 14:38:28 2013
(r254528)
+++ stable/8/usr.sbin/pkg_install/add/main.cMon Aug 19 14:38:35 2013
(r254529)
@@ -91,6 +91,7 @@ struct {
{ 804000, 804499, /packages-8.4-release },
{ 90, 900499, /packages-9.0-release },
{ 901000, 901499, /packages-9.1-release },
+   { 902000, 902499, /packages-9.2-release },
{ 30, 399000, /packages-3-stable },
{ 40, 499000, /packages-4-stable },
{ 502100, 502128, /packages-5-current },
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254530 - releng/9.2/usr.sbin/pkg_install/add

2013-08-19 Thread Glen Barber
Author: gjb
Date: Mon Aug 19 14:42:39 2013
New Revision: 254530
URL: http://svnweb.freebsd.org/changeset/base/254530

Log:
  MFC r254525:
   Add entry for packages-9.2-release directory.
  
  Approved by:  re (implicit)

Modified:
  releng/9.2/usr.sbin/pkg_install/add/main.c
Directory Properties:
  releng/9.2/usr.sbin/pkg_install/add/   (props changed)

Modified: releng/9.2/usr.sbin/pkg_install/add/main.c
==
--- releng/9.2/usr.sbin/pkg_install/add/main.c  Mon Aug 19 14:38:35 2013
(r254529)
+++ releng/9.2/usr.sbin/pkg_install/add/main.c  Mon Aug 19 14:42:39 2013
(r254530)
@@ -90,6 +90,7 @@ struct {
{ 803000, 803499, /packages-8.3-release },
{ 90, 900499, /packages-9.0-release },
{ 901000, 901499, /packages-9.1-release },
+   { 902000, 902499, /packages-9.2-release },
{ 30, 399000, /packages-3-stable },
{ 40, 499000, /packages-4-stable },
{ 502100, 502128, /packages-5-current },
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254531 - head/sys/arm/arm

2013-08-19 Thread Rafal Jaworowski
Author: raj
Date: Mon Aug 19 14:56:17 2013
New Revision: 254531
URL: http://svnweb.freebsd.org/changeset/base/254531

Log:
  Simplify pv_entry removal or ARMv6/v7:
  
  - PGA_WRITEABLE indicates that there *might be* a writable mapping for the
particular page, so to avoid frequent sweeping of the pv_entries whenever
pmap_nuke_pv(), pmap_modify_pv(), etc. is called, it is sufficient to
clear that flag if there are no managed mappings for that page anymore
(notice that only pmap_enter is authorized to set this flag).
  - Avoid redundant checking for PVF_WIRED flag when this flag cannot be set
anyway.
  - Clear PGA_WRITEABLE only once for each vm_page instead of multiple,
redundant clearing it in loop when there are no writeable mappings
to that page anymore.
  
  Submitted by: Zbigniew Bodek z...@semihalf.com
  Reviewed by:  gber
  Sponsored by: The FreeBSD Foundation, Semihalf

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Mon Aug 19 14:42:39 2013(r254530)
+++ head/sys/arm/arm/pmap-v6.c  Mon Aug 19 14:56:17 2013(r254531)
@@ -1072,39 +1072,22 @@ pmap_set_prot(pt_entry_t *ptep, vm_prot_
  * = caller should NOT adjust pmap's wire_count
  * = we return the removed pve
  */
-
-static void
-pmap_nuke_pv(struct vm_page *m, pmap_t pmap, struct pv_entry *pve)
-{
-
-   rw_assert(pvh_global_lock, RA_WLOCKED);
-   PMAP_ASSERT_LOCKED(pmap);
-
-   TAILQ_REMOVE(m-md.pv_list, pve, pv_list);
-
-   if (pve-pv_flags  PVF_WIRED)
-   --pmap-pm_stats.wired_count;
-
-   if (pve-pv_flags  PVF_WRITE) {
-   TAILQ_FOREACH(pve, m-md.pv_list, pv_list)
-   if (pve-pv_flags  PVF_WRITE)
-   break;
-   if (!pve) {
-   vm_page_aflag_clear(m, PGA_WRITEABLE);
-   }
-   }
-}
-
 static struct pv_entry *
 pmap_remove_pv(struct vm_page *m, pmap_t pmap, vm_offset_t va)
 {
struct pv_entry *pve;
 
rw_assert(pvh_global_lock, RA_WLOCKED);
+   PMAP_ASSERT_LOCKED(pmap);
 
pve = pmap_find_pv(m, pmap, va);/* find corresponding pve */
-   if (pve != NULL)
-   pmap_nuke_pv(m, pmap, pve);
+   if (pve != NULL) {
+   TAILQ_REMOVE(m-md.pv_list, pve, pv_list);
+   if (pve-pv_flags  PVF_WIRED)
+   --pmap-pm_stats.wired_count;
+   }
+   if (TAILQ_EMPTY(m-md.pv_list))
+   vm_page_aflag_clear(m, PGA_WRITEABLE);
 
return(pve);/* return removed pve */
 }
@@ -1143,14 +1126,6 @@ pmap_modify_pv(struct vm_page *m, pmap_t
else
--pmap-pm_stats.wired_count;
}
-   if ((oflags  PVF_WRITE)  !(flags  PVF_WRITE)) {
-   TAILQ_FOREACH(npv, m-md.pv_list, pv_list) {
-   if (npv-pv_flags  PVF_WRITE)
-   break;
-   }
-   if (!npv)
-   vm_page_aflag_clear(m, PGA_WRITEABLE);
-   }
 
return (oflags);
 }
@@ -2062,7 +2037,9 @@ pmap_remove_pages(pmap_t pmap)
pv_entry_count--;
pmap-pm_stats.resident_count--;
pc-pc_map[field] |= bitmask;
-   pmap_nuke_pv(m, pmap, pv);
+   TAILQ_REMOVE(m-md.pv_list, pv, pv_list);
+   if (TAILQ_EMPTY(m-md.pv_list))
+   vm_page_aflag_clear(m, PGA_WRITEABLE);
pmap_free_l2_bucket(pmap, l2b, 1);
}
}
@@ -2458,7 +2435,9 @@ pmap_remove_all(vm_page_t m)
PTE_SYNC(ptep);
pmap_free_l2_bucket(pmap, l2b, 1);
pmap-pm_stats.resident_count--;
-   pmap_nuke_pv(m, pmap, pv);
+   TAILQ_REMOVE(m-md.pv_list, pv, pv_list);
+   if (pv-pv_flags  PVF_WIRED)
+   pmap-pm_stats.wired_count--;
pmap_free_pv_entry(pmap, pv);
PMAP_UNLOCK(pmap);
}
@@ -2469,6 +2448,7 @@ pmap_remove_all(vm_page_t m)
else
cpu_tlb_flushD();
}
+   vm_page_aflag_clear(m, PGA_WRITEABLE);
rw_wunlock(pvh_global_lock);
 }
 
@@ -3338,7 +3318,9 @@ pmap_pv_reclaim(pmap_t locked_pmap)
 va %x pte %x, va, *ptep));
*ptep = 0;
PTE_SYNC(ptep);
-   pmap_nuke_pv(m, pmap, pv);
+   TAILQ_REMOVE(m-md.pv_list, pv, pv_list);
+   if (TAILQ_EMPTY(m-md.pv_list))
+   vm_page_aflag_clear(m, 

svn commit: r254532 - in head/sys/arm: arm include

2013-08-19 Thread Rafal Jaworowski
Author: raj
Date: Mon Aug 19 15:12:36 2013
New Revision: 254532
URL: http://svnweb.freebsd.org/changeset/base/254532

Log:
  Clear all L2 PTE protection bits before their configuration.
  
  Revise L2_S_PROT_MASK to include all of the protection bits.  Notice that
  clearing these bits does not always take away the corresponding permissions
  (for example, permission is granted when the bit is cleared). The bits are
  cleared but are to be set or left cleared accordingly in pmap_set_prot(),
  pmap_enter_locked(), etc.
  
  Clear L2_XN along with L2_S_PROT_MASK in pmap_set_prot() so that all
  permissions related bits are cleared before actual configuration.
  
  Submitted by: Zbigniew Bodek z...@semihalf.com
  Reviewed by:  gber
  Sponsored by: The FreeBSD Foundation, Semihalf

Modified:
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm/include/pmap.h

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Mon Aug 19 14:56:17 2013(r254531)
+++ head/sys/arm/arm/pmap-v6.c  Mon Aug 19 15:12:36 2013(r254532)
@@ -1046,7 +1046,7 @@ static void
 pmap_set_prot(pt_entry_t *ptep, vm_prot_t prot, uint8_t user)
 {
 
-   *ptep = ~L2_S_PROT_MASK;
+   *ptep = ~(L2_S_PROT_MASK | L2_XN);
 
if (!(prot  VM_PROT_EXECUTE))
*ptep |= L2_XN;

Modified: head/sys/arm/include/pmap.h
==
--- head/sys/arm/include/pmap.h Mon Aug 19 14:56:17 2013(r254531)
+++ head/sys/arm/include/pmap.h Mon Aug 19 15:12:36 2013(r254532)
@@ -390,7 +390,7 @@ extern int pmap_needs_pte_sync;
 #defineL2_S_PROT_U (L2_AP0(2)) /* user read */
 #define L2_S_REF   (L2_AP0(1)) /* reference flag */
 
-#defineL2_S_PROT_MASK  (L2_S_PROT_U|L2_S_PROT_R)
+#defineL2_S_PROT_MASK  (L2_S_PROT_U|L2_S_PROT_R|L2_APX)
 #defineL2_S_EXECUTABLE(pte)(!(pte  L2_XN))
 #defineL2_S_WRITABLE(pte)  (!(pte  L2_APX))
 #defineL2_S_REFERENCED(pte)(!!(pte  L2_S_REF))
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r254527 - in head/sys: net80211 netinet sys

2013-08-19 Thread Adrian Chadd
Hi,

Would you please bump FreeBSD_version ?

I'd like to make the net80211 on -HEAD build on -9, and this is one of
those changes that will break that.

Thanks!



-adrian



On 19 August 2013 07:25, Andre Oppermann an...@freebsd.org wrote:

 Author: andre
 Date: Mon Aug 19 14:25:11 2013
 New Revision: 254527
 URL: http://svnweb.freebsd.org/changeset/base/254527

 Log:
   Reorder the mbuf defines to make more sense and group related flags
   together.

   Add M_FLAG_PRINTF for use with printf(9) %b indentifier.

   Use the generic mbuf flags print names in the net80211 code and adjust
   the protocol specific bits for their new positions.

   Change SCTP M_PROTO mapping from 5 to 1 to fit within the 16bit field
   they use internally to store some additional information.

   Discussed with:   trociny, glebius

 Modified:
   head/sys/net80211/ieee80211_freebsd.h
   head/sys/netinet/sctp_os_bsd.h
   head/sys/sys/mbuf.h

 Modified: head/sys/net80211/ieee80211_freebsd.h

 ==
 --- head/sys/net80211/ieee80211_freebsd.h   Mon Aug 19 14:07:31 2013
  (r254526)
 +++ head/sys/net80211/ieee80211_freebsd.h   Mon Aug 19 14:25:11 2013
  (r254527)
 @@ -250,16 +250,13 @@ struct mbuf *ieee80211_getmgtframe(uint8
  #defineM_80211_RX  (M_AMPDU|M_WEP|M_AMPDU_MPDU)

  #defineIEEE80211_MBUF_TX_FLAG_BITS \
 -   \20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_ENCAP\6M_WEP\7M_EAPOL \
 -
 \10M_PWR_SAV\11M_MORE_DATA\12M_BCAST\13M_MCAST\14M_FRAG\15M_FIRSTFRAG \
 -
 \16M_LASTFRAG\17M_SKIP_FIREWALL\20M_FREELIST\21M_VLANTAG\22M_PROMISC \
 -   \23M_NOFREE\24M_FF\25M_TXCB\26M_AMPDU_MPDU\27M_FLOWID
 +   M_FLAG_BITS \
 +   \15M_ENCAP\17M_EAPOL\20M_PWR_SAV\21M_MORE_DATA\22M_FF\23M_TXCB \
 +   \24M_AMPDU_MPDU\25M_FRAG\26M_FIRSTFRAG\27M_LASTFRAG

  #defineIEEE80211_MBUF_RX_FLAG_BITS \
 -   \20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_AMPDU\6M_WEP\7M_PROTO3 \
 -
 \10M_PROTO4\11M_PROTO5\12M_BCAST\13M_MCAST\14M_FRAG\15M_FIRSTFRAG \
 -
 \16M_LASTFRAG\17M_SKIP_FIREWALL\20M_FREELIST\21M_VLANTAG\22M_PROMISC \
 -   \23M_NOFREE\24M_PROTO6\25M_PROTO7\26M_AMPDU_MPDU\27M_FLOWID
 +   M_FLAG_BITS \
 +   \15M_AMPDU\16M_WEP\24M_AMPDU_MPDU

  /*
   * Store WME access control bits in the vlan tag.

 Modified: head/sys/netinet/sctp_os_bsd.h

 ==
 --- head/sys/netinet/sctp_os_bsd.h  Mon Aug 19 14:07:31 2013
  (r254526)
 +++ head/sys/netinet/sctp_os_bsd.h  Mon Aug 19 14:25:11 2013
  (r254527)
 @@ -431,7 +431,7 @@ typedef struct rtentry sctp_rtentry_t;
  /*
   * SCTP protocol specific mbuf flags.
   */
 -#defineM_NOTIFICATION  M_PROTO5/* SCTP
 notification */
 +#defineM_NOTIFICATION  M_PROTO1/* SCTP
 notification */

  /*
   * IP output routines

 Modified: head/sys/sys/mbuf.h

 ==
 --- head/sys/sys/mbuf.h Mon Aug 19 14:07:31 2013(r254526)
 +++ head/sys/sys/mbuf.h Mon Aug 19 14:25:11 2013(r254527)
 @@ -186,26 +186,25 @@ struct mbuf {
  #defineM_PKTHDR0x0002 /* start of record */
  #defineM_EOR   0x0004 /* end of record */
  #defineM_RDONLY0x0008 /* associated data is marked
 read-only */
 -#defineM_PROTO10x0010 /* protocol-specific */
 -#defineM_PROTO20x0020 /* protocol-specific */
 -#defineM_PROTO30x0040 /* protocol-specific */
 -#defineM_PROTO40x0080 /* protocol-specific */
 -#defineM_PROTO50x0100 /* protocol-specific */
 -#defineM_BCAST 0x0200 /* send/received as link-level
 broadcast */
 -#defineM_MCAST 0x0400 /* send/received as link-level
 multicast */
 -/* 0x0800free */
 -/* 0x1000free */
 -/* 0x2000free */
 -#defineM_PROTO90x4000 /* protocol-specific */
 -#defineM_PROTO10   0x8000 /* protocol-specific */
 -#defineM_VLANTAG   0x0001 /* ether_vtag is valid */
 -#defineM_PROMISC   0x0002 /* packet was not for us */
 -#defineM_PROTO11   0x0004 /* protocol-specific */
 -#defineM_PROTO60x0008 /* protocol-specific */
 -#defineM_PROTO70x0010 /* protocol-specific */
 -#defineM_PROTO80x0020 /* protocol-specific */
 -#defineM_FLOWID0x0040 /* deprecated: flowid is valid
 */
 +#defineM_BCAST 0x0010 /* send/received as link-level
 broadcast */
 +#defineM_MCAST 0x0020 /* send/received as link-level
 multicast */
 +#defineM_PROMISC   0x0040 /* packet was not for us */
 +#defineM_VLANTAG   0x0080 

svn commit: r254533 - head/sys/arm/arm

2013-08-19 Thread Rafal Jaworowski
Author: raj
Date: Mon Aug 19 15:36:23 2013
New Revision: 254533
URL: http://svnweb.freebsd.org/changeset/base/254533

Log:
  Fix ARMv6/v7 mapping's wired status.
  
  Last input argument in pmap_modify_pv() should be a mask of flags to be set.
  In pmap_change_wiring() however, the straight wired status was used, which
  does not represent valid flags (and is of type boolean).
  
  This commit fixes the issue so that wired flag is passed to pmap_modify_pv()
  properly.
  
  Submitted by: Zbigniew Bodek z...@semihalf.com
  Reviewed by:  gber
  Sponsored by: The FreeBSD Foundation, Semihalf

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Mon Aug 19 15:12:36 2013(r254532)
+++ head/sys/arm/arm/pmap-v6.c  Mon Aug 19 15:36:23 2013(r254533)
@@ -2932,7 +2932,8 @@ pmap_change_wiring(pmap_t pmap, vm_offse
pte = *ptep;
m = PHYS_TO_VM_PAGE(l2pte_pa(pte));
if (m != NULL)
-   pmap_modify_pv(m, pmap, va, PVF_WIRED, wired);
+   pmap_modify_pv(m, pmap, va, PVF_WIRED,
+   wired == TRUE ? PVF_WIRED : 0);
rw_wunlock(pvh_global_lock);
PMAP_UNLOCK(pmap);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254534 - in head/sys: conf dev/uart

2013-08-19 Thread Ian Lepore
Author: ian
Date: Mon Aug 19 15:51:30 2013
New Revision: 254534
URL: http://svnweb.freebsd.org/changeset/base/254534

Log:
  Allow UART_POLL_FREQ to be set as a kernel option as well as via tunable
  (the code was already set up for this, just needs to be in conf/options).
  
  Also, if reporting that polling is being used, report the frequency too.

Modified:
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/dev/uart/uart_core.c

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Mon Aug 19 15:36:23 2013(r254533)
+++ head/sys/conf/NOTES Mon Aug 19 15:51:30 2013(r254534)
@@ -1801,6 +1801,8 @@ deviceuart
 # Options for uart(4)
 optionsUART_PPS_ON_CTS # Do time pulse capturing using CTS
# instead of DCD.
+optionsUART_POLL_FREQ  # Set polling rate, used when hw has
+   # no interrupt support (50 Hz default).
 
 # The following hint should only be used for pure ISA devices.  It is not
 # needed otherwise.  Use of hints is strongly discouraged.

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Mon Aug 19 15:36:23 2013(r254533)
+++ head/sys/conf/options   Mon Aug 19 15:51:30 2013(r254534)
@@ -641,8 +641,9 @@ BKTR_SIS_VIA_MODE   opt_bktr.h
 BKTR_USE_FREEBSD_SMBUS opt_bktr.h
 BKTR_NEW_MSP34XX_DRIVERopt_bktr.h
 
-# Options to support PPS
+# Options for uart(4)
 UART_PPS_ON_CTSopt_uart.h
+UART_POLL_FREQ opt_uart.h
 
 # options for bus/device framework
 BUS_DEBUG  opt_bus.h

Modified: head/sys/dev/uart/uart_core.c
==
--- head/sys/dev/uart/uart_core.c   Mon Aug 19 15:36:23 2013
(r254533)
+++ head/sys/dev/uart/uart_core.c   Mon Aug 19 15:51:30 2013
(r254534)
@@ -537,7 +537,7 @@ uart_bus_attach(device_t dev)
sep = , ;
}
if (sc-sc_polled) {
-   printf(%spolled mode, sep);
+   printf(%spolled mode (%dHz), sep, uart_poll_freq);
sep = , ;
}
printf(\n);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254535 - head/sys/arm/arm

2013-08-19 Thread Rafal Jaworowski
Author: raj
Date: Mon Aug 19 15:58:39 2013
New Revision: 254535
URL: http://svnweb.freebsd.org/changeset/base/254535

Log:
  Simplify and clean up pmap_clearbit()
  
  There is no need for calling vm_page_dirty() when clearing modified flag as
  it is already set for that page in pmap_fault_fixup() or pmap_enter() thanks
  to modified bit emulation.
  
  Also, there is no need for checking PTE referenced or writeable flags.  If
  there is a request to clear a particular flag we should just do it.
  
  Submitted by: Zbigniew Bodek z...@semihalf.com
  Reviewed by:  gber
  Sponsored by: The FreeBSD Foundation, Semihalf

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Mon Aug 19 15:51:30 2013(r254534)
+++ head/sys/arm/arm/pmap-v6.c  Mon Aug 19 15:58:39 2013(r254535)
@@ -900,9 +900,6 @@ pmap_clearbit(struct vm_page *m, u_int m
 
rw_wlock(pvh_global_lock);
 
-   if (maskbits  PVF_WRITE)
-   maskbits |= PVF_MOD;
-
if (TAILQ_EMPTY(m-md.pv_list)) {
rw_wunlock(pvh_global_lock);
return (0);
@@ -924,14 +921,12 @@ pmap_clearbit(struct vm_page *m, u_int m
ptep = l2b-l2b_kva[l2pte_index(va)];
npte = opte = *ptep;
 
-   if ((maskbits  (PVF_WRITE|PVF_MOD))  L2_S_WRITABLE(opte)) {
-   vm_page_dirty(m);
-
+   if (maskbits  (PVF_WRITE | PVF_MOD)) {
/* make the pte read only */
npte |= L2_APX;
}
 
-   if ((maskbits  PVF_REF)  L2_S_REFERENCED(opte)) {
+   if (maskbits  PVF_REF) {
/*
 * Clear referenced flag in PTE so that we
 * will take a flag fault the next time the mapping
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254536 - in head/sys/arm: arm include

2013-08-19 Thread Rafal Jaworowski
Author: raj
Date: Mon Aug 19 16:16:49 2013
New Revision: 254536
URL: http://svnweb.freebsd.org/changeset/base/254536

Log:
  Do not use pv_kva on ARMv6/v7 and save some space on each vm_page.  It's only
  relevant for older ARM variants (with virtual cache).
  
  Submitted by: Zbigniew Bodek z...@semihalf.com
  Reviewed by:  gber
  Sponsored by: The FreeBSD Foundation, Semihalf

Modified:
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm/include/pmap.h

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Mon Aug 19 15:58:39 2013(r254535)
+++ head/sys/arm/arm/pmap-v6.c  Mon Aug 19 16:16:49 2013(r254536)
@@ -4365,6 +4365,6 @@ pmap_page_set_memattr(vm_page_t m, vm_me
 * uncacheable, being careful to sync caches and PTEs (and maybe
 * invalidate TLB?) for any current mapping it modifies.
 */
-   if (m-md.pv_kva != 0 || TAILQ_FIRST(m-md.pv_list) != NULL)
+   if (TAILQ_FIRST(m-md.pv_list) != NULL)
panic(Can't change memattr on page with existing mappings);
 }

Modified: head/sys/arm/include/pmap.h
==
--- head/sys/arm/include/pmap.h Mon Aug 19 15:58:39 2013(r254535)
+++ head/sys/arm/include/pmap.h Mon Aug 19 16:16:49 2013(r254536)
@@ -121,7 +121,9 @@ struct  pv_chunk;
 struct md_page {
int pvh_attrs;
vm_memattr_t pv_memattr;
+#if (ARM_MMU_V6 + ARM_MMU_V7) == 0
vm_offset_t pv_kva; /* first kernel VA mapping */
+#endif
TAILQ_HEAD(,pv_entry)   pv_list;
 };
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254537 - head/sys/sys

2013-08-19 Thread Andre Oppermann
Author: andre
Date: Mon Aug 19 16:47:06 2013
New Revision: 254537
URL: http://svnweb.freebsd.org/changeset/base/254537

Log:
  Bump __FreeBSD_version to 146 after the addition of M_PROTO[9-12]
  and removal of M_NOFREE|M_FRAG|M_FIRSTFRAG|M_LASTFRAG mbuf flags.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hMon Aug 19 16:16:49 2013(r254536)
+++ head/sys/sys/param.hMon Aug 19 16:47:06 2013(r254537)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 145  /* Master, propagated to newvers */
+#define __FreeBSD_version 146  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254538 - head/usr.bin/truss

2013-08-19 Thread John Baldwin
Author: jhb
Date: Mon Aug 19 17:09:14 2013
New Revision: 254538
URL: http://svnweb.freebsd.org/changeset/base/254538

Log:
  Remove incorrect 'const' qualifier from pointers to dynamic string
  buffers I added in the previous commit.
  
  Pointy hat to:jhb
  MFC after:1 month

Modified:
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/syscalls.c
==
--- head/usr.bin/truss/syscalls.c   Mon Aug 19 16:47:06 2013
(r254537)
+++ head/usr.bin/truss/syscalls.c   Mon Aug 19 17:09:14 2013
(r254538)
@@ -894,7 +894,7 @@ print_arg(struct syscall_args *sc, unsig
tmp = strdup(xlookup_bits(mprot_flags, args[sc-offset]));
break;
case Mmapflags: {
-   const char *base, *alignstr;
+   char *base, *alignstr;
int align, flags;
 
/*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r254520 - in head/sys: kern sys

2013-08-19 Thread Navdeep Parhar
On 08/19/13 04:16, Andre Oppermann wrote:
 Author: andre
 Date: Mon Aug 19 11:16:53 2013
 New Revision: 254520
 URL: http://svnweb.freebsd.org/changeset/base/254520
 
 Log:
   Remove the unused M_NOFREE mbuf flag.  It didn't have any in-tree users
   for a very long time, if ever.
   
   Should such a functionality ever be needed again the appropriate and
   much better way to do it is through a custom EXT_SOMETHING external mbuf
   type together with a dedicated *ext_free function.
   
   Discussed with: trociny, glebius
 
 Modified:
   head/sys/kern/kern_mbuf.c
   head/sys/kern/uipc_mbuf.c
   head/sys/sys/mbuf.h
 

Hello Andre,

Is this just garbage collection or is there some other reason for this?

I recently tried some experiments to reduce the number of mbuf and
cluster allocations in a 40G NIC driver.  M_NOFREE and EXT_EXTREF proved
very useful and the code changes to the kernel were minimal.  See
user/np/cxl_tuning.  The experiment was quite successful and I was
planning to bring in most of those changes to HEAD.  I was hoping to get
some runtime mileage on the approach in general before tweaking the
ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt
within the cluster.  But now M_NOFREE has vanished without a warning...

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


Re: svn commit: r254527 - in head/sys: net80211 netinet sys

2013-08-19 Thread Andre Oppermann

On 19.08.2013 17:12, Adrian Chadd wrote:

Hi,

Would you please bump FreeBSD_version ?


Done:

New Revision: 254537
URL: http://svnweb.freebsd.org/changeset/base/254537

Log:
  Bump __FreeBSD_version to 146 after the addition of M_PROTO[9-12]
  and removal of M_NOFREE|M_FRAG|M_FIRSTFRAG|M_LASTFRAG mbuf flags.

--
Andre

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


Re: svn commit: r254524 - head/sys/sys

2013-08-19 Thread Navdeep Parhar
On 08/19/13 06:56, Andre Oppermann wrote:
 Author: andre
 Date: Mon Aug 19 13:56:14 2013
 New Revision: 254524
 URL: http://svnweb.freebsd.org/changeset/base/254524
 
 Log:
   Add four additional M_PROTOFLAGS[9-12] for protocol specific use.
   
   Discussed with: trociny, glebius, adrian
 
 Modified:
   head/sys/sys/mbuf.h
 
 Modified: head/sys/sys/mbuf.h
 ==
 --- head/sys/sys/mbuf.h   Mon Aug 19 13:27:32 2013(r254523)
 +++ head/sys/sys/mbuf.h   Mon Aug 19 13:56:14 2013(r254524)
 @@ -196,22 +196,24 @@ struct mbuf {
  #define  M_FRAG  0x0800 /* packet is a fragment of a larger 
 packet */
  #define  M_FIRSTFRAG 0x1000 /* packet is first fragment */
  #define  M_LASTFRAG  0x2000 /* packet is last fragment */
 -  /* 0x4000free */
 -  /* 0x8000free */
 +#define  M_PROTO90x4000 /* protocol-specific */
 +#define  M_PROTO10   0x8000 /* protocol-specific */
  #define  M_VLANTAG   0x0001 /* ether_vtag is valid */
  #define  M_PROMISC   0x0002 /* packet was not for us */
 -  /* 0x0004free */
 +#define  M_PROTO11   0x0004 /* protocol-specific */
  #define  M_PROTO60x0008 /* protocol-specific */
  #define  M_PROTO70x0010 /* protocol-specific */
  #define  M_PROTO80x0020 /* protocol-specific */
  #define  M_FLOWID0x0040 /* deprecated: flowid is valid */
 +#define  M_PROTO12   0x0080 /* protocol-specific */
  #define  M_HASHTYPEBITS  0x0F00 /* mask of bits holding flowid hash 
 type */

Why reuse the freed up bits so soon (at least one of which I think was
prematurely GC'ed -- see my other email on M_NOFREE).  There was room
beyond M_HASHTYPEBITS, no?

Regards,
Navdeep

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


Re: svn commit: r254520 - in head/sys: kern sys

2013-08-19 Thread Peter Grehan

I recently tried some experiments to reduce the number of mbuf and
cluster allocations in a 40G NIC driver.  M_NOFREE and EXT_EXTREF proved
very useful and the code changes to the kernel were minimal.  See
user/np/cxl_tuning.  The experiment was quite successful and I was
planning to bring in most of those changes to HEAD.  I was hoping to get
some runtime mileage on the approach in general before tweaking the
ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt
within the cluster.  But now M_NOFREE has vanished without a warning...


 I also had a virtualization work-in-progress where static mbufs were 
allocated in the kernel and M_NOFREE set.


 Might be worth sending a prior heads-up for these type of changes.

later,

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


svn commit: r254539 - head/usr.bin

2013-08-19 Thread Andrew Turner
Author: andrew
Date: Mon Aug 19 17:44:19 2013
New Revision: 254539
URL: http://svnweb.freebsd.org/changeset/base/254539

Log:
  Subversion requires atomic functions we only support on arm with clang.

Modified:
  head/usr.bin/Makefile

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Mon Aug 19 17:09:14 2013(r254538)
+++ head/usr.bin/Makefile   Mon Aug 19 17:44:19 2013(r254539)
@@ -366,7 +366,9 @@ SUBDIR+=users
 SUBDIR+=   who
 .endif
 
-.if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == ia64 || ${MACHINE_ARCH} 
== sparc64 || ${MACHINE_ARCH} == i386 || ${MACHINE_ARCH} == armv6
+.if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == ia64 || \
+${MACHINE_ARCH} == sparc64 || ${MACHINE_ARCH} == i386 || \
+(${MACHINE_ARCH} == armv6  ${COMPILER_TYPE} == clang)
 .if ${MK_SVN} == yes || ${MK_SVNLITE} == yes
 SUBDIR+=   svn
 .endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r254440 - head/usr.sbin/rwhod

2013-08-19 Thread Mario Oshogbo
Thank you for your commit and sorry for not repair this problem earlier.

 @@ -274,6 +274,15 @@ main(int argc, char *argv[])
   exit(1);
   if (!quiet_mode) {
   pid_child_receiver = pdfork(fdp, 0);
 + if (pid_child_receiver == -1) {
 + if (errno != ENOSYS) {
 + syslog(LOG_ERR, pdfork: %m);
 + exit(1);
 + } else {
 + pid_child_receiver = fork();
 + fdp = -1;
 + }
 + }

We can't do it this way. pdfork() is used there to prevent killing only
one process. If we use fork() and we kill parent process the second
process (child process) will become a zombie process. I suggest to
revert this change. The changes that Pawel commit (r254486 (thx
jilles!!!) and r254480) should resolve all problems.

Cheers,
oshogbo



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r254309 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/dev/dtrace sys/cddl/dev/sdt sys/kern sys/sys

2013-08-19 Thread John Baldwin
On Friday, August 16, 2013 1:41:31 pm Mark Johnston wrote:
 On Fri, Aug 16, 2013 at 07:13:16PM +0200, Davide Italiano wrote:
  [trim old mails]
  
   diff --git a/sys/sys/pmckern.h b/sys/sys/pmckern.h
   index e3e18a6..90585de 100644
   --- a/sys/sys/pmckern.h
   +++ b/sys/sys/pmckern.h
   @@ -51,13 +51,11 @@
#definePMC_FN_CSW_IN   2
#definePMC_FN_CSW_OUT  3
#definePMC_FN_DO_SAMPLES   4
   -#definePMC_FN_KLD_LOAD 5
   -#definePMC_FN_KLD_UNLOAD   6
   -#definePMC_FN_MMAP 7
   -#definePMC_FN_MUNMAP   8
   -#definePMC_FN_USER_CALLCHAIN   9
   -#definePMC_FN_USER_CALLCHAIN_SOFT  10
   -#definePMC_FN_SOFT_SAMPLING11
   +#definePMC_FN_MMAP 5
   +#definePMC_FN_MUNMAP   6
   +#definePMC_FN_USER_CALLCHAIN   7
   +#definePMC_FN_USER_CALLCHAIN_SOFT  8
   +#definePMC_FN_SOFT_SAMPLING9
  
  
  I've skimmed over your patch quickly so I could miss something, but I
  worry about this change breaking the KBI.
  Does this make sense for you?
 
 I think you're right. I considered this last night, but it didn't occur
 to me that external modules might try to invoke these hooks. I'm not
 sure if such modules exist, but it's better to be safe. I updated the
 patch here:
 
 http://people.freebsd.org/~markj/patches/hwpmc-eh/hwpmc-eh-3.diff

This generally looks correct.  I would probably not call it
KLD_LOCK_ASSERT_READ() as it asserts any lock (not specifically a
read lock).  Normally I would use macros like this:

KLD_WLOCK/WUNLOCK
KLD_RLOCK/RUNLOCK
KLD_ASSERT_LOCKED/KLD_ASSERT_WLOCKED

However, the existing macros all were named to not assume read
locking and then some read locking was added on the side.  I'm
not sure exactly what macro name makes the most sense, and would
in fact be tempted to just retire all the KLD_* macros for locking
and use sx(9) directly, but that is a fairly minor point.  (And if
done should be a separate commit).

Thanks for doing this!

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


Re: svn commit: r254440 - head/usr.sbin/rwhod

2013-08-19 Thread Hiroki Sato
Mario Oshogbo osho...@freebsd.org wrote
  in 521267c2.60...@freebsd.org:

os Thank you for your commit and sorry for not repair this problem earlier.
os
os  @@ -274,6 +274,15 @@ main(int argc, char *argv[])
osexit(1);
osif (!quiet_mode) {
ospid_child_receiver = pdfork(fdp, 0);
os  + if (pid_child_receiver == -1) {
os  + if (errno != ENOSYS) {
os  + syslog(LOG_ERR, pdfork: %m);
os  + exit(1);
os  + } else {
os  + pid_child_receiver = fork();
os  + fdp = -1;
os  + }
os  + }
os
os We can't do it this way. pdfork() is used there to prevent killing only
os one process. If we use fork() and we kill parent process the second
os process (child process) will become a zombie process. I suggest to
os revert this change. The changes that Pawel commit (r254486 (thx
os jilles!!!) and r254480) should resolve all problems.

 When the parent process is killed, the child process will be an child
 process of init, not a zombie, and init calls waitpid() when it
 terminates (by SIGTERM, for example).  I agree that this should be
 improved, but I do not think removing fallback to fork(2) is a good
 idea if PROCDESC is still a kernel option.  Reverting will not solve
 the problem that it does not work with a kernel without PROCDESC.

-- Hiroki


pgp89FUBvHbvy.pgp
Description: PGP signature


Re: svn commit: r254440 - head/usr.sbin/rwhod

2013-08-19 Thread Mario Oshogbo
  When the parent process is killed, the child process will be an child
  process of init, not a zombie, and init calls waitpid() when it
  terminates (by SIGTERM, for example).  I agree that this should be
  improved, but I do not think removing fallback to fork(2) is a good
  idea if PROCDESC is still a kernel option.  Reverting will not solve
  the problem that it does not work with a kernel without PROCDESC.
 
 -- Hiroki
 

Yes, but Pawel add PROCDESC to GENERIC in commit r254480.



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r254309 - in head: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/dev/dtrace sys/cddl/dev/sdt sys/kern sys/sys

2013-08-19 Thread Mark Johnston
On Mon, Aug 19, 2013 at 03:42:30PM -0400, John Baldwin wrote:
 On Friday, August 16, 2013 1:41:31 pm Mark Johnston wrote:
  On Fri, Aug 16, 2013 at 07:13:16PM +0200, Davide Italiano wrote:
   [trim old mails]
   
diff --git a/sys/sys/pmckern.h b/sys/sys/pmckern.h
index e3e18a6..90585de 100644
--- a/sys/sys/pmckern.h
+++ b/sys/sys/pmckern.h
@@ -51,13 +51,11 @@
 #definePMC_FN_CSW_IN   2
 #definePMC_FN_CSW_OUT  3
 #definePMC_FN_DO_SAMPLES   4
-#definePMC_FN_KLD_LOAD 5
-#definePMC_FN_KLD_UNLOAD   6
-#definePMC_FN_MMAP 7
-#definePMC_FN_MUNMAP   8
-#definePMC_FN_USER_CALLCHAIN   9
-#definePMC_FN_USER_CALLCHAIN_SOFT  10
-#definePMC_FN_SOFT_SAMPLING11
+#definePMC_FN_MMAP 5
+#definePMC_FN_MUNMAP   6
+#definePMC_FN_USER_CALLCHAIN   7
+#definePMC_FN_USER_CALLCHAIN_SOFT  8
+#definePMC_FN_SOFT_SAMPLING9
   
   
   I've skimmed over your patch quickly so I could miss something, but I
   worry about this change breaking the KBI.
   Does this make sense for you?
  
  I think you're right. I considered this last night, but it didn't occur
  to me that external modules might try to invoke these hooks. I'm not
  sure if such modules exist, but it's better to be safe. I updated the
  patch here:
  
  http://people.freebsd.org/~markj/patches/hwpmc-eh/hwpmc-eh-3.diff
 
 This generally looks correct.  I would probably not call it
 KLD_LOCK_ASSERT_READ() as it asserts any lock (not specifically a
 read lock).  Normally I would use macros like this:
 
   KLD_WLOCK/WUNLOCK
   KLD_RLOCK/RUNLOCK
   KLD_ASSERT_LOCKED/KLD_ASSERT_WLOCKED
 
 However, the existing macros all were named to not assume read
 locking and then some read locking was added on the side.  I'm
 not sure exactly what macro name makes the most sense, and would
 in fact be tempted to just retire all the KLD_* macros for locking
 and use sx(9) directly, but that is a fairly minor point.  (And if
 done should be a separate commit).

Yeah, KLD_LOCK_ASSERT_READ() is awkward, but I couldn't come up with
anything better without renaming the existing macros. I'm fine with
getting rid of them and using the sx_* calls directly; it'll be the same
amount of churn as changing the macro names anyway.

So how about this: I'll get rid of the macros in one commit, change the
locking rules for linker_file_lookup_set() using my existing patch but
without the KLD lock macros, and then convert the hwpmc(4) hooks to use
the new event handlers (making sure to avoid breaking the KBI as Davide
pointed out).

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


Re: svn commit: r254520 - in head/sys: kern sys

2013-08-19 Thread Andre Oppermann

On 19.08.2013 19:33, Navdeep Parhar wrote:

On 08/19/13 04:16, Andre Oppermann wrote:

Author: andre
Date: Mon Aug 19 11:16:53 2013
New Revision: 254520
URL: http://svnweb.freebsd.org/changeset/base/254520

Log:
   Remove the unused M_NOFREE mbuf flag.  It didn't have any in-tree users
   for a very long time, if ever.

   Should such a functionality ever be needed again the appropriate and
   much better way to do it is through a custom EXT_SOMETHING external mbuf
   type together with a dedicated *ext_free function.

   Discussed with:  trociny, glebius

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



Hello Andre,

Is this just garbage collection or is there some other reason for this?


This is garbage collection and removal of not quite right, rotten, 
functionality.


I recently tried some experiments to reduce the number of mbuf and
cluster allocations in a 40G NIC driver.  M_NOFREE and EXT_EXTREF proved
very useful and the code changes to the kernel were minimal.  See
user/np/cxl_tuning.  The experiment was quite successful and I was
planning to bring in most of those changes to HEAD.  I was hoping to get
some runtime mileage on the approach in general before tweaking the
ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt
within the cluster.  But now M_NOFREE has vanished without a warning...


I'm looking through your experimental code and that is some really good
numbers you're achieving there!

However a couple things don't feel quite right, hackish even, and not
fit for HEAD.  This is a bit the same situation we had with some of the
first 1GigE cards quite a number of years back (mostly ti(4)).  There
we ended up with a couple of just good enough hacks to make it fast.
Most of the remains I've collected today.

I believe most of the improvements you've shown can be implemented in
a more generic and safe way into the mbuf system.  Also a number of things
in your experimental code may have side-effects in situations other than
netperf runs.

To summarize what I get from your experimental branch commits:
- the Chelsio T4/T5 card can DMA multiple ethernet frames (packets) into
  a single memory buffer, provided it is large enough.
- you make use of that feature and point multiple m_ext mbufs into that
  buffer to separate the packets and send them up the stack.
- you embed the m_ext refcount into the single memory buffer as well.
- you recycle mbufs? (I'm not entirely clear on that as I'm not familiar
  with the cxgbe code)

Lets examine and discuss these parts:
- M_NOFREE wasn't really safe with bpf anyway at least for packets going
  down the stack.
- Instead of M_NOFREE a custom *ext_free should be used that has the same
  and even more functionality.
- Recycling mbufs may cause imbalances to the mbuf pool with multiple cores
  and possibly NUMA in the future.  Not that we are very good with it at
  the moment but bypassing the mbuf allocator shouldn't become the norm.
  If it is a problem/bottleneck again it should be fixed, not worked around
  and copy-pasted n-times in so many drivers.
- jumbo9 and jumbo16 mbufs should not be used because they are more special
  than necessary with being KVM and physically contiguous.  This probably
  isn't necessary for the T4/T5 cards and any other modern DMA engine.
  Under heavy diverse network the kernel memory becomes fragmented and can't
  find memory fulfilling both criteria anymore.  In fact both are an artifact
  of the early GigE hacks when high speed DMA engines were in their infancy.
  Both jumbo9 and jumbo16 should go away without direct replacement.
  In your T4/T5 case the alternative would be either to a) allocate your
  own memory directly from KVM with the necessary properties (KVM and/or phys
  contig); b) have such a generic kernel mbuf type fulfilling the same role.
  There may be some cache line issues on non-x86 systems that have to be
  though and taken care of.
- Refcounts should have the option of being separately allocated.  It was
  mandatory to use the refcount zone so far because there wasn't any other
  type of refcount.  Now that we have one we should revisit the issue.
  Actually the entire mbuf allocation and initialization could be streamlined
  as a whole.

On a side note a different mbuf handling for the RX DMA rings may give some
significant improvements as well: allocate just a cluster without a mbuf through
m_cljget() and put it into the RX ring.  Only when the DMA has put a packet into
it allocated attach the mbuf (in the drivers RX function).  This avoids the 
cache
pollution from touching the mbuf fields during initial allocation, including the
refcount.

Another nice trick would be to shorten the mbuf by 4 bytes (in ext_size) and put
the refcount there.

Lets work on these together.

--
Andre

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, 

Re: svn commit: r254520 - in head/sys: kern sys

2013-08-19 Thread Andre Oppermann

On 19.08.2013 19:40, Peter Grehan wrote:

I recently tried some experiments to reduce the number of mbuf and
cluster allocations in a 40G NIC driver.  M_NOFREE and EXT_EXTREF proved
very useful and the code changes to the kernel were minimal.  See
user/np/cxl_tuning.  The experiment was quite successful and I was
planning to bring in most of those changes to HEAD.  I was hoping to get
some runtime mileage on the approach in general before tweaking the
ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt
within the cluster.  But now M_NOFREE has vanished without a warning...


  I also had a virtualization work-in-progress where static mbufs were 
allocated in the kernel and
M_NOFREE set.

  Might be worth sending a prior heads-up for these type of changes.


I'm sorry for ambushing but this stuff has to be done.  I have provided
an alternative way of handling it and I'm happy to help you with your
use case to make it good for you and to prevent the mbuf system from
getting bloated and hackish again.

Mbuf is a core system for the kernel and we should avoid to kitchen-sink
it again while at the same time to keep speedy enough to keep up with
the speed requirements.

I believe it would be bad to have Navdeep, you and others invent their
own network buffer management routines over again in slightly different
ways tailored to each immediate use case.

Can you please describe your intended use of M_NOFREE to better understand
the shortcomings of the current mbuf systems and the additional advantages
of the M_NOFREE case?

--
Andre

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


Re: svn commit: r254520 - in head/sys: kern sys

2013-08-19 Thread Adrian Chadd
fwiw - +1 on everything you've said to date about this.



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


Re: svn commit: r254520 - in head/sys: kern sys

2013-08-19 Thread Navdeep Parhar
On 08/19/13 13:58, Andre Oppermann wrote:
 On 19.08.2013 19:33, Navdeep Parhar wrote:
 On 08/19/13 04:16, Andre Oppermann wrote:
 Author: andre
 Date: Mon Aug 19 11:16:53 2013
 New Revision: 254520
 URL: http://svnweb.freebsd.org/changeset/base/254520

 Log:
Remove the unused M_NOFREE mbuf flag.  It didn't have any in-tree
 users
for a very long time, if ever.

Should such a functionality ever be needed again the appropriate and
much better way to do it is through a custom EXT_SOMETHING
 external mbuf
type together with a dedicated *ext_free function.

Discussed with:trociny, glebius

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


 Hello Andre,

 Is this just garbage collection or is there some other reason for this?
 
 This is garbage collection and removal of not quite right, rotten,
 functionality.
 
 I recently tried some experiments to reduce the number of mbuf and
 cluster allocations in a 40G NIC driver.  M_NOFREE and EXT_EXTREF proved
 very useful and the code changes to the kernel were minimal.  See
 user/np/cxl_tuning.  The experiment was quite successful and I was
 planning to bring in most of those changes to HEAD.  I was hoping to get
 some runtime mileage on the approach in general before tweaking the
 ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt
 within the cluster.  But now M_NOFREE has vanished without a warning...
 
 I'm looking through your experimental code and that is some really good
 numbers you're achieving there!
 
 However a couple things don't feel quite right, hackish even, and not
 fit for HEAD.  This is a bit the same situation we had with some of the
 first 1GigE cards quite a number of years back (mostly ti(4)).  There
 we ended up with a couple of just good enough hacks to make it fast.
 Most of the remains I've collected today.

If M_NOFREE and EXT_EXTREF are properly supported in the tree (and I'm
arguing that they were, before r254520) then the changes are perfectly
legitimate.  The only hackish part was that I was getting the cluster
from the jumbop zone while bypassing its normal refcnt mechanism.  This
I did so as to use the same zone as m_uiotombuf to keep it hot for all
consumers (driver + network stack).

 I believe most of the improvements you've shown can be implemented in
 a more generic and safe way into the mbuf system.  Also a number of things
 in your experimental code may have side-effects in situations other than
 netperf runs.

Agreed.  As I mentioned my long term plan was to tweak the jumboX zones
to allow them to allocate cluster with embedded mbuf + refcount.  The
M_NOFREE+EXT_EXTREF approach is the perfect bridge from here to there.
It is non-intrusive and lends itself well to experimentation.

 
 To summarize what I get from your experimental branch commits:
 - the Chelsio T4/T5 card can DMA multiple ethernet frames (packets) into
   a single memory buffer, provided it is large enough.
 - you make use of that feature and point multiple m_ext mbufs into that
   buffer to separate the packets and send them up the stack.
 - you embed the m_ext refcount into the single memory buffer as well.

yes, yes, and yes.

 - you recycle mbufs? (I'm not entirely clear on that as I'm not familiar
   with the cxgbe code)

I recycle the cluster (and the embedded mbuf in it) when possible.  All
depends on whether it's still in use by the time the rx queue needs it back.

 
 Lets examine and discuss these parts:
 - M_NOFREE wasn't really safe with bpf anyway at least for packets going
   down the stack.

I see.  Can you point out the parts of bpf unable to deal with M_NOFREE?

 - Instead of M_NOFREE a custom *ext_free should be used that has the same
   and even more functionality.

Yes, that's what I was planning too, with the jumboX zone changes.  It
would be faster than running the m_ext's free function (which is a
function dereference+call).

 - Recycling mbufs may cause imbalances to the mbuf pool with multiple cores
   and possibly NUMA in the future.  Not that we are very good with it at
   the moment but bypassing the mbuf allocator shouldn't become the norm.
   If it is a problem/bottleneck again it should be fixed, not worked around
   and copy-pasted n-times in so many drivers.

If/when a cluster is recycled, it is given back to the same rx ithread
that originally allocated it, and not not any other queue.  If the
ithread stays in the same NUMA domain (and it really should) then
recycling the cluster in the same queue really shouldn't cause imbalances.

 - jumbo9 and jumbo16 mbufs should not be used because they are more special
   than necessary with being KVM and physically contiguous.  This probably
   isn't necessary for the T4/T5 cards and any other modern DMA engine.
   Under heavy diverse network the kernel memory becomes fragmented and
 can't
   find memory fulfilling both criteria anymore.  In fact both are an
 artifact
   of the early GigE hacks 

Re: svn commit: r254520 - in head/sys: kern sys

2013-08-19 Thread Navdeep Parhar
On 08/19/13 14:08, Andre Oppermann wrote:
 On 19.08.2013 19:40, Peter Grehan wrote:
 I recently tried some experiments to reduce the number of mbuf and
 cluster allocations in a 40G NIC driver.  M_NOFREE and EXT_EXTREF proved
 very useful and the code changes to the kernel were minimal.  See
 user/np/cxl_tuning.  The experiment was quite successful and I was
 planning to bring in most of those changes to HEAD.  I was hoping to get
 some runtime mileage on the approach in general before tweaking the
 ctors/dtors for jumpbo, jumbo9, jumbo16 to allow for an mbuf+refcnt
 within the cluster.  But now M_NOFREE has vanished without a warning...

   I also had a virtualization work-in-progress where static mbufs were
 allocated in the kernel and
 M_NOFREE set.

   Might be worth sending a prior heads-up for these type of changes.
 
 I'm sorry for ambushing but this stuff has to be done.  I have provided
 an alternative way of handling it and I'm happy to help you with your
 use case to make it good for you and to prevent the mbuf system from
 getting bloated and hackish again.

I don't know what Peter's use case is but I'm curious about the
already-available alternative to M_NOFREE, if that's what you meant.
Can you please elaborate?

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


svn commit: r254542 - head/sys/arm/conf

2013-08-19 Thread Andrew Turner
Author: andrew
Date: Mon Aug 19 22:25:36 2013
New Revision: 254542
URL: http://svnweb.freebsd.org/changeset/base/254542

Log:
  Enable VFP on the Zedboard.

Modified:
  head/sys/arm/conf/ZEDBOARD

Modified: head/sys/arm/conf/ZEDBOARD
==
--- head/sys/arm/conf/ZEDBOARD  Mon Aug 19 20:46:14 2013(r254541)
+++ head/sys/arm/conf/ZEDBOARD  Mon Aug 19 22:25:36 2013(r254542)
@@ -52,6 +52,7 @@ options   SYSVMSG #SYSV-style message q
 optionsSYSVSEM #SYSV-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
 optionsFREEBSD_BOOT_LOADER
+optionsVFP # vfp/neon
 
 # Debugging
 makeoptionsDEBUG=-g
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254544 - head/sys/vm

2013-08-19 Thread Jeff Roberson
Author: jeff
Date: Mon Aug 19 23:54:24 2013
New Revision: 254544
URL: http://svnweb.freebsd.org/changeset/base/254544

Log:
   - Increase the active lru refresh interval to 10 minutes.  This has been
 shown to negatively impact some workloads and the goal is only to
 eliminate worst case behaviors for very long periods of paging
 inactivity.  Eventually we should determine a more complex scaling
 factor for this feature.
   - Rate limit low memory callback handlers to limit thrashing.  Set the
 default to 10 seconds.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cMon Aug 19 23:02:39 2013(r254543)
+++ head/sys/vm/vm_pageout.cMon Aug 19 23:54:24 2013(r254544)
@@ -159,6 +159,8 @@ static int vm_max_launder = 32;
 static int vm_pageout_update_period;
 static int defer_swap_pageouts;
 static int disable_swap_pageouts;
+static int lowmem_period = 10;
+static int lowmem_ticks;
 
 #if defined(NO_SWAPPING)
 static int vm_swap_enabled = 0;
@@ -179,6 +181,9 @@ SYSCTL_INT(_vm, OID_AUTO, pageout_update
CTLFLAG_RW, vm_pageout_update_period, 0,
Maximum active LRU update period);
   
+SYSCTL_INT(_vm, OID_AUTO, lowmem_period, CTLFLAG_RW, lowmem_period, 0,
+   Low memory callback period);
+
 #if defined(NO_SWAPPING)
 SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled,
CTLFLAG_RD, vm_swap_enabled, 0, Enable entire process swapout);
@@ -901,9 +906,10 @@ vm_pageout_scan(struct vm_domain *vmd, i
 
/*
 * If we need to reclaim memory ask kernel caches to return
-* some.
+* some.  We rate limit to avoid thrashing.
 */
-   if (pass  0) {
+   if (vmd == vm_dom[0]  pass  0 
+   lowmem_ticks + (lowmem_period * hz)  ticks) {
/*
 * Decrease registered cache sizes.
 */
@@ -913,6 +919,7 @@ vm_pageout_scan(struct vm_domain *vmd, i
 * drained above.
 */
uma_reclaim();
+   lowmem_ticks = ticks;
}
 
/*
@@ -1680,10 +1687,11 @@ vm_pageout(void)
 
/*
 * Set interval in seconds for active scan.  We want to visit each
-* page at least once a minute.
+* page at least once every ten minutes.  This is to prevent worst
+* case paging behaviors with stale active LRU.
 */
if (vm_pageout_update_period == 0)
-   vm_pageout_update_period = 60;
+   vm_pageout_update_period = 600;
 
/* XXX does not really belong here */
if (vm_page_max_wired == 0)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254545 - stable/9/usr.sbin/makefs

2013-08-19 Thread Glen Barber
Author: gjb
Date: Tue Aug 20 00:35:21 2013
New Revision: 254545
URL: http://svnweb.freebsd.org/changeset/base/254545

Log:
  MFC r254397:
Mark the makefs(8) '-p' flag as deprecated in preference for
the '-Z' flag for compatibility with NetBSD.

Modified:
  stable/9/usr.sbin/makefs/makefs.8
  stable/9/usr.sbin/makefs/makefs.c
Directory Properties:
  stable/9/usr.sbin/makefs/   (props changed)

Modified: stable/9/usr.sbin/makefs/makefs.8
==
--- stable/9/usr.sbin/makefs/makefs.8   Mon Aug 19 23:54:24 2013
(r254544)
+++ stable/9/usr.sbin/makefs/makefs.8   Tue Aug 20 00:35:21 2013
(r254545)
@@ -35,7 +35,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd August 22, 2012
+.Dd August 16, 2013
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -43,7 +43,7 @@
 .Nd create a file system image from a directory tree or a mtree manifest
 .Sh SYNOPSIS
 .Nm
-.Op Fl Dpx
+.Op Fl DxZ
 .Op Fl B Ar byte-order
 .Op Fl b Ar free-blocks
 .Op Fl d Ar debug-mask
@@ -191,7 +191,10 @@ Set file system specific options.
 is a comma separated list of options.
 Valid file system specific options are detailed below.
 .It Fl p
-Create the image as a sparse file.
+Deprecated.
+See the
+.Fl Z
+flag.
 .It Fl S Ar sector-size
 Set the file system sector size to
 .Ar sector-size .
@@ -213,6 +216,8 @@ ISO 9660 file system.
 .El
 .It Fl x
 Exclude file system nodes not explicitly listed in the specfile.
+.It Fl Z
+Create the image as a sparse file.
 .El
 .Pp
 Where sizes are specified, a decimal number of bytes is expected.

Modified: stable/9/usr.sbin/makefs/makefs.c
==
--- stable/9/usr.sbin/makefs/makefs.c   Mon Aug 19 23:54:24 2013
(r254544)
+++ stable/9/usr.sbin/makefs/makefs.c   Tue Aug 20 00:35:21 2013
(r254545)
@@ -113,7 +113,7 @@ main(int argc, char *argv[])
start_time.tv_sec = start.tv_sec;
start_time.tv_nsec = start.tv_usec * 1000;
 
-   while ((ch = getopt(argc, argv, B:b:Dd:f:F:M:m:N:o:ps:S:t:x)) != -1) {
+   while ((ch = getopt(argc, argv, B:b:Dd:f:F:M:m:N:o:ps:S:t:xZ)) != -1) 
{
switch (ch) {
 
case 'B':
@@ -205,6 +205,7 @@ main(int argc, char *argv[])
break;
}
case 'p':
+   /* Deprecated in favor of 'Z' */
fsoptions.sparse = 1;
break;
 
@@ -233,6 +234,11 @@ main(int argc, char *argv[])
fsoptions.onlyspec = 1;
break;
 
+   case 'Z':
+   /* Superscedes 'p' for compatibility with NetBSD 
makefs(8) */
+   fsoptions.sparse = 1;
+   break;
+
case '?':
default:
usage();
@@ -354,7 +360,7 @@ usage(void)
fprintf(stderr,
 usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n
 \t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n
-\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-px]\n
+\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-xZ]\n
 \t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n,
prog);
exit(1);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r254547 - head/sys/amd64/amd64

2013-08-19 Thread Neel Natu
Author: neel
Date: Tue Aug 20 02:09:26 2013
New Revision: 254547
URL: http://svnweb.freebsd.org/changeset/base/254547

Log:
  Fix breakage caused by r254466 in minidumpsys().
  
  r254466 increased the KVA from 512GB to 2TB which requires 4 PDP pages as
  opposed to a single one before the change. This broke minidumpsys() since
  it assumed that the entire KVA could be addressed via a single PDP page.
  
  Fix this by obtaining the address of the PDP page from the PML4 entry
  associated with the KVA being dumped.
  
  Reported by:  pho
  Submitted by: kib
  Pointy hat to:neel

Modified:
  head/sys/amd64/amd64/minidump_machdep.c

Modified: head/sys/amd64/amd64/minidump_machdep.c
==
--- head/sys/amd64/amd64/minidump_machdep.c Tue Aug 20 01:14:16 2013
(r254546)
+++ head/sys/amd64/amd64/minidump_machdep.c Tue Aug 20 02:09:26 2013
(r254547)
@@ -221,8 +221,8 @@ minidumpsys(struct dumperinfo *di)
vm_offset_t va;
int error;
uint64_t bits;
-   uint64_t *pdp, *pd, *pt, pa;
-   int i, j, k, n, bit;
+   uint64_t *pml4, *pdp, *pd, *pt, pa;
+   int i, ii, j, k, n, bit;
int retry_count;
struct minidumphdr mdhdr;
 
@@ -232,7 +232,6 @@ minidumpsys(struct dumperinfo *di)
counter = 0;
/* Walk page table pages, set bits in vm_page_dump */
pmapsize = 0;
-   pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys);
for (va = VM_MIN_KERNEL_ADDRESS; va  MAX(KERNBASE + nkpt * NBPDR,
kernel_vm_end); ) {
/*
@@ -240,6 +239,9 @@ minidumpsys(struct dumperinfo *di)
 * page written corresponds to 1GB of space
 */
pmapsize += PAGE_SIZE;
+   ii = (va  PML4SHIFT)  ((1ul  NPML4EPGSHIFT) - 1);
+   pml4 = (uint64_t *)PHYS_TO_DMAP(KPML4phys) + ii;
+   pdp = (uint64_t *)PHYS_TO_DMAP(*pml4  PG_FRAME);
i = (va  PDPSHIFT)  ((1ul  NPDPEPGSHIFT) - 1);
if ((pdp[i]  PG_V) == 0) {
va += NBPDP;
@@ -364,9 +366,11 @@ minidumpsys(struct dumperinfo *di)
 
/* Dump kernel page directory pages */
bzero(fakepd, sizeof(fakepd));
-   pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys);
for (va = VM_MIN_KERNEL_ADDRESS; va  MAX(KERNBASE + nkpt * NBPDR,
kernel_vm_end); va += NBPDP) {
+   ii = (va  PML4SHIFT)  ((1ul  NPML4EPGSHIFT) - 1);
+   pml4 = (uint64_t *)PHYS_TO_DMAP(KPML4phys) + ii;
+   pdp = (uint64_t *)PHYS_TO_DMAP(*pml4  PG_FRAME);
i = (va  PDPSHIFT)  ((1ul  NPDPEPGSHIFT) - 1);
 
/* We always write a page, even if it is zero */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r254519 - in head/sys: netinet netinet6 sys

2013-08-19 Thread Julian Elischer

On 8/19/13 7:08 PM, Andre Oppermann wrote:

Author: andre
Date: Mon Aug 19 11:08:36 2013
New Revision: 254519
URL: http://svnweb.freebsd.org/changeset/base/254519

Log:
   Move the global M_SKIP_FIREWALL mbuf flags to a protocol layer specific
   flag instead.  The flag is only used within the IP and IPv6 layer 3
   protocols.


wel, maybe
Layer 2 usage of ipfw could make use of this flag as well.
Cisco were using L2 ipfw some years back. I don't know if this affects 
them at all.


   
   Because some firewall packages treat IPv4 and IPv6 packets the same the

   flag should have the same value for both.
   
   Discussed with:	trociny, glebius


Modified:
   head/sys/netinet/ip_var.h
   head/sys/netinet6/ip6_var.h
   head/sys/sys/mbuf.h

Modified: head/sys/netinet/ip_var.h
==
--- head/sys/netinet/ip_var.h   Mon Aug 19 10:34:10 2013(r254518)
+++ head/sys/netinet/ip_var.h   Mon Aug 19 11:08:36 2013(r254519)
@@ -163,10 +163,12 @@ void  kmod_ipstat_dec(int statnum);
  #define IP_ALLOWBROADCAST SO_BROADCAST/* 0x20 can send broadcast 
packets */
  
  /*

- * mbuf flag used by ip_fastfwd
+ * IPv4 protocol layer specific mbuf flags.
   */
  #define   M_FASTFWD_OURS  M_PROTO1/* changed dst to local 
*/
  #define   M_IP_NEXTHOPM_PROTO2/* explicit ip nexthop 
*/
+#defineM_SKIP_FIREWALL M_PROTO3/* skip firewall 
processing,
+  keep in sync with IP6 */
  #define   M_IP_FRAG   M_PROTO4/* fragment reassembly 
*/
  
  #ifdef __NO_STRICT_ALIGNMENT


Modified: head/sys/netinet6/ip6_var.h
==
--- head/sys/netinet6/ip6_var.h Mon Aug 19 10:34:10 2013(r254518)
+++ head/sys/netinet6/ip6_var.h Mon Aug 19 11:08:36 2013(r254519)
@@ -293,7 +293,12 @@ struct ip6aux {
  #define   IPV6_FORWARDING 0x02/* most of IPv6 header exists */
  #define   IPV6_MINMTU 0x04/* use minimum MTU 
(IPV6_USE_MIN_MTU) */
  
-#define	M_IP6_NEXTHOP		M_PROTO7	/* explicit ip nexthop */

+/*
+ * IPv6 protocol layer specific mbuf flags.
+ */
+#defineM_IP6_NEXTHOP   M_PROTO2/* explicit ip nexthop 
*/
+#defineM_SKIP_FIREWALL M_PROTO3/* skip firewall 
processing,
+  keep in sync with IPv4 */
  
  #ifdef __NO_STRICT_ALIGNMENT

  #define IP6_HDR_ALIGNED_P(ip) 1

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Mon Aug 19 10:34:10 2013(r254518)
+++ head/sys/sys/mbuf.h Mon Aug 19 11:08:36 2013(r254519)
@@ -196,7 +196,7 @@ struct mbuf {
  #define   M_FRAG  0x0800 /* packet is a fragment of a larger 
packet */
  #define   M_FIRSTFRAG 0x1000 /* packet is first fragment */
  #define   M_LASTFRAG  0x2000 /* packet is last fragment */
-#defineM_SKIP_FIREWALL 0x4000 /* skip firewall processing */
+/* 0x4000free */
 /* 0x8000free */
  #define   M_VLANTAG   0x0001 /* ether_vtag is valid */
  #define   M_PROMISC   0x0002 /* packet was not for us */
@@ -253,7 +253,7 @@ struct mbuf {
   * Flags preserved when copying m_pkthdr.
   */
  #define   M_COPYFLAGS \
-(M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_SKIP_FIREWALL|M_BCAST|M_MCAST|\
+(M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_BCAST|M_MCAST|\
   M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_VLANTAG|M_PROMISC|M_HASHTYPEBITS)
  
  /*





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