svn commit: r367740 - stable/12/sys/netinet

2020-11-16 Thread George V. Neville-Neil
Author: gnn
Date: Tue Nov 17 01:02:00 2020
New Revision: 367740
URL: https://svnweb.freebsd.org/changeset/base/367740

Log:
  MFC: 367628, 367635, 367645
  
  An earlier commit effectively turned out the fast forwading path
due to its lack of support for ICMP redirects. The following commit
adds redirects to the fastforward path, again allowing for decent
forwarding performance in the kernel.
  
Reviewed by: ae, melifaro (also helped with the MFC)
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")

Modified:
  stable/12/sys/netinet/ip_fastfwd.c
  stable/12/sys/netinet/ip_input.c
  stable/12/sys/netinet/ip_var.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/ip_fastfwd.c
==
--- stable/12/sys/netinet/ip_fastfwd.c  Tue Nov 17 00:35:59 2020
(r367739)
+++ stable/12/sys/netinet/ip_fastfwd.c  Tue Nov 17 01:02:00 2020
(r367740)
@@ -110,6 +110,62 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#defineV_ipsendredirects   VNET(ipsendredirects)
+
+struct mbuf *
+ip_redir_alloc(struct mbuf *m, struct ip *ip, struct in_addr dest,
+in_addr_t *addr);
+
+
+struct mbuf *
+ip_redir_alloc(struct mbuf *m, struct ip *ip, struct in_addr dest,
+in_addr_t *addr)
+{
+   struct sockaddr_in s;
+   struct nhop4_extended nh;
+   struct mbuf *mcopy = m_gethdr(M_NOWAIT, m->m_type);
+
+   if (mcopy == NULL)
+   return (NULL);
+
+   if (fib4_lookup_nh_ext(M_GETFIB(m), dest, 0, 0, ) != 0)
+   return (NULL);
+
+   if (m_dup_pkthdr(mcopy, m, M_NOWAIT) == 0) {
+   /*
+* It's probably ok if the pkthdr dup fails (because
+* the deep copy of the tag chain failed), but for now
+* be conservative and just discard the copy since
+* code below may some day want the tags.
+*/
+   m_free(mcopy);
+   return (NULL);
+   }
+   mcopy->m_len = min(ntohs(ip->ip_len), M_TRAILINGSPACE(mcopy));
+   mcopy->m_pkthdr.len = mcopy->m_len;
+   m_copydata(m, 0, mcopy->m_len, mtod(mcopy, caddr_t));
+
+   s.sin_len = sizeof(struct sockaddr_in);
+   s.sin_family= AF_INET;
+   s.sin_addr = nh.nh_src;
+
+   if (((nh.nh_flags & (NHF_REDIRECT|NHF_DEFAULT)) == 0)) {
+   struct in_ifaddr *nh_ia = (struct in_ifaddr 
*)ifaof_ifpforaddr((struct sockaddr *), nh.nh_ifp);
+   u_long src = ntohl(ip->ip_src.s_addr);
+   
+   if (nh_ia != NULL && (src & nh_ia->ia_subnetmask) == 
nh_ia->ia_subnet) {
+   if (nh.nh_flags & NHF_GATEWAY)
+   *addr = nh.nh_addr.s_addr;
+   else
+   *addr = ip->ip_dst.s_addr;
+   }
+   }
+
+
+   return (mcopy);
+}
+
+
 static int
 ip_findroute(struct nhop4_basic *pnh, struct in_addr dest, struct mbuf *m)
 {
@@ -157,7 +213,8 @@ ip_tryforward(struct mbuf *m)
uint16_t ip_len, ip_off;
int error = 0;
struct m_tag *fwd_tag = NULL;
-
+   struct mbuf *mcopy = NULL;
+   struct in_addr redest;
/*
 * Are we active and forwarding packets?
 */
@@ -381,6 +438,13 @@ passout:
dst.sin_addr = nh.nh_addr;
 
/*
+* Handle redirect case.
+*/
+   redest.s_addr = 0;
+   if (V_ipsendredirects && (nh.nh_ifp == m->m_pkthdr.rcvif))
+   mcopy = ip_redir_alloc(m, ip, dest, _addr);
+
+   /*
 * Check if packet fits MTU or if hardware will fragment for us
 */
if (ip_len <= nh.nh_mtu) {
@@ -450,7 +514,16 @@ passout:
IPSTAT_INC(ips_forward);
IPSTAT_INC(ips_fastforward);
}
+
+   /* Send required redirect */
+   if (mcopy != NULL) {
+   icmp_error(mcopy, ICMP_REDIRECT, ICMP_REDIRECT_HOST, 
redest.s_addr, 0);
+   mcopy = NULL; /* Freed by caller */
+   }
+
 consumed:
+   if (mcopy != NULL)
+   m_freem(mcopy);
return NULL;
 drop:
if (m)

Modified: stable/12/sys/netinet/ip_input.c
==
--- stable/12/sys/netinet/ip_input.cTue Nov 17 00:35:59 2020
(r367739)
+++ stable/12/sys/netinet/ip_input.cTue Nov 17 01:02:00 2020
(r367740)
@@ -109,8 +109,11 @@ SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding,
 _NAME(ipforwarding), 0,
 "Enable IP forwarding between interfaces");
 
-VNET_DEFINE_STATIC(int, ipsendredirects) = 1;  /* XXX */
-#defineV_ipsendredirects   VNET(ipsendredirects)
+/*
+ * Respond with an ICMP host redirect when we forward a packet out of
+ * the same interface on which it was received.  See RFC 792.
+ */
+VNET_DEFINE(int, ipsendredirects) = 1;
 SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, 

svn commit: r367635 - head/sys/netinet

2020-11-13 Thread George V. Neville-Neil
Author: gnn
Date: Fri Nov 13 13:07:44 2020
New Revision: 367635
URL: https://svnweb.freebsd.org/changeset/base/367635

Log:
  Followup pointed out by ae@

Modified:
  head/sys/netinet/ip_fastfwd.c

Modified: head/sys/netinet/ip_fastfwd.c
==
--- head/sys/netinet/ip_fastfwd.c   Fri Nov 13 09:49:22 2020
(r367634)
+++ head/sys/netinet/ip_fastfwd.c   Fri Nov 13 13:07:44 2020
(r367635)
@@ -118,7 +118,11 @@ ip_redir_alloc(struct mbuf *m, struct nhop_object *nh,
 struct ip *ip, in_addr_t *addr)
 {
struct mbuf *mcopy = m_gethdr(M_NOWAIT, m->m_type);
-   if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_NOWAIT)) {
+
+   if (mcopy == NULL)
+   return (NULL);
+
+   if (m_dup_pkthdr(mcopy, m, M_NOWAIT) == 0) {
/*
 * It's probably ok if the pkthdr dup fails (because
 * the deep copy of the tag chain failed), but for now
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367628 - head/sys/netinet

2020-11-12 Thread George V. Neville-Neil
Author: gnn
Date: Thu Nov 12 21:58:47 2020
New Revision: 367628
URL: https://svnweb.freebsd.org/changeset/base/367628

Log:
  An earlier commit effectively turned out the fast forwading path
  due to its lack of support for ICMP redirects. The following commit
  adds redirects to the fastforward path, again allowing for decent
  forwarding performance in the kernel.
  
  Reviewed by: ae, melifaro
  Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")

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

Modified: head/sys/netinet/ip_fastfwd.c
==
--- head/sys/netinet/ip_fastfwd.c   Thu Nov 12 20:22:58 2020
(r367627)
+++ head/sys/netinet/ip_fastfwd.c   Thu Nov 12 21:58:47 2020
(r367628)
@@ -111,6 +111,43 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#defineV_ipsendredirects   VNET(ipsendredirects)
+
+static struct mbuf *
+ip_redir_alloc(struct mbuf *m, struct nhop_object *nh,
+struct ip *ip, in_addr_t *addr)
+{
+   struct mbuf *mcopy = m_gethdr(M_NOWAIT, m->m_type);
+   if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_NOWAIT)) {
+   /*
+* It's probably ok if the pkthdr dup fails (because
+* the deep copy of the tag chain failed), but for now
+* be conservative and just discard the copy since
+* code below may some day want the tags.
+*/
+   m_free(mcopy);
+   return (NULL);
+   } 
+   mcopy->m_len = min(ntohs(ip->ip_len), M_TRAILINGSPACE(mcopy));
+   mcopy->m_pkthdr.len = mcopy->m_len;
+   m_copydata(m, 0, mcopy->m_len, mtod(mcopy, caddr_t));
+   
+   if (nh != NULL &&
+   ((nh->nh_flags & (NHF_REDIRECT|NHF_DEFAULT)) == 0)) {
+   struct in_ifaddr *nh_ia = (struct in_ifaddr *)(nh->nh_ifa);
+   u_long src = ntohl(ip->ip_src.s_addr);
+   
+   if (nh_ia != NULL && (src & nh_ia->ia_subnetmask) == 
nh_ia->ia_subnet) {
+   if (nh->nh_flags & NHF_GATEWAY)
+   *addr = nh->gw4_sa.sin_addr.s_addr;
+   else
+   *addr = ip->ip_dst.s_addr;
+   }
+   }
+   return (mcopy);
+}
+
+
 static int
 ip_findroute(struct nhop_object **pnh, struct in_addr dest, struct mbuf *m)
 {
@@ -156,13 +193,14 @@ ip_tryforward(struct mbuf *m)
 {
struct ip *ip;
struct mbuf *m0 = NULL;
-   struct nhop_object *nh;
+   struct nhop_object *nh = NULL;
struct sockaddr_in dst;
struct in_addr dest, odest, rtdest;
uint16_t ip_len, ip_off;
int error = 0;
struct m_tag *fwd_tag = NULL;
-
+   struct mbuf *mcopy = NULL;
+   struct in_addr redest;
/*
 * Are we active and forwarding packets?
 */
@@ -387,6 +425,13 @@ passout:
dst.sin_addr = dest;
 
/*
+* Handle redirect case.
+*/
+   redest.s_addr = 0;
+   if (V_ipsendredirects && (nh->nh_ifp == m->m_pkthdr.rcvif))
+   mcopy = ip_redir_alloc(m, nh, ip, _addr);
+
+   /*
 * Check if packet fits MTU or if hardware will fragment for us
 */
if (ip_len <= nh->nh_mtu) {
@@ -455,7 +500,16 @@ passout:
IPSTAT_INC(ips_forward);
IPSTAT_INC(ips_fastforward);
}
+
+   /* Send required redirect */
+   if (mcopy != NULL) {
+   icmp_error(mcopy, ICMP_REDIRECT, ICMP_REDIRECT_HOST, 
redest.s_addr, 0);
+   mcopy = NULL; /* Freed by caller */
+   }
+
 consumed:
+   if (mcopy != NULL)
+   m_freem(mcopy);
return NULL;
 drop:
if (m)

Modified: head/sys/netinet/ip_input.c
==
--- head/sys/netinet/ip_input.c Thu Nov 12 20:22:58 2020(r367627)
+++ head/sys/netinet/ip_input.c Thu Nov 12 21:58:47 2020(r367628)
@@ -111,8 +111,11 @@ SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding,
 _NAME(ipforwarding), 0,
 "Enable IP forwarding between interfaces");
 
-VNET_DEFINE_STATIC(int, ipsendredirects) = 1;  /* XXX */
-#defineV_ipsendredirects   VNET(ipsendredirects)
+/* 
+ * Respond with an ICMP host redirect when we forward a packet out of
+ * the same interface on which it was received.  See RFC 792.
+ */
+VNET_DEFINE(int, ipsendredirects) = 1;
 SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_VNET | 
CTLFLAG_RW,
 _NAME(ipsendredirects), 0,
 "Enable sending IP redirects");
@@ -571,7 +574,7 @@ tooshort:
 * case skip another inbound firewall processing and update
 * ip pointer.
 */
-   if (V_ipforwarding != 0 && V_ipsendredirects == 0
+   if (V_ipforwarding != 0
 #if defined(IPSEC) || defined(IPSEC_SUPPORT)
&& 

svn commit: r364175 - svnadmin/conf

2020-08-12 Thread George V. Neville-Neil
Author: gnn
Date: Wed Aug 12 18:35:21 2020
New Revision: 364175
URL: https://svnweb.freebsd.org/changeset/base/364175

Log:
  Restore Qing Li's commit bit
  
  gnn to rementor
  
  Approved by: core@

Modified:
  svnadmin/conf/access

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessWed Aug 12 17:27:24 2020(r364174)
+++ svnadmin/conf/accessWed Aug 12 18:35:21 2020(r364175)
@@ -162,6 +162,7 @@ pjd
 pkelsey
 pluknet
 pstef
+qingli
 ram
 ray
 rew
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r357488 - stable/12/sys/dev/e1000

2020-02-03 Thread George V. Neville-Neil
Author: gnn
Date: Tue Feb  4 03:31:28 2020
New Revision: 357488
URL: https://svnweb.freebsd.org/changeset/base/357488

Log:
  MFC 356913
  
  Add support for latest Intel I219 device, supported in Lenovo Carbon X1 v7

Modified:
  stable/12/sys/dev/e1000/e1000_api.c
  stable/12/sys/dev/e1000/e1000_hw.h
  stable/12/sys/dev/e1000/if_em.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/e1000/e1000_api.c
==
--- stable/12/sys/dev/e1000/e1000_api.c Tue Feb  4 02:44:52 2020
(r357487)
+++ stable/12/sys/dev/e1000/e1000_api.c Tue Feb  4 03:31:28 2020
(r357488)
@@ -319,6 +319,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
case E1000_DEV_ID_PCH_ICP_I219_V8:
case E1000_DEV_ID_PCH_ICP_I219_LM9:
case E1000_DEV_ID_PCH_ICP_I219_V9:
+   case E1000_DEV_ID_PCH_ICP_I219_V10:
mac->type = e1000_pch_cnp;
break;
case E1000_DEV_ID_82575EB_COPPER:

Modified: stable/12/sys/dev/e1000/e1000_hw.h
==
--- stable/12/sys/dev/e1000/e1000_hw.h  Tue Feb  4 02:44:52 2020
(r357487)
+++ stable/12/sys/dev/e1000/e1000_hw.h  Tue Feb  4 03:31:28 2020
(r357488)
@@ -155,6 +155,7 @@ struct e1000_hw;
 #define E1000_DEV_ID_PCH_ICP_I219_V8   0x15E0
 #define E1000_DEV_ID_PCH_ICP_I219_LM9  0x15E1
 #define E1000_DEV_ID_PCH_ICP_I219_V9   0x15E2
+#define E1000_DEV_ID_PCH_ICP_I219_V10  0x0D4F
 #define E1000_DEV_ID_82576 0x10C9
 #define E1000_DEV_ID_82576_FIBER   0x10E6
 #define E1000_DEV_ID_82576_SERDES  0x10E7

Modified: stable/12/sys/dev/e1000/if_em.c
==
--- stable/12/sys/dev/e1000/if_em.c Tue Feb  4 02:44:52 2020
(r357487)
+++ stable/12/sys/dev/e1000/if_em.c Tue Feb  4 03:31:28 2020
(r357488)
@@ -174,6 +174,7 @@ static pci_vendor_info_t em_vendor_info_array[] =
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) PRO/1000 Network 
Connection"),
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) PRO/1000 Network 
Connection"),
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) PRO/1000 Network 
Connection"),
+   PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V10, "Intel(R) PRO/1000 Network 
Connection"),
/* required last entry */
PVID_END
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r356913 - head/sys/dev/e1000

2020-01-20 Thread George V. Neville-Neil
Author: gnn
Date: Mon Jan 20 12:53:02 2020
New Revision: 356913
URL: https://svnweb.freebsd.org/changeset/base/356913

Log:
  Add support for latest Intel I219 device, supported in Lenovo Carbon X1 v7
  
  MFC after:2 weeks

Modified:
  head/sys/dev/e1000/e1000_api.c
  head/sys/dev/e1000/e1000_hw.h
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/e1000_api.c
==
--- head/sys/dev/e1000/e1000_api.c  Mon Jan 20 12:16:32 2020
(r356912)
+++ head/sys/dev/e1000/e1000_api.c  Mon Jan 20 12:53:02 2020
(r356913)
@@ -319,6 +319,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
case E1000_DEV_ID_PCH_ICP_I219_V8:
case E1000_DEV_ID_PCH_ICP_I219_LM9:
case E1000_DEV_ID_PCH_ICP_I219_V9:
+   case E1000_DEV_ID_PCH_ICP_I219_V10:
mac->type = e1000_pch_cnp;
break;
case E1000_DEV_ID_82575EB_COPPER:

Modified: head/sys/dev/e1000/e1000_hw.h
==
--- head/sys/dev/e1000/e1000_hw.h   Mon Jan 20 12:16:32 2020
(r356912)
+++ head/sys/dev/e1000/e1000_hw.h   Mon Jan 20 12:53:02 2020
(r356913)
@@ -155,6 +155,7 @@ struct e1000_hw;
 #define E1000_DEV_ID_PCH_ICP_I219_V8   0x15E0
 #define E1000_DEV_ID_PCH_ICP_I219_LM9  0x15E1
 #define E1000_DEV_ID_PCH_ICP_I219_V9   0x15E2
+#define E1000_DEV_ID_PCH_ICP_I219_V10  0x0D4F
 #define E1000_DEV_ID_82576 0x10C9
 #define E1000_DEV_ID_82576_FIBER   0x10E6
 #define E1000_DEV_ID_82576_SERDES  0x10E7

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Mon Jan 20 12:16:32 2020(r356912)
+++ head/sys/dev/e1000/if_em.c  Mon Jan 20 12:53:02 2020(r356913)
@@ -174,6 +174,7 @@ static pci_vendor_info_t em_vendor_info_array[] =
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) PRO/1000 Network 
Connection"),
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) PRO/1000 Network 
Connection"),
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) PRO/1000 Network 
Connection"),
+   PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V10, "Intel(R) PRO/1000 Network 
Connection"),
/* required last entry */
PVID_END
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350864 - stable/12/sys/net

2019-08-11 Thread George V. Neville-Neil
Author: gnn
Date: Sun Aug 11 20:34:16 2019
New Revision: 350864
URL: https://svnweb.freebsd.org/changeset/base/350864

Log:
  MFC: 350557
  
  Properly validate arguments for route deletion
  
  Reported by: Liang Zhuo brightiup.z...@gmail.com

Modified:
  stable/12/sys/net/route.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net/route.c
==
--- stable/12/sys/net/route.c   Sun Aug 11 19:17:29 2019(r350863)
+++ stable/12/sys/net/route.c   Sun Aug 11 20:34:16 2019(r350864)
@@ -1553,6 +1553,8 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru
switch (req) {
case RTM_DELETE:
if (netmask) {
+   if (dst->sa_len > sizeof(mdst))
+   return (EINVAL);
rt_maskedcopy(dst, (struct sockaddr *), netmask);
dst = (struct sockaddr *)
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350865 - stable/11/sys/net

2019-08-11 Thread George V. Neville-Neil
Author: gnn
Date: Sun Aug 11 20:34:24 2019
New Revision: 350865
URL: https://svnweb.freebsd.org/changeset/base/350865

Log:
  MFC: 350557
  
  Properly validate arguments for route deletion
  
  Reported by: Liang Zhuo brightiup.z...@gmail.com

Modified:
  stable/11/sys/net/route.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/net/route.c
==
--- stable/11/sys/net/route.c   Sun Aug 11 20:34:16 2019(r350864)
+++ stable/11/sys/net/route.c   Sun Aug 11 20:34:24 2019(r350865)
@@ -1612,6 +1612,8 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru
switch (req) {
case RTM_DELETE:
if (netmask) {
+   if (dst->sa_len > sizeof(mdst))
+   return (EINVAL);
rt_maskedcopy(dst, (struct sockaddr *), netmask);
dst = (struct sockaddr *)
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350557 - head/sys/net

2019-08-03 Thread George V. Neville-Neil
Author: gnn
Date: Sat Aug  3 14:42:07 2019
New Revision: 350557
URL: https://svnweb.freebsd.org/changeset/base/350557

Log:
  Properly validte arguments for route deletion
  
  Reported by: Liang Zhuo brightiup.z...@gmail.com
  MFC after:1 week

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cSat Aug  3 13:53:14 2019(r350556)
+++ head/sys/net/route.cSat Aug  3 14:42:07 2019(r350557)
@@ -1590,6 +1590,8 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru
switch (req) {
case RTM_DELETE:
if (netmask) {
+   if (dst->sa_len > sizeof(mdst))
+   return (EINVAL);
rt_maskedcopy(dst, (struct sockaddr *), netmask);
dst = (struct sockaddr *)
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342139 - in head: . bin/date libexec/rc/rc.d share/man/man5 tools/build/mk tools/build/options usr.sbin usr.sbin/timed

2018-12-15 Thread George V. Neville-Neil
Author: gnn
Date: Sat Dec 15 21:34:40 2018
New Revision: 342139
URL: https://svnweb.freebsd.org/changeset/base/342139

Log:
  Remove, the now very outdated, timed.
  
  Submitted by: Kyle Spiers ksspiers at gmail
  Reviewed by:  bcr,brooks,bz,sbruno
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D18505

Deleted:
  head/bin/date/extern.h
  head/bin/date/netdate.c
  head/libexec/rc/rc.d/timed
  head/tools/build/options/WITHOUT_TIMED
  head/usr.sbin/timed/
Modified:
  head/ObsoleteFiles.inc
  head/UPDATING
  head/bin/date/Makefile
  head/bin/date/Makefile.depend
  head/bin/date/date.c
  head/libexec/rc/rc.d/Makefile
  head/share/man/man5/src.conf.5
  head/tools/build/mk/OptionalObsoleteFiles.inc
  head/usr.sbin/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sat Dec 15 20:07:32 2018(r342138)
+++ head/ObsoleteFiles.inc  Sat Dec 15 21:34:40 2018(r342139)
@@ -38,6 +38,12 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20181214: Remove timed files
+OLD_FILES+=etc/rc.d/timed
+OLD_FILES+=usr/sbin/timed
+OLD_FILES+=usr/sbin/timedc
+OLD_FILES+=usr/share/man/man8/timed.8.gz
+OLD_FILES+=usr/share/man/man8/timedc.8.gz
 # 20181211: new clang import which bumps version from 6.0.1 to 7.0.1.
 OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/allocator_interface.h
 OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/asan_interface.h

Modified: head/UPDATING
==
--- head/UPDATING   Sat Dec 15 20:07:32 2018(r342138)
+++ head/UPDATING   Sat Dec 15 21:34:40 2018(r342139)
@@ -37,6 +37,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
prerequisites and upgrading, if you are not already using clang 3.5.0
or higher.
 
+20181211:
+   Remove the timed and netdate programs from the base tree.  Setting
+   the time with these deamons has been obsolete for over a decade.
+
 20181126:
On amd64, arm64 and armv7 (architectures that install LLVM's ld.lld
linker as /usr/bin/ld) GNU ld is no longer installed as ld.bfd, as

Modified: head/bin/date/Makefile
==
--- head/bin/date/Makefile  Sat Dec 15 20:07:32 2018(r342138)
+++ head/bin/date/Makefile  Sat Dec 15 21:34:40 2018(r342139)
@@ -5,7 +5,7 @@
 
 PACKAGE=runtime
 PROG=  date
-SRCS=  date.c netdate.c vary.c
+SRCS=  date.c vary.c
 
 HAS_TESTS=
 SUBDIR.${MK_TESTS}+= tests

Modified: head/bin/date/Makefile.depend
==
--- head/bin/date/Makefile.depend   Sat Dec 15 20:07:32 2018
(r342138)
+++ head/bin/date/Makefile.depend   Sat Dec 15 21:34:40 2018
(r342139)
@@ -4,7 +4,6 @@
 DIRDEPS = \
gnu/lib/csu \
include \
-   include/protocols \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \

Modified: head/bin/date/date.c
==
--- head/bin/date/date.cSat Dec 15 20:07:32 2018(r342138)
+++ head/bin/date/date.cSat Dec 15 21:34:40 2018(r342139)
@@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "extern.h"
 #include "vary.h"
 
 #ifndefTM_YEAR_BASE
@@ -67,7 +66,6 @@ __FBSDID("$FreeBSD$");
 #endif
 
 static time_t tval;
-int retval;
 
 static void badformat(void);
 static void iso8601_usage(const char *);
@@ -248,7 +246,7 @@ printdate(const char *buf)
(void)printf("%s\n", buf);
if (fflush(stdout))
err(1, "stdout");
-   exit(retval);
+   exit(EXIT_SUCCESS);
 }
 
 static void
@@ -370,7 +368,7 @@ setthetime(const char *fmt, const char *p, int jflag, 
 
if (!jflag) {
/* set the time */
-   if (nflag || netsettime(tval)) {
+   if (nflag) {
utx.ut_type = OLD_TIME;
memset(utx.ut_id, 0, sizeof(utx.ut_id));
(void)gettimeofday(_tv, NULL);

Modified: head/libexec/rc/rc.d/Makefile
==
--- head/libexec/rc/rc.d/Makefile   Sat Dec 15 20:07:32 2018
(r342138)
+++ head/libexec/rc/rc.d/Makefile   Sat Dec 15 21:34:40 2018
(r342139)
@@ -291,10 +291,6 @@ SMRCD= sendmail
 SMRCDPACKAGE=  sendmail
 .endif
 
-.if ${MK_TIMED} != "no"
-CONFS+=timed
-.endif
-
 .if ${MK_UNBOUND} != "no"
 CONFGROUPS+=   UNBOUND
 UNBOUND+=  local_unbound

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Sat Dec 15 20:07:32 2018
(r342138)
+++ head/share/man/man5/src.conf.5  Sat Dec 15 

svn commit: r341428 - svnadmin/conf

2018-12-03 Thread George V. Neville-Neil
Author: gnn
Date: Mon Dec  3 15:25:40 2018
New Revision: 341428
URL: https://svnweb.freebsd.org/changeset/base/341428

Log:
  Free Vincenzo Maffione from mentorship

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Mon Dec  3 15:18:35 2018(r341427)
+++ svnadmin/conf/mentors   Mon Dec  3 15:25:40 2018(r341428)
@@ -35,5 +35,4 @@ slavash   kib Co-mentor: hselasky
 slmken Co-mentor: scottl, ambrisko
 thjjtl
 tmunro mjg Co-mentor: allanjude
-vmaffione  hrs Co-mentor: gnn
 wosch  cem
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339196 - svnadmin/conf

2018-10-05 Thread George V. Neville-Neil
Author: gnn
Date: Fri Oct  5 15:03:40 2018
New Revision: 339196
URL: https://svnweb.freebsd.org/changeset/base/339196

Log:
  Add myself as co-mentor with hrs@ for Vincenzo Maffione

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Fri Oct  5 12:51:30 2018(r339195)
+++ svnadmin/conf/mentors   Fri Oct  5 15:03:40 2018(r339196)
@@ -37,4 +37,5 @@ sef   mav
 slavashkib Co-mentor: hselasky
 slmken Co-mentor: scottl, ambrisko
 thjjtl
+vmaffione  hrs Co-mentor: gnn
 wosch  cem
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r339017 - svnadmin/conf

2018-09-29 Thread George V. Neville-Neil
Author: gnn
Date: Sat Sep 29 16:37:58 2018
New Revision: 339017
URL: https://svnweb.freebsd.org/changeset/base/339017

Log:
  Free Daichi Goto from mentorship

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Sat Sep 29 16:17:35 2018(r339016)
+++ svnadmin/conf/mentors   Sat Sep 29 16:37:58 2018(r339017)
@@ -16,7 +16,6 @@ arichardson   jhb Co-mentor: brooks
 bcran  eadler
 brdallanjude   Co-mentor: bapt
 bwidawsk   emaste
-daichi gnn
 defpjd
 eriae  Co-mentor: thompsa
 gordon delphij Co-mentor: emaste
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r332410 - svnadmin/conf

2018-04-11 Thread George V. Neville-Neil
Author: gnn
Date: Wed Apr 11 17:18:54 2018
New Revision: 332410
URL: https://svnweb.freebsd.org/changeset/base/332410

Log:
  Temporarily suspend Bruce Simpson's commit bit.
  
  Approved by: core

Modified:
  svnadmin/conf/access

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessWed Apr 11 15:15:34 2018(r332409)
+++ svnadmin/conf/accessWed Apr 11 17:18:54 2018(r332410)
@@ -40,7 +40,6 @@ bapt
 bde
 bdrewery
 benno
-bms
 br
 brd
 brooks
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r326503 - in head/sys/dev: rtwn/usb usb

2017-12-03 Thread George V. Neville-Neil
Author: gnn
Date: Sun Dec  3 22:02:30 2017
New Revision: 326503
URL: https://svnweb.freebsd.org/changeset/base/326503

Log:
  Add support for RealTek 8812 over USB
  
  Tested with ALFA AWUS036ACH
  
  MFC after:1 week

Modified:
  head/sys/dev/rtwn/usb/rtwn_usb_attach.h
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h
==
--- head/sys/dev/rtwn/usb/rtwn_usb_attach.h Sun Dec  3 20:36:36 2017
(r326502)
+++ head/sys/dev/rtwn/usb/rtwn_usb_attach.h Sun Dec  3 22:02:30 2017
(r326503)
@@ -134,6 +134,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = {
RTWN_RTL8812AU_DEV(MELCO,   WIU3866D),
RTWN_RTL8812AU_DEV(NEC, WL900U),
RTWN_RTL8812AU_DEV(PLANEX2, GW900D),
+   RTWN_RTL8812AU_DEV(REALTEK, RTL8812AU),
RTWN_RTL8812AU_DEV(SENAO,   EUB1200AC),
RTWN_RTL8812AU_DEV(SITECOMEU,   WLA7100),
RTWN_RTL8812AU_DEV(TPLINK,  T4U),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsSun Dec  3 20:36:36 2017(r326502)
+++ head/sys/dev/usb/usbdevsSun Dec  3 22:02:30 2017(r326503)
@@ -3886,6 +3886,7 @@ product REALTEK RTL8713   0x8713  RTL8713
 product REALTEK RTL8188CU_COMBO0x8754  RTL8188CU
 product REALTEK RTL8723BU  0xb720  RTL8723BU
 product REALTEK RTL8192SU  0xc512  RTL8192SU
+product REALTEK RTL8812AU  0x8812  RTL8812AU Wireless Adapter
 
 /* RedOctane products */
 product REDOCTANE DUMMY0x  Dummy product
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r324435 - head/sys/contrib/dev/iwm

2017-10-09 Thread George V. Neville-Neil
Author: gnn
Date: Mon Oct  9 15:54:57 2017
New Revision: 324435
URL: https://svnweb.freebsd.org/changeset/base/324435

Log:
  Add the firmware for the Intel 8265 WiFi device.
  
  MFC after:1 month

Added:
  head/sys/contrib/dev/iwm/iwm-8265-22.fw.uu

Added: head/sys/contrib/dev/iwm/iwm-8265-22.fw.uu
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/contrib/dev/iwm/iwm-8265-22.fw.uu  Mon Oct  9 15:54:57 2017
(r324435)
@@ -0,0 +1,40270 @@
+begin 644 iwm-8265-22.fw
+M`$E73`IS=')E86TZ0V]R94-Y8VQE,3E?"`$`'@@"
+MCWX#`!P0`!L$`@```#,,
+M@```@`$`,PP!``"(``"S#`(`
+M`$```(`&`!,```"\`@```$!```8```"A```!``"&@P<6
+M(`#/`0!`0`$$A`4`
+M
+MU7?1O$KMC1P!%L)AM`1@'DT[FA#1
+MOWMZR()DJ-L;GQEBIN9H[A^ZS%KH6MG.(:=CV\&$V<0:'I[5@L7;]O#+S6])Q;OTUZ`
+M@Q9O#\ZQZUROU1XL3>@GIX0A'ZLQS3.]EM]`#)-:.@LH#44.K^C\7[\`!P3D
+MY4F9W;8[]70ZRI8T>H?6RDCG3OM
+M8]KY^9H/)$3]O$5[

svn commit: r324434 - in head/sys: dev/iwm modules/iwmfw/iwm8265fw

2017-10-09 Thread George V. Neville-Neil
Author: gnn
Date: Mon Oct  9 15:48:56 2017
New Revision: 324434
URL: https://svnweb.freebsd.org/changeset/base/324434

Log:
  Add support for Intel 8265 WiFi
  
  Obtained from:OpenBSD
  MFC after:1 month

Added:
  head/sys/modules/iwmfw/iwm8265fw/
  head/sys/modules/iwmfw/iwm8265fw/Makefile   (contents, props changed)
Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwm_8000.c
  head/sys/dev/iwm/if_iwm_config.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Mon Oct  9 15:39:43 2017(r324433)
+++ head/sys/dev/iwm/if_iwm.c   Mon Oct  9 15:48:56 2017(r324434)
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.42 2015/05/30 02:49:23 deraadt Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.167 2017/04/04 00:40:52 claudio Exp $*/
 
 /*
  * Copyright (c) 2014 genua mbh 
@@ -5690,6 +5690,7 @@ iwm_intr(void *arg)
 #definePCI_PRODUCT_INTEL_WL_7265_2 0x095b
 #definePCI_PRODUCT_INTEL_WL_8260_1 0x24f3
 #definePCI_PRODUCT_INTEL_WL_8260_2 0x24f4
+#definePCI_PRODUCT_INTEL_WL_8265_1 0x24fd
 
 static const struct iwm_devices {
uint16_tdevice;
@@ -5705,6 +5706,7 @@ static const struct iwm_devices {
{ PCI_PRODUCT_INTEL_WL_7265_2, _cfg },
{ PCI_PRODUCT_INTEL_WL_8260_1, _cfg },
{ PCI_PRODUCT_INTEL_WL_8260_2, _cfg },
+   { PCI_PRODUCT_INTEL_WL_8265_1, _cfg },
 };
 
 static int

Modified: head/sys/dev/iwm/if_iwm_8000.c
==
--- head/sys/dev/iwm/if_iwm_8000.c  Mon Oct  9 15:39:43 2017
(r324433)
+++ head/sys/dev/iwm/if_iwm_8000.c  Mon Oct  9 15:48:56 2017
(r324434)
@@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$");
 #include "if_iwm_config.h"
 
 #define IWM8000_FW "iwm8000Cfw"
+#define IWM8265_FW "iwm8265fw"
 
 #define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10
 
@@ -90,6 +91,13 @@ __FBSDID("$FreeBSD$");
 const struct iwm_cfg iwm8260_cfg = {
.name = "Intel(R) Dual Band Wireless AC 8260",
.fw_name = IWM8000_FW,
+   IWM_DEVICE_8000_COMMON,
+   .host_interrupt_operation_mode = 0,
+};
+
+const struct iwm_cfg iwm8265_cfg = {
+   .name = "Intel(R) Dual Band Wireless AC 8265",
+   .fw_name = IWM8265_FW,
IWM_DEVICE_8000_COMMON,
.host_interrupt_operation_mode = 0,
 };

Modified: head/sys/dev/iwm/if_iwm_config.h
==
--- head/sys/dev/iwm/if_iwm_config.hMon Oct  9 15:39:43 2017
(r324433)
+++ head/sys/dev/iwm/if_iwm_config.hMon Oct  9 15:48:56 2017
(r324434)
@@ -131,5 +131,6 @@ extern const struct iwm_cfg iwm3165_cfg;
 extern const struct iwm_cfg iwm7265_cfg;
 extern const struct iwm_cfg iwm7265d_cfg;
 extern const struct iwm_cfg iwm8260_cfg;
+extern const struct iwm_cfg iwm8265_cfg;
 
 #endif /* __IWM_CONFIG_H__ */

Added: head/sys/modules/iwmfw/iwm8265fw/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/iwmfw/iwm8265fw/Makefile   Mon Oct  9 15:48:56 2017
(r324434)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+KMOD=  iwm8265fw
+IMG=   iwm-8265-22
+
+.include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r323814 - in stable/11/cddl: contrib/opensolaris/cmd/dtrace/test/tst/common/funcs lib/libdtrace

2017-09-20 Thread George V. Neville-Neil
Author: gnn
Date: Wed Sep 20 16:31:06 2017
New Revision: 323814
URL: https://svnweb.freebsd.org/changeset/base/323814

Log:
  MFC: 323253, 323499
  
  Add D definitions for the named values in socket.h (gnn@)
  
  Fix DTrace test tst_inet_ntop_d: remove definitions are already in libdtrace 
(lwhsu@)

Added:
  stable/11/cddl/lib/libdtrace/socket.d
 - copied unchanged from r323253, head/cddl/lib/libdtrace/socket.d
Modified:
  
stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d
  stable/11/cddl/lib/libdtrace/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: 
stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d
==
--- 
stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d
 Wed Sep 20 16:31:00 2017(r323813)
+++ 
stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d
 Wed Sep 20 16:31:06 2017(r323814)
@@ -28,9 +28,6 @@
 
 #pragma D option quiet
 
-inline int AF_INET = 2;
-inline int AF_INET6 = 28;
-
 in_addr_t *ip4a;
 in_addr_t *ip4b;
 in_addr_t *ip4c;

Modified: stable/11/cddl/lib/libdtrace/Makefile
==
--- stable/11/cddl/lib/libdtrace/Makefile   Wed Sep 20 16:31:00 2017
(r323813)
+++ stable/11/cddl/lib/libdtrace/Makefile   Wed Sep 20 16:31:06 2017
(r323814)
@@ -53,6 +53,7 @@ DSRCS=errno.d \
siftr.d \
signal.d\
tcp.d   \
+   socket.d\
udp.d   \
unistd.d
 

Copied: stable/11/cddl/lib/libdtrace/socket.d (from r323253, 
head/cddl/lib/libdtrace/socket.d)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/cddl/lib/libdtrace/socket.d   Wed Sep 20 16:31:06 2017
(r323814, copy of r323253, head/cddl/lib/libdtrace/socket.d)
@@ -0,0 +1,301 @@
+/*
+ * Copyright (c) 2017 George V. Neville-Neil
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ * Translators and flags for the socket structure.  FreeBSD specific code.
+ */
+
+#pragma D depends_on module kernel
+
+/*
+ * Option flags per-socket.
+ */
+#pragma D binding "1.13" SO_DEBUG
+inline int SO_DEBUG =  0x0001; /* turn on debugging info 
recording */
+#pragma D binding "1.13" SO_ACCEPTCONN
+inline int SO_ACCEPTCONN = 0x0002; /* socket has had listen() */
+#pragma D binding "1.13" SO_REUSEADDR
+inline int SO_REUSEADDR =  0x0004; /* allow local address reuse */
+#pragma D binding "1.13" SO_KEEPALIVE
+inline int SO_KEEPALIVE =  0x0008; /* keep connections alive */
+#pragma D binding "1.13" SO_DONTROUTE
+inline int SO_DONTROUTE =  0x0010; /* just use interface addresses 
*/
+#pragma D binding "1.13" SO_BROADCAST
+inline int SO_BROADCAST =  0x0020; /* permit sending of broadcast 
msgs */
+#pragma D binding "1.13" SO_USELOOPBACK
+inline int SO_USELOOPBACK =0x0040; /* bypass hardware when 
possible */
+#pragma D binding "1.13" SO_LINGER
+inline int SO_LINGER = 0x0080; /* linger on close if data 
present */
+#pragma D binding "1.13" SO_OOBINLINE
+inline int SO_OOBINLINE =  0x0100; /* leave received OOB data in 
line */
+#pragma D binding 

svn commit: r323253 - head/cddl/lib/libdtrace

2017-09-07 Thread George V. Neville-Neil
Author: gnn
Date: Thu Sep  7 03:05:16 2017
New Revision: 323253
URL: https://svnweb.freebsd.org/changeset/base/323253

Log:
  Add D definitions for the named values in socket.h
  
  Reviewed by:  markj
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D12241

Added:
  head/cddl/lib/libdtrace/socket.d   (contents, props changed)
Modified:
  head/cddl/lib/libdtrace/Makefile

Modified: head/cddl/lib/libdtrace/Makefile
==
--- head/cddl/lib/libdtrace/MakefileThu Sep  7 00:20:17 2017
(r323252)
+++ head/cddl/lib/libdtrace/MakefileThu Sep  7 03:05:16 2017
(r323253)
@@ -54,6 +54,7 @@ DSRCS=errno.d \
siftr.d \
signal.d\
tcp.d   \
+   socket.d\
udp.d   \
unistd.d
 

Added: head/cddl/lib/libdtrace/socket.d
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/cddl/lib/libdtrace/socket.dThu Sep  7 03:05:16 2017
(r323253)
@@ -0,0 +1,301 @@
+/*
+ * Copyright (c) 2017 George V. Neville-Neil
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ * Translators and flags for the socket structure.  FreeBSD specific code.
+ */
+
+#pragma D depends_on module kernel
+
+/*
+ * Option flags per-socket.
+ */
+#pragma D binding "1.13" SO_DEBUG
+inline int SO_DEBUG =  0x0001; /* turn on debugging info 
recording */
+#pragma D binding "1.13" SO_ACCEPTCONN
+inline int SO_ACCEPTCONN = 0x0002; /* socket has had listen() */
+#pragma D binding "1.13" SO_REUSEADDR
+inline int SO_REUSEADDR =  0x0004; /* allow local address reuse */
+#pragma D binding "1.13" SO_KEEPALIVE
+inline int SO_KEEPALIVE =  0x0008; /* keep connections alive */
+#pragma D binding "1.13" SO_DONTROUTE
+inline int SO_DONTROUTE =  0x0010; /* just use interface addresses 
*/
+#pragma D binding "1.13" SO_BROADCAST
+inline int SO_BROADCAST =  0x0020; /* permit sending of broadcast 
msgs */
+#pragma D binding "1.13" SO_USELOOPBACK
+inline int SO_USELOOPBACK =0x0040; /* bypass hardware when 
possible */
+#pragma D binding "1.13" SO_LINGER
+inline int SO_LINGER = 0x0080; /* linger on close if data 
present */
+#pragma D binding "1.13" SO_OOBINLINE
+inline int SO_OOBINLINE =  0x0100; /* leave received OOB data in 
line */
+#pragma D binding "1.13" SO_REUSEPORT
+inline int SO_REUSEPORT =  0x0200; /* allow local address & port 
reuse */
+#pragma D binding "1.13" SO_TIMESTAMP
+inline int SO_TIMESTAMP =  0x0400; /* timestamp received dgram 
traffic */
+#pragma D binding "1.13" SO_NOSIGPIPE
+inline int SO_NOSIGPIPE =  0x0800; /* no SIGPIPE from EPIPE */
+#pragma D binding "1.13" SO_ACCEPTFILTER
+inline int SO_ACCEPTFILTER =   0x1000; /* there is an accept filter */
+#pragma D binding "1.13" SO_BINTIME
+inline int SO_BINTIME =0x2000; /* timestamp received 
dgram traffic */
+#pragma D binding "1.13" SO_NO_OFFLOAD
+inline int SO_NO_OFFLOAD = 0x4000; /* socket cannot be offloaded */
+#pragma D binding "1.13" SO_NO_DDP
+inline int SO_NO_DDP = 0x8000; /* disable direct data 
placement */
+
+/*
+ * Ad

svn commit: r320752 - stable/11/share/man/man4

2017-07-06 Thread George V. Neville-Neil
Author: gnn
Date: Thu Jul  6 18:33:33 2017
New Revision: 320752
URL: https://svnweb.freebsd.org/changeset/base/320752

Log:
  MFC 319803
  
  Manual page for the DTrace lockstat provider
  
  Reviewed by:  markj

Added:
  stable/11/share/man/man4/dtrace_lockstat.4
 - copied unchanged from r319803, head/share/man/man4/dtrace_lockstat.4
Modified:
Directory Properties:
  stable/11/   (props changed)

Copied: stable/11/share/man/man4/dtrace_lockstat.4 (from r319803, 
head/share/man/man4/dtrace_lockstat.4)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/share/man/man4/dtrace_lockstat.4  Thu Jul  6 18:33:33 2017
(r320752, copy of r319803, head/share/man/man4/dtrace_lockstat.4)
@@ -0,0 +1,251 @@
+.\" Copyright (c) 2017 George V. Neville-Neil <g...@freebsd.org>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 9, 2017
+.Dt DTRACE_LOCKSTAT 4
+.Os
+.Sh NAME
+.Nm dtrace_lockstat
+.Nd a DTrace provider for tracing CPU scheduling events
+.Sh SYNOPSIS
+.Fn lockstat:::adaptive-acquire "struct mtx *"
+.Fn lockstat:::adaptive-release "struct mtx *"
+.Fn lockstat:::adaptive-spin "struct mtx *" "uint64_t"
+.Fn lockstat:::adaptive-block "struct mtx *" "uint64_t"
+.Fn lockstat:::spin-acquire "struct mtx *"
+.Fn lockstat:::spin-release "struct mtx *"
+.Fn lockstat:::spin-spin "struct mtx *" "uint64_t"
+.Fn lockstat:::rw-acquire "struct rwlock *" "int"
+.Fn lockstat:::rw-release "struct rwlock *" "int"
+.Fn lockstat:::rw-block "struct rwlock *" "uint64_t" "int" "int" "int"
+.Fn lockstat:::rw-spin "struct rwlock *" "uint64_t"
+.Fn lockstat:::rw-upgrade "struct rwlock *"
+.Fn lockstat:::rw-downgrade "struct rwlock *"
+.Fn lockstat:::sx-acquire "struct sx *" "int"
+.Fn lockstat:::sx-release "struct sx *" "int"
+.Fn lockstat:::sx-block "struct sx *" "uint64_t" "int" "int" "int"
+.Fn lockstat:::sx-spin "struct sx *" "uint64_t"
+.Fn lockstat:::sx-upgrade "struct sx *"
+.Fn lockstat:::sx-downgrade "struct sx *"
+.Fn lockstat:::thread-spin "struct mtx *" "uint64"
+.Sh DESCRIPTION
+The DTrace
+.Nm lockstat
+provider allows the tracing of events related to locking on FreeBSD.
+.Pp
+The
+.Nm lockstat
+provider contains DTrace probe for inspecting the kernel's lock
+state transitions.
+Tracepoints exist for several types of kernel
+locking primitives, including mutexes, spin, reader-writer, 
+and shared exclusive locks.
+An attempt has been made to provide a regular and easy to understand
+interface to the
+.Nm lockstat
+provider.
+Each type of lock has an
+.Fn acquire
+and
+.Fn release
+probe which exposes the lock structure that is being operated upon.
+.Pp
+Whenever an MTX_DEF mutex is acquired the
+.Fn lockstat:::adaptive-acquire
+probe fires.
+The only argument is a pointer to the lock structure which describes
+the lock that is being acquired.
+.Pp
+The
+.Fn lockstat:::adaptive-release
+probe fires whenever an adaptive lock is released.
+The only argument is a pointer to the lock structure which describes
+the lock that is being released.
+.Pp
+The
+.Fn lockstat:::adaptive-spin
+probe fi

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

2017-06-10 Thread George V. Neville-Neil
Author: gnn
Date: Sat Jun 10 20:50:50 2017
New Revision: 319805
URL: https://svnweb.freebsd.org/changeset/base/319805

Log:
  Update the variables as well.

Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileSat Jun 10 20:47:37 2017
(r319804)
+++ head/share/man/man4/MakefileSat Jun 10 20:50:50 2017
(r319805)
@@ -876,6 +876,7 @@ _ccd.4= ccd.4
 .if ${MK_CDDL} != "no"
 _dtrace_io.4=  dtrace_io.4
 _dtrace_ip.4=  dtrace_ip.4
+_dtrace_lockstat.4=dtrace_lockstat.4
 _dtrace_proc.4=dtrace_proc.4
 _dtrace_sched.4= dtrace_sched.4
 _dtrace_tcp.4= dtrace_tcp.4
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2017-06-10 Thread George V. Neville-Neil
Author: gnn
Date: Sat Jun 10 20:47:37 2017
New Revision: 319804
URL: https://svnweb.freebsd.org/changeset/base/319804

Log:
  Update Makefile to contain the new DTrace lockstat manual page.

Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileSat Jun 10 20:41:53 2017
(r319803)
+++ head/share/man/man4/MakefileSat Jun 10 20:47:37 2017
(r319804)
@@ -137,6 +137,7 @@ MAN=aac.4 \
ds3231.4 \
${_dtrace_io.4} \
${_dtrace_ip.4} \
+   ${_dtrace_lockstat.4} \
${_dtrace_proc.4} \
${_dtrace_sched.4} \
${_dtrace_tcp.4} \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2017-06-10 Thread George V. Neville-Neil
Author: gnn
Date: Sat Jun 10 20:41:53 2017
New Revision: 319803
URL: https://svnweb.freebsd.org/changeset/base/319803

Log:
  Manual page for the DTrace lockstat provider
  
  Reviewed by:  markj
  MFC after:1 week
  Differential Revision: https://reviews.freebsd.org/D11128

Added:
  head/share/man/man4/dtrace_lockstat.4   (contents, props changed)

Added: head/share/man/man4/dtrace_lockstat.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/dtrace_lockstat.4   Sat Jun 10 20:41:53 2017
(r319803)
@@ -0,0 +1,251 @@
+.\" Copyright (c) 2017 George V. Neville-Neil <g...@freebsd.org>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 9, 2017
+.Dt DTRACE_LOCKSTAT 4
+.Os
+.Sh NAME
+.Nm dtrace_lockstat
+.Nd a DTrace provider for tracing CPU scheduling events
+.Sh SYNOPSIS
+.Fn lockstat:::adaptive-acquire "struct mtx *"
+.Fn lockstat:::adaptive-release "struct mtx *"
+.Fn lockstat:::adaptive-spin "struct mtx *" "uint64_t"
+.Fn lockstat:::adaptive-block "struct mtx *" "uint64_t"
+.Fn lockstat:::spin-acquire "struct mtx *"
+.Fn lockstat:::spin-release "struct mtx *"
+.Fn lockstat:::spin-spin "struct mtx *" "uint64_t"
+.Fn lockstat:::rw-acquire "struct rwlock *" "int"
+.Fn lockstat:::rw-release "struct rwlock *" "int"
+.Fn lockstat:::rw-block "struct rwlock *" "uint64_t" "int" "int" "int"
+.Fn lockstat:::rw-spin "struct rwlock *" "uint64_t"
+.Fn lockstat:::rw-upgrade "struct rwlock *"
+.Fn lockstat:::rw-downgrade "struct rwlock *"
+.Fn lockstat:::sx-acquire "struct sx *" "int"
+.Fn lockstat:::sx-release "struct sx *" "int"
+.Fn lockstat:::sx-block "struct sx *" "uint64_t" "int" "int" "int"
+.Fn lockstat:::sx-spin "struct sx *" "uint64_t"
+.Fn lockstat:::sx-upgrade "struct sx *"
+.Fn lockstat:::sx-downgrade "struct sx *"
+.Fn lockstat:::thread-spin "struct mtx *" "uint64"
+.Sh DESCRIPTION
+The DTrace
+.Nm lockstat
+provider allows the tracing of events related to locking on FreeBSD.
+.Pp
+The
+.Nm lockstat
+provider contains DTrace probe for inspecting the kernel's lock
+state transitions.
+Tracepoints exist for several types of kernel
+locking primitives, including mutexes, spin, reader-writer, 
+and shared exclusive locks.
+An attempt has been made to provide a regular and easy to understand
+interface to the
+.Nm lockstat
+provider.
+Each type of lock has an
+.Fn acquire
+and
+.Fn release
+probe which exposes the lock structure that is being operated upon.
+.Pp
+Whenever an MTX_DEF mutex is acquired the
+.Fn lockstat:::adaptive-acquire
+probe fires.
+The only argument is a pointer to the lock structure which describes
+the lock that is being acquired.
+.Pp
+The
+.Fn lockstat:::adaptive-release
+probe fires whenever an adaptive lock is released.
+The only argument is a pointer to the lock structure which describes
+the lock that is being released.
+.Pp
+The
+.Fn lockstat:::adaptive-spin
+probe fires when an adaptive lock is acquired.
+The first argument is a pointer to the lock structure that describes
+the lock and the second argument is the amount of t

svn commit: r316210 - in stable/11/sys: cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/sys modules/dtrace/dtrace modules/dtrace/fasttrap modules/dtrace/systrace

2017-03-29 Thread George V. Neville-Neil
Author: gnn
Date: Thu Mar 30 02:50:21 2017
New Revision: 316210
URL: https://svnweb.freebsd.org/changeset/base/316210

Log:
  MFC: 313176, 313177, 313359
  
  Replace the implementation of DTrace's RAND subroutine for generating
  low-quality random numbers with a modern implementation (xoroshiro128+)
  that is capable of generating better quality randomness without compromising 
performance.
  
  Submitted by: Graeme Jenkinson

Added:
  
stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c
 - copied unchanged from r313177, 
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c
  
stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h
 - copied, changed from r313177, 
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h
Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
  stable/11/sys/modules/dtrace/dtrace/Makefile
  stable/11/sys/modules/dtrace/fasttrap/Makefile
  stable/11/sys/modules/dtrace/systrace/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c   Thu Mar 
30 02:38:38 2017(r316209)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c   Thu Mar 
30 02:50:21 2017(r316210)
@@ -124,6 +124,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -136,6 +137,8 @@
 #include "dtrace_debug.c"
 #endif
 
+#include "dtrace_xoroshiro128_plus.h"
+
 /*
  * DTrace Tunable Variables
  *
@@ -298,7 +301,6 @@ static kmutex_t dtrace_meta_lock;   /* me
 #define vuprintf   vprintf
 #define ttoproc(_a)((_a)->td_proc)
 #define crgetzoneid(_a)0
-#defineNCPUMAXCPU
 #define SNOCD  0
 #define CPU_ON_INTR(_a)0
 
@@ -4119,7 +4121,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
 
switch (subr) {
case DIF_SUBR_RAND:
-   regs[rd] = (dtrace_gethrtime() * 2416 + 374441) % 1771875;
+   regs[rd] = dtrace_xoroshiro128_plus_next(
+   state->dts_rstate[curcpu]);
break;
 
 #ifdef illumos
@@ -14408,6 +14411,7 @@ dtrace_state_create(struct cdev *dev, st
dtrace_state_t *state;
dtrace_optval_t *opt;
int bufsize = NCPU * sizeof (dtrace_buffer_t), i;
+   int cpu_it;
 
ASSERT(MUTEX_HELD(_lock));
ASSERT(MUTEX_HELD(_lock));
@@ -14463,6 +14467,21 @@ dtrace_state_create(struct cdev *dev, st
state->dts_buffer = kmem_zalloc(bufsize, KM_SLEEP);
state->dts_aggbuffer = kmem_zalloc(bufsize, KM_SLEEP);
 
+   /*
+ * Allocate and initialise the per-process per-CPU random state.
+* SI_SUB_RANDOM < SI_SUB_DTRACE_ANON therefore entropy device is
+ * assumed to be seeded at this point (if from Fortuna seed file).
+*/
+   (void) read_random(>dts_rstate[0], 2 * sizeof(uint64_t));
+   for (cpu_it = 1; cpu_it < NCPU; cpu_it++) {
+   /*
+* Each CPU is assigned a 2^64 period, non-overlapping
+* subsequence.
+*/
+   dtrace_xoroshiro128_plus_jump(state->dts_rstate[cpu_it-1],
+   state->dts_rstate[cpu_it]); 
+   }
+
 #ifdef illumos
state->dts_cleaner = CYCLIC_NONE;
state->dts_deadman = CYCLIC_NONE;

Copied: 
stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c
 (from r313177, 
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c
 Thu Mar 30 02:50:21 2017(r316210, copy of r313177, 
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c)
@@ -0,0 +1,89 @@
+/*-
+ * Copyright (c) 2016 (Graeme Jenkinson)
+ * All rights reserved.
+ *
+ * This software was developed by BAE Systems, the University of Cambridge
+ * Computer Laboratory, and Memorial University under DARPA/AFRL contract
+ * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing
+ * (TC) research program.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following 

svn commit: r316208 - in stable/11: cddl/lib/libdtrace sys/netinet sys/netinet/tcp_stacks

2017-03-29 Thread George V. Neville-Neil
Author: gnn
Date: Thu Mar 30 02:38:30 2017
New Revision: 316208
URL: https://svnweb.freebsd.org/changeset/base/316208

Log:
  MFC: 311225, 311243, 313045
  
  Fix DTrace TCP tracepoints to not use mtod() as it is both unnecessary and
  dangerous.  Those wanting data from an mbuf should use DTrace itself to get
  the data.
  
  Add an mbuf to ipinfo_t translator to finish cleanup of mbuf passing to TCP 
probes.

Modified:
  stable/11/cddl/lib/libdtrace/ip.d
  stable/11/sys/netinet/in_kdtrace.c
  stable/11/sys/netinet/tcp_input.c
  stable/11/sys/netinet/tcp_output.c
  stable/11/sys/netinet/tcp_stacks/fastpath.c
  stable/11/sys/netinet/tcp_subr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/lib/libdtrace/ip.d
==
--- stable/11/cddl/lib/libdtrace/ip.d   Thu Mar 30 02:37:37 2017
(r316207)
+++ stable/11/cddl/lib/libdtrace/ip.d   Thu Mar 30 02:38:30 2017
(r316208)
@@ -238,6 +238,24 @@ translator ipinfo_t < uint8_t *p > {
inet_ntoa6(&((struct ip6_hdr *)p)->ip6_dst);
 };
 
+#pragma D binding "1.13" translator
+translator ipinfo_t < struct mbuf *m > {
+   ip_ver =m == NULL ? 0 : ((struct ip *)m->m_data)->ip_v;
+   ip_plength =m == NULL ? 0 :
+   ((struct ip *)m->m_data)->ip_v == 4 ?
+   ntohs(((struct ip *)m->m_data)->ip_len) - 
+   (((struct ip *)m->m_data)->ip_hl << 2):
+   ntohs(((struct ip6_hdr 
*)m->m_data)->ip6_ctlun.ip6_un1.ip6_un1_plen);
+   ip_saddr =  m == NULL ? 0 :
+   ((struct ip *)m->m_data)->ip_v == 4 ?
+   inet_ntoa(&((struct ip *)m->m_data)->ip_src.s_addr) :
+   inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_src);
+   ip_daddr =  m == NULL ? 0 :
+   ((struct ip *)m->m_data)->ip_v == 4 ?
+   inet_ntoa(&((struct ip *)m->m_data)->ip_dst.s_addr) :
+   inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_dst);
+};
+
 #pragma D binding "1.5" IFF_LOOPBACK
 inline int IFF_LOOPBACK =  0x8;
 

Modified: stable/11/sys/netinet/in_kdtrace.c
==
--- stable/11/sys/netinet/in_kdtrace.c  Thu Mar 30 02:37:37 2017
(r316207)
+++ stable/11/sys/netinet/in_kdtrace.c  Thu Mar 30 02:38:30 2017
(r316208)
@@ -56,28 +56,28 @@ SDT_PROBE_DEFINE6_XLATE(ip, , , send,
 SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__established,
 "void *", "pktinfo_t *",
 "struct tcpcb *", "csinfo_t *",
-"uint8_t *", "ipinfo_t *",
+"struct mbuf *", "ipinfo_t *",
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfoh_t *");
 
 SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__refused,
 "void *", "pktinfo_t *",
 "struct tcpcb *", "csinfo_t *",
-"uint8_t *", "ipinfo_t *",
+"struct mbuf *", "ipinfo_t *",
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfo_t *");
 
 SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__established,
 "void *", "pktinfo_t *",
 "struct tcpcb *", "csinfo_t *",
-"uint8_t *", "ipinfo_t *",
+"struct mbuf *", "ipinfo_t *",
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfoh_t *");
 
 SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__refused,
 "void *", "pktinfo_t *",
 "struct tcpcb *", "csinfo_t *",
-"uint8_t *", "ipinfo_t *",
+"struct mbuf *", "ipinfo_t *",
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfoh_t *");
 
@@ -91,7 +91,7 @@ SDT_PROBE_DEFINE5_XLATE(tcp, , , connect
 SDT_PROBE_DEFINE5_XLATE(tcp, , , receive,
 "void *", "pktinfo_t *",
 "struct tcpcb *", "csinfo_t *",
-"uint8_t *", "ipinfo_t *",
+"struct mbuf *", "ipinfo_t *",
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfoh_t *");
 
@@ -113,7 +113,7 @@ SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__
 SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__output,
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfo_t *",
-"uint8_t *", "ipinfo_t *");
+"struct mbuf *", "ipinfo_t *");
 
 SDT_PROBE_DEFINE2_XLATE(tcp, , , debug__user,
 "struct tcpcb *", "tcpsinfo_t *" ,
@@ -122,7 +122,7 @@ SDT_PROBE_DEFINE2_XLATE(tcp, , , debug__
 SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__drop,
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfo_t *",
-"uint8_t *", "ipinfo_t *");
+"struct mbuf *", "ipinfo_t *");
 
 SDT_PROBE_DEFINE6_XLATE(tcp, , , state__change,
 "void *", "void *",

Modified: stable/11/sys/netinet/tcp_input.c
==
--- stable/11/sys/netinet/tcp_input.c   Thu Mar 30 02:37:37 2017
(r316207)
+++ stable/11/sys/netinet/tcp_input.c   Thu Mar 30 02:38:30 2017
(r316208)
@@ -1371,7 +1371,7 @@ new_tfo_socket:
tcp_trace(TA_INPUT, ostate, tp,
(void *)tcp_saveipgen, _savetcp, 0);
 #endif
-   

svn commit: r315951 - svnadmin/conf

2017-03-25 Thread George V. Neville-Neil
Author: gnn
Date: Sat Mar 25 14:12:12 2017
New Revision: 315951
URL: https://svnweb.freebsd.org/changeset/base/315951

Log:
  Free Mike Karels from mentorship.

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Sat Mar 25 14:09:12 2017(r315950)
+++ svnadmin/conf/mentors   Sat Mar 25 14:12:12 2017(r315951)
@@ -20,7 +20,6 @@ jceel trasz
 jkhrwatson
 jwdrmacklem
 kadesaiken Co-mentor: scottl, ambrisko
-karels gnn
 mahrensmckusick
 peterj jhb Co-mentor: grog
 phil   theravenCo-mentor: sjg
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313689 - svnadmin/conf

2017-02-12 Thread George V. Neville-Neil
Author: gnn
Date: Sun Feb 12 21:00:12 2017
New Revision: 313689
URL: https://svnweb.freebsd.org/changeset/base/313689

Log:
  Change mentorship of Ermal from gnn@ to ae@

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Sun Feb 12 20:54:31 2017(r313688)
+++ svnadmin/conf/mentors   Sun Feb 12 21:00:12 2017(r313689)
@@ -16,7 +16,7 @@ badgerkib Co-mentor: vangyzen
 dabvangyzen
 defpjd
 dexuan sephe
-erignn Co-mentor: thompsa
+eriae  Co-mentor: thompsa
 ivadaszadrian  Co-mentor: cognet
 jceel  trasz
 jkhrwatson
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313359 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace

2017-02-06 Thread George V. Neville-Neil
Author: gnn
Date: Tue Feb  7 01:21:18 2017
New Revision: 313359
URL: https://svnweb.freebsd.org/changeset/base/313359

Log:
  Fix the ifdef protection and remove superfluous extern statements
  
  Reported by:  Konstantin Belousov
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h

Modified: 
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h
==
--- 
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h  
Tue Feb  7 00:47:33 2017(r313358)
+++ 
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h  
Tue Feb  7 01:21:18 2017(r313359)
@@ -32,9 +32,10 @@
 
 #ifndef _DTRACE_XOROSHIRO128_PLUS_H
 #define _DTRACE_XOROSHIRO128_PLUS_H
-#endif
 
 #include 
 
-extern void dtrace_xoroshiro128_plus_jump(uint64_t * const, uint64_t * const);
-extern uint64_t dtrace_xoroshiro128_plus_next(uint64_t * const);
+void dtrace_xoroshiro128_plus_jump(uint64_t * const, uint64_t * const);
+uint64_t dtrace_xoroshiro128_plus_next(uint64_t * const);
+
+#endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r313177 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace

2017-02-03 Thread George V. Neville-Neil
Author: gnn
Date: Fri Feb  3 22:40:13 2017
New Revision: 313177
URL: https://svnweb.freebsd.org/changeset/base/313177

Log:
  Files which implement the new random number system code for DTrace
  
  Submitted by: Graeme Jenkinson
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL

Added:
  
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c  
 (contents, props changed)
  
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h  
 (contents, props changed)

Added: 
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c  
Fri Feb  3 22:40:13 2017(r313177)
@@ -0,0 +1,89 @@
+/*-
+ * Copyright (c) 2016 (Graeme Jenkinson)
+ * All rights reserved.
+ *
+ * This software was developed by BAE Systems, the University of Cambridge
+ * Computer Laboratory, and Memorial University under DARPA/AFRL contract
+ * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing
+ * (TC) research program.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include 
+
+#include "dtrace_xoroshiro128_plus.h"
+
+static __inline uint64_t
+rotl(const uint64_t x, int k)
+{
+   return (x << k) | (x >> (64 - k));
+}
+
+/*
+ * This is the jump function for the generator. It is equivalent to 2^64 calls
+ * to next(); it can be used to generate 2^64 non-overlapping subsequences for
+ * parallel computations.
+ */
+void
+dtrace_xoroshiro128_plus_jump(uint64_t * const state,
+   uint64_t * const jump_state)
+{
+   static const uint64_t JUMP[] = { 0xbeac0467eba5facb,
+   0xd86b048b86aa9922 };
+
+   uint64_t s0 = 0;
+   uint64_t s1 = 0;
+   int i = 0;
+   int b = 0;
+   for (i = 0; i < sizeof JUMP / sizeof *JUMP; i++) {
+   for (b = 0; b < 64; b++) {
+   if (JUMP[i] & 1ULL << b) {
+   s0 ^= state[0];
+   s1 ^= state[1];
+   }
+   dtrace_xoroshiro128_plus_next(state);
+   }
+   }
+   jump_state[0] = s0;
+   jump_state[1] = s1;
+}
+
+/*
+ * xoroshiro128+ - XOR/rotate/shift/rotate
+ * xorshift.di.unimi.it
+ */
+uint64_t
+dtrace_xoroshiro128_plus_next(uint64_t * const state)
+{
+   const uint64_t s0 = state[0];
+   uint64_t s1 = state[1];
+   uint64_t result;
+   result = s0 + s1;
+
+   s1 ^= s0;
+   state[0] = rotl(s0, 55) ^ s1 ^ (s1 << 14);
+   state[1] = rotl(s1, 36);
+
+   return result;
+}

Added: 
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.h  
Fri Feb  3 22:40:13 2017(r313177)
@@ -0,0 +1,40 @@
+/*-
+ * Copyright (c) 2016 (Graeme Jenkinson)
+ * All rights reserved.
+ *
+ * This software was developed by BAE Systems, the University of Cambridge
+ * Computer Laboratory, and Memorial University under DARPA/AFRL contract
+ * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing
+ * (TC) research program.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of 

svn commit: r313176 - in head/sys: cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/sys modules/dtrace/dtrace modules/dtrace/fasttrap modules/dtrace/systrace

2017-02-03 Thread George V. Neville-Neil
Author: gnn
Date: Fri Feb  3 22:26:19 2017
New Revision: 313176
URL: https://svnweb.freebsd.org/changeset/base/313176

Log:
  Replace the implementation of DTrace's RAND subroutine for generating
  low-quality random numbers with a modern implementation (xoroshiro128+)
  that is capable of generating better quality randomness without compromising 
performance.
  
  Submitted by: Graeme Jenkinson
  Reviewed by:  markj
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D9051

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
  head/sys/modules/dtrace/dtrace/Makefile
  head/sys/modules/dtrace/fasttrap/Makefile
  head/sys/modules/dtrace/systrace/Makefile

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cFri Feb 
 3 21:37:27 2017(r313175)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cFri Feb 
 3 22:26:19 2017(r313176)
@@ -124,6 +124,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -136,6 +137,8 @@
 #include "dtrace_debug.c"
 #endif
 
+#include "dtrace_xoroshiro128_plus.h"
+
 /*
  * DTrace Tunable Variables
  *
@@ -298,7 +301,6 @@ static kmutex_t dtrace_meta_lock;   /* me
 #define vuprintf   vprintf
 #define ttoproc(_a)((_a)->td_proc)
 #define crgetzoneid(_a)0
-#defineNCPUMAXCPU
 #define SNOCD  0
 #define CPU_ON_INTR(_a)0
 
@@ -4236,7 +4238,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
 
switch (subr) {
case DIF_SUBR_RAND:
-   regs[rd] = (dtrace_gethrtime() * 2416 + 374441) % 1771875;
+   regs[rd] = dtrace_xoroshiro128_plus_next(
+   state->dts_rstate[curcpu]);
break;
 
 #ifdef illumos
@@ -14495,6 +14498,7 @@ dtrace_state_create(struct cdev *dev, st
dtrace_state_t *state;
dtrace_optval_t *opt;
int bufsize = NCPU * sizeof (dtrace_buffer_t), i;
+   int cpu_it;
 
ASSERT(MUTEX_HELD(_lock));
ASSERT(MUTEX_HELD(_lock));
@@ -14550,6 +14554,21 @@ dtrace_state_create(struct cdev *dev, st
state->dts_buffer = kmem_zalloc(bufsize, KM_SLEEP);
state->dts_aggbuffer = kmem_zalloc(bufsize, KM_SLEEP);
 
+   /*
+ * Allocate and initialise the per-process per-CPU random state.
+* SI_SUB_RANDOM < SI_SUB_DTRACE_ANON therefore entropy device is
+ * assumed to be seeded at this point (if from Fortuna seed file).
+*/
+   (void) read_random(>dts_rstate[0], 2 * sizeof(uint64_t));
+   for (cpu_it = 1; cpu_it < NCPU; cpu_it++) {
+   /*
+* Each CPU is assigned a 2^64 period, non-overlapping
+* subsequence.
+*/
+   dtrace_xoroshiro128_plus_jump(state->dts_rstate[cpu_it-1],
+   state->dts_rstate[cpu_it]); 
+   }
+
 #ifdef illumos
state->dts_cleaner = CYCLIC_NONE;
state->dts_deadman = CYCLIC_NONE;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h  Fri Feb 
 3 21:37:27 2017(r313175)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h  Fri Feb 
 3 22:26:19 2017(r313176)
@@ -50,6 +50,7 @@ extern "C" {
  */
 
 #include 
+
 #ifndef illumos
 #ifdef __sparcv9
 typedef uint32_t   pc_t;
@@ -65,6 +66,10 @@ typedef  u_long  greg_t;
 #defineDTRACE_MAXPROPLEN   128
 #defineDTRACE_DYNVAR_CHUNKSIZE 256
 
+#ifdef __FreeBSD__
+#defineNCPUMAXCPU
+#endif /* __FreeBSD__ */
+
 struct dtrace_probe;
 struct dtrace_ecb;
 struct dtrace_predicate;
@@ -1169,6 +1174,7 @@ struct dtrace_state {
dtrace_cred_t dts_cred; /* credentials */
size_t dts_nretained;   /* number of retained enabs */
int dts_getf;   /* number of getf() calls */
+   uint64_t dts_rstate[NCPU][2];   /* per-CPU random state */
 };
 
 struct dtrace_provider {

Modified: head/sys/modules/dtrace/dtrace/Makefile
==
--- head/sys/modules/dtrace/dtrace/Makefile Fri Feb  3 21:37:27 2017
(r313175)
+++ head/sys/modules/dtrace/dtrace/Makefile Fri Feb  3 22:26:19 2017
(r313176)
@@ -12,6 +12,7 @@ ARCHDIR=  ${MACHINE_CPUARCH}
 
 KMOD=  dtrace
 SRCS=  dtrace.c \
+   dtrace_xoroshiro128_plus.c \
dtrace_asm.S \
dtrace_subr.c
 
@@ -42,6 +43,7 

svn commit: r313045 - in head: cddl/lib/libdtrace sys/netinet

2017-02-01 Thread George V. Neville-Neil
Author: gnn
Date: Wed Feb  1 19:33:00 2017
New Revision: 313045
URL: https://svnweb.freebsd.org/changeset/base/313045

Log:
  Add an mbuf to ipinfo_t translator to finish cleanup of mbuf passing to TCP 
probes.
  
  Reviewed by:  markj
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D9401

Modified:
  head/cddl/lib/libdtrace/ip.d
  head/sys/netinet/in_kdtrace.c

Modified: head/cddl/lib/libdtrace/ip.d
==
--- head/cddl/lib/libdtrace/ip.dWed Feb  1 16:15:23 2017
(r313044)
+++ head/cddl/lib/libdtrace/ip.dWed Feb  1 19:33:00 2017
(r313045)
@@ -238,6 +238,24 @@ translator ipinfo_t < uint8_t *p > {
inet_ntoa6(&((struct ip6_hdr *)p)->ip6_dst);
 };
 
+#pragma D binding "1.13" translator
+translator ipinfo_t < struct mbuf *m > {
+   ip_ver =m == NULL ? 0 : ((struct ip *)m->m_data)->ip_v;
+   ip_plength =m == NULL ? 0 :
+   ((struct ip *)m->m_data)->ip_v == 4 ?
+   ntohs(((struct ip *)m->m_data)->ip_len) - 
+   (((struct ip *)m->m_data)->ip_hl << 2):
+   ntohs(((struct ip6_hdr 
*)m->m_data)->ip6_ctlun.ip6_un1.ip6_un1_plen);
+   ip_saddr =  m == NULL ? 0 :
+   ((struct ip *)m->m_data)->ip_v == 4 ?
+   inet_ntoa(&((struct ip *)m->m_data)->ip_src.s_addr) :
+   inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_src);
+   ip_daddr =  m == NULL ? 0 :
+   ((struct ip *)m->m_data)->ip_v == 4 ?
+   inet_ntoa(&((struct ip *)m->m_data)->ip_dst.s_addr) :
+   inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_dst);
+};
+
 #pragma D binding "1.5" IFF_LOOPBACK
 inline int IFF_LOOPBACK =  0x8;
 

Modified: head/sys/netinet/in_kdtrace.c
==
--- head/sys/netinet/in_kdtrace.c   Wed Feb  1 16:15:23 2017
(r313044)
+++ head/sys/netinet/in_kdtrace.c   Wed Feb  1 19:33:00 2017
(r313045)
@@ -56,28 +56,28 @@ SDT_PROBE_DEFINE6_XLATE(ip, , , send,
 SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__established,
 "void *", "pktinfo_t *",
 "struct tcpcb *", "csinfo_t *",
-"uint8_t *", "ipinfo_t *",
+"struct mbuf *", "ipinfo_t *",
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfoh_t *");
 
 SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__refused,
 "void *", "pktinfo_t *",
 "struct tcpcb *", "csinfo_t *",
-"uint8_t *", "ipinfo_t *",
+"struct mbuf *", "ipinfo_t *",
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfo_t *");
 
 SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__established,
 "void *", "pktinfo_t *",
 "struct tcpcb *", "csinfo_t *",
-"uint8_t *", "ipinfo_t *",
+"struct mbuf *", "ipinfo_t *",
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfoh_t *");
 
 SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__refused,
 "void *", "pktinfo_t *",
 "struct tcpcb *", "csinfo_t *",
-"uint8_t *", "ipinfo_t *",
+"struct mbuf *", "ipinfo_t *",
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfoh_t *");
 
@@ -91,7 +91,7 @@ SDT_PROBE_DEFINE5_XLATE(tcp, , , connect
 SDT_PROBE_DEFINE5_XLATE(tcp, , , receive,
 "void *", "pktinfo_t *",
 "struct tcpcb *", "csinfo_t *",
-"uint8_t *", "ipinfo_t *",
+"struct mbuf *", "ipinfo_t *",
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfoh_t *");
 
@@ -113,7 +113,7 @@ SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__
 SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__output,
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfo_t *",
-"uint8_t *", "ipinfo_t *");
+"struct mbuf *", "ipinfo_t *");
 
 SDT_PROBE_DEFINE2_XLATE(tcp, , , debug__user,
 "struct tcpcb *", "tcpsinfo_t *" ,
@@ -122,7 +122,7 @@ SDT_PROBE_DEFINE2_XLATE(tcp, , , debug__
 SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__drop,
 "struct tcpcb *", "tcpsinfo_t *" ,
 "struct tcphdr *", "tcpinfo_t *",
-"uint8_t *", "ipinfo_t *");
+"struct mbuf *", "ipinfo_t *");
 
 SDT_PROBE_DEFINE6_XLATE(tcp, , , state__change,
 "void *", "void *",
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"



svn commit: r311960 - stable/11/sys/dev/hwpmc

2017-01-11 Thread George V. Neville-Neil
Author: gnn
Date: Thu Jan 12 03:34:29 2017
New Revision: 311960
URL: https://svnweb.freebsd.org/changeset/base/311960

Log:
  MFC 311224
  
  Fix PMC architecture check to handle later IPAs including Skylake
  Tested with tools/test/hwpmc/pmctest.py
  
  Obtained from:Oliver Pinter

Modified:
  stable/11/sys/dev/hwpmc/hwpmc_core.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/hwpmc/hwpmc_core.c
==
--- stable/11/sys/dev/hwpmc/hwpmc_core.cThu Jan 12 01:20:51 2017
(r311959)
+++ stable/11/sys/dev/hwpmc/hwpmc_core.cThu Jan 12 03:34:29 2017
(r311960)
@@ -2857,7 +2857,7 @@ pmc_core_initialize(struct pmc_mdep *md,
PMCDBG3(MDP,INI,1,"core-init cputype=%d ncpu=%d ipa-version=%d",
core_cputype, maxcpu, ipa_version);
 
-   if (ipa_version < 1 || ipa_version > 3 ||
+   if (ipa_version < 1 || ipa_version > 4 ||
(core_cputype != PMC_CPU_INTEL_CORE && ipa_version == 1)) {
/* Unknown PMC architecture. */
printf("hwpc_core: unknown PMC architecture: %d\n",
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311243 - head/sys/netinet/tcp_stacks

2017-01-03 Thread George V. Neville-Neil
Author: gnn
Date: Wed Jan  4 04:00:28 2017
New Revision: 311243
URL: https://svnweb.freebsd.org/changeset/base/311243

Log:
  Followup to mtod removal in main stack (r311225).  Continued removal
  of mtod() calls from TCP_PROBE macros.
  
  MFC after:1 week
  Sponsored by: Limelight Networks

Modified:
  head/sys/netinet/tcp_stacks/fastpath.c

Modified: head/sys/netinet/tcp_stacks/fastpath.c
==
--- head/sys/netinet/tcp_stacks/fastpath.c  Wed Jan  4 03:59:50 2017
(r311242)
+++ head/sys/netinet/tcp_stacks/fastpath.c  Wed Jan  4 04:00:28 2017
(r311243)
@@ -312,7 +312,7 @@ tcp_do_fastack(struct mbuf *m, struct tc
  (void *)tcp_saveipgen,
  _savetcp, 0);
 #endif
-   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__input, tp, th, m);
m_freem(m);
if (tp->snd_una == tp->snd_max)
tcp_timer_activate(tp, TT_REXMT, 0);
@@ -404,7 +404,7 @@ tcp_do_fastnewdata(struct mbuf *m, struc
tcp_trace(TA_INPUT, ostate, tp,
  (void *)tcp_saveipgen, _savetcp, 0);
 #endif
-   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__input, tp, th, m);
/*
 * Automatic sizing of receive socket buffer.  Often the send
 * buffer size is not optimally adjusted to the actual network
@@ -579,8 +579,7 @@ tcp_do_slowpath(struct mbuf *m, struct t
goto dropwithreset;
}
if ((thflags & (TH_ACK|TH_RST)) == (TH_ACK|TH_RST)) {
-   TCP_PROBE5(connect__refused, NULL, tp,
-   mtod(m, const char *), tp, th);
+   TCP_PROBE5(connect__refused, NULL, tp, m, tp, th);
tp = tcp_drop(tp, ECONNREFUSED);
}
if (thflags & TH_RST)
@@ -633,7 +632,7 @@ tcp_do_slowpath(struct mbuf *m, struct t
} else {
tcp_state_change(tp, TCPS_ESTABLISHED);
TCP_PROBE5(connect__established, NULL, tp,
-   mtod(m, const char *), tp, th);
+   m, tp, th);
cc_conn_init(tp);
tcp_timer_activate(tp, TT_KEEP,
TP_KEEPIDLE(tp));
@@ -1004,7 +1003,7 @@ tcp_do_slowpath(struct mbuf *m, struct t
} else {
tcp_state_change(tp, TCPS_ESTABLISHED);
TCP_PROBE5(accept__established, NULL, tp,
-   mtod(m, const char *), tp, th);
+   m, tp, th);
cc_conn_init(tp);
tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp));
}
@@ -1676,7 +1675,7 @@ dodata:   
/* XXX */
tcp_trace(TA_INPUT, ostate, tp, (void *)tcp_saveipgen,
  _savetcp, 0);
 #endif
-   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__input, tp, th, m);
 
/*
 * Return any desired output.
@@ -1723,7 +1722,7 @@ dropafterack:
tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen,
  _savetcp, 0);
 #endif
-   TCP_PROBE3(debug__drop, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__drop, tp, th, m);
if (ti_locked == TI_RLOCKED) {
INP_INFO_RUNLOCK(_tcbinfo);
}
@@ -1766,7 +1765,7 @@ drop:
tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen,
  _savetcp, 0);
 #endif
-   TCP_PROBE3(debug__drop, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__drop, tp, th, m);
if (tp != NULL)
INP_WUNLOCK(tp->t_inpcb);
m_freem(m);
@@ -2183,7 +2182,7 @@ tcp_fastack(struct mbuf *m, struct tcphd
  (void *)tcp_saveipgen,
  _savetcp, 0);
 #endif
-   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__input, tp, th, m);
m_freem(m);
if (tp->snd_una == tp->snd_max)
tcp_timer_activate(tp, TT_REXMT, 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311225 - head/sys/netinet

2017-01-03 Thread George V. Neville-Neil
Author: gnn
Date: Wed Jan  4 02:19:13 2017
New Revision: 311225
URL: https://svnweb.freebsd.org/changeset/base/311225

Log:
  Fix DTrace TCP tracepoints to not use mtod() as it is both unnecessary and
  dangerous.  Those wanting data from an mbuf should use DTrace itself to get
  the data.
  
  PR:   203409
  Reviewed by:  hiren
  MFC after:1 week
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D9035

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cWed Jan  4 02:15:03 2017
(r311224)
+++ head/sys/netinet/tcp_input.cWed Jan  4 02:19:13 2017
(r311225)
@@ -1408,7 +1408,7 @@ tfo_socket_result:
tcp_trace(TA_INPUT, ostate, tp,
(void *)tcp_saveipgen, _savetcp, 0);
 #endif
-   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__input, tp, th, m);
tcp_dooptions(, optp, optlen, TO_SYN);
 #ifdef TCP_RFC7413
if (syncache_add(, , th, inp, , m, NULL, NULL))
@@ -1456,7 +1456,7 @@ tfo_socket_result:
}
 #endif
 
-   TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th);
+   TCP_PROBE5(receive, NULL, tp, m, tp, th);
 
/*
 * Segment belongs to a connection in SYN_SENT, ESTABLISHED or later
@@ -1468,7 +1468,7 @@ tfo_socket_result:
return (IPPROTO_DONE);
 
 dropwithreset:
-   TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th);
+   TCP_PROBE5(receive, NULL, tp, m, tp, th);
 
if (ti_locked == TI_RLOCKED) {
INP_INFO_RUNLOCK(_tcbinfo);
@@ -1492,7 +1492,7 @@ dropwithreset:
 
 dropunlock:
if (m != NULL)
-   TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th);
+   TCP_PROBE5(receive, NULL, tp, m, tp, th);
 
if (ti_locked == TI_RLOCKED) {
INP_INFO_RUNLOCK(_tcbinfo);
@@ -1826,8 +1826,7 @@ tcp_do_segment(struct mbuf *m, struct tc
(void *)tcp_saveipgen,
_savetcp, 0);
 #endif
-   TCP_PROBE3(debug__input, tp, th,
-   mtod(m, const char *));
+   TCP_PROBE3(debug__input, tp, th, m);
if (tp->snd_una == tp->snd_max)
tcp_timer_activate(tp, TT_REXMT, 0);
else if (!tcp_timer_active(tp, TT_PERSIST))
@@ -1873,7 +1872,7 @@ tcp_do_segment(struct mbuf *m, struct tc
tcp_trace(TA_INPUT, ostate, tp,
(void *)tcp_saveipgen, _savetcp, 0);
 #endif
-   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__input, tp, th, m);
 
/*
 * Automatic sizing of receive socket buffer.  Often the send
@@ -2035,7 +2034,7 @@ tcp_do_segment(struct mbuf *m, struct tc
}
if ((thflags & (TH_ACK|TH_RST)) == (TH_ACK|TH_RST)) {
TCP_PROBE5(connect__refused, NULL, tp,
-   mtod(m, const char *), tp, th);
+   m, tp, th);
tp = tcp_drop(tp, ECONNREFUSED);
}
if (thflags & TH_RST)
@@ -2088,7 +2087,7 @@ tcp_do_segment(struct mbuf *m, struct tc
} else {
tcp_state_change(tp, TCPS_ESTABLISHED);
TCP_PROBE5(connect__established, NULL, tp,
-   mtod(m, const char *), tp, th);
+   m, tp, th);
cc_conn_init(tp);
tcp_timer_activate(tp, TT_KEEP,
TP_KEEPIDLE(tp));
@@ -2468,7 +2467,7 @@ tcp_do_segment(struct mbuf *m, struct tc
} else {
tcp_state_change(tp, TCPS_ESTABLISHED);
TCP_PROBE5(accept__established, NULL, tp,
-   mtod(m, const char *), tp, th);
+   m, tp, th);
 #ifdef TCP_RFC7413
if (tp->t_tfo_pending) {

tcp_fastopen_decrement_counter(tp->t_tfo_pending);
@@ -3202,7 +3201,7 @@ dodata:   
/* XXX */
tcp_trace(TA_INPUT, ostate, tp, (void *)tcp_saveipgen,
  _savetcp, 0);
 #endif
-   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__input, tp, th, m);
 
/*
 * Return any desired output.

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

2017-01-03 Thread George V. Neville-Neil
Author: gnn
Date: Wed Jan  4 02:15:03 2017
New Revision: 311224
URL: https://svnweb.freebsd.org/changeset/base/311224

Log:
  Fix PMC architecture check to handle later IPAs including Skylake
  Tested with tools/test/hwpmc/pmctest.py
  
  Obtained from:Oliver Pinter
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D9036

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

Modified: head/sys/dev/hwpmc/hwpmc_core.c
==
--- head/sys/dev/hwpmc/hwpmc_core.c Wed Jan  4 01:58:38 2017
(r311223)
+++ head/sys/dev/hwpmc/hwpmc_core.c Wed Jan  4 02:15:03 2017
(r311224)
@@ -2857,7 +2857,7 @@ pmc_core_initialize(struct pmc_mdep *md,
PMCDBG3(MDP,INI,1,"core-init cputype=%d ncpu=%d ipa-version=%d",
core_cputype, maxcpu, ipa_version);
 
-   if (ipa_version < 1 || ipa_version > 3 ||
+   if (ipa_version < 1 || ipa_version > 4 ||
(core_cputype != PMC_CPU_INTEL_CORE && ipa_version == 1)) {
/* Unknown PMC architecture. */
printf("hwpc_core: unknown PMC architecture: %d\n",
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r310795 - stable/11/sys/cddl/contrib/opensolaris/uts/common/sys

2016-12-29 Thread George V. Neville-Neil
Author: gnn
Date: Fri Dec 30 01:24:08 2016
New Revision: 310795
URL: https://svnweb.freebsd.org/changeset/base/310795

Log:
  MFC: 310175
  
  Remove extra DOF_SEC_XLIMPORT from the DOF_SEC_ISLOADABLE macro
  
  Sponsored by: DARPA, AFRL

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h  Fri Dec 
30 00:34:52 2016(r310794)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h  Fri Dec 
30 01:24:08 2016(r310795)
@@ -739,8 +739,8 @@ typedef struct dof_sec {
((x) == DOF_SECT_PRARGS) || ((x) == DOF_SECT_PROFFS) || \
((x) == DOF_SECT_INTTAB) || ((x) == DOF_SECT_XLTAB) ||  \
((x) == DOF_SECT_XLMEMBERS) || ((x) == DOF_SECT_XLIMPORT) ||\
-   ((x) == DOF_SECT_XLIMPORT) || ((x) == DOF_SECT_XLEXPORT) || \
-   ((x) == DOF_SECT_PREXPORT) || ((x) == DOF_SECT_PRENOFFS))
+   ((x) == DOF_SECT_XLEXPORT) ||  ((x) == DOF_SECT_PREXPORT) ||\
+   ((x) == DOF_SECT_PRENOFFS))
 
 typedef struct dof_ecbdesc {
dof_secidx_t dofe_probes;   /* link to DOF_SECT_PROBEDESC */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r310335 - stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace

2016-12-20 Thread George V. Neville-Neil
Author: gnn
Date: Tue Dec 20 19:30:21 2016
New Revision: 310335
URL: https://svnweb.freebsd.org/changeset/base/310335

Log:
  MFC: 309669
  
  Fix a kernel panic in DTrace's rw_iswriter subroutine.
  On FreeBSD the sense of rw_write_held() and rw_iswriter() were reversed,
  probably due to a cut and paste error. Using rw_iswriter() would cause
  the kernel to panic.
  
  Reviewed by:  markj
  Sponsored by: DARPA, AFRL

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c   Tue Dec 
20 18:47:02 2016(r310334)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c   Tue Dec 
20 19:30:21 2016(r310335)
@@ -4274,8 +4274,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
break;
}
l.lx = dtrace_loadptr(tupregs[0].dttk_value);
-   LOCK_CLASS(l.li)->lc_owner(l.li, );
-   regs[rd] = (lowner == curthread);
+   regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, ) &&
+   lowner != NULL;
break;
 
case DIF_SUBR_RW_ISWRITER:
@@ -4286,8 +4286,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
break;
}
l.lx = dtrace_loadptr(tupregs[0].dttk_value);
-   regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, ) &&
-   lowner != NULL;
+   LOCK_CLASS(l.li)->lc_owner(l.li, );
+   regs[rd] = (lowner == curthread);
break;
 #endif /* illumos */
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r310328 - in stable/11/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace

2016-12-20 Thread George V. Neville-Neil
Author: gnn
Date: Tue Dec 20 16:37:45 2016
New Revision: 310328
URL: https://svnweb.freebsd.org/changeset/base/310328

Log:
  MFC: 309069
  
  Add tunable to disable destructive dtrace
  
  Submitted by: Joerg Pernfuss 
  Reviewed by:  rstone, markj

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  stable/11/sys/cddl/dev/dtrace/dtrace_load.c
  stable/11/sys/cddl/dev/dtrace/dtrace_sysctl.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c   Tue Dec 
20 15:45:53 2016(r310327)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c   Tue Dec 
20 16:37:45 2016(r310328)
@@ -157,6 +157,10 @@
  * /etc/system.
  */
 intdtrace_destructive_disallow = 0;
+#ifndef illumos
+/* Positive logic version of dtrace_destructive_disallow for loader tunable */
+intdtrace_allow_destructive = 1;
+#endif
 dtrace_optval_tdtrace_nonroot_maxsize = (16 * 1024 * 1024);
 size_t dtrace_difo_maxsize = (256 * 1024);
 dtrace_optval_tdtrace_dof_maxsize = (8 * 1024 * 1024);

Modified: stable/11/sys/cddl/dev/dtrace/dtrace_load.c
==
--- stable/11/sys/cddl/dev/dtrace/dtrace_load.c Tue Dec 20 15:45:53 2016
(r310327)
+++ stable/11/sys/cddl/dev/dtrace/dtrace_load.c Tue Dec 20 16:37:45 2016
(r310328)
@@ -52,6 +52,17 @@ dtrace_load(void *dummy)
int i;
 #endif
 
+#ifndef illumos
+   /*
+* DTrace uses negative logic for the destructive mode switch, so it
+* is required to translate from the sysctl which uses positive logic.
+*/ 
+   if (dtrace_allow_destructive)
+   dtrace_destructive_disallow = 0;
+   else
+   dtrace_destructive_disallow = 1;
+#endif
+
/* Hook into the trap handler. */
dtrace_trap_func = dtrace_trap;
 

Modified: stable/11/sys/cddl/dev/dtrace/dtrace_sysctl.c
==
--- stable/11/sys/cddl/dev/dtrace/dtrace_sysctl.c   Tue Dec 20 15:45:53 
2016(r310327)
+++ stable/11/sys/cddl/dev/dtrace/dtrace_sysctl.c   Tue Dec 20 16:37:45 
2016(r310328)
@@ -92,3 +92,6 @@ SYSCTL_QUAD(_kern_dtrace, OID_AUTO, dof_
 
 SYSCTL_QUAD(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW,
 _helper_actions_max, 0, "maximum number of allowed helper actions");
+
+SYSCTL_INT(_security_bsd, OID_AUTO, allow_destructive_dtrace, CTLFLAG_RDTUN,
+_allow_destructive, 1, "Allow destructive mode DTrace scripts");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r310175 - head/sys/cddl/contrib/opensolaris/uts/common/sys

2016-12-16 Thread George V. Neville-Neil
Author: gnn
Date: Fri Dec 16 20:44:14 2016
New Revision: 310175
URL: https://svnweb.freebsd.org/changeset/base/310175

Log:
  Remove extra DOF_SEC_XLIMPORT from the DOF_SEC_ISLOADABLE macro
  
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h   Fri Dec 16 
20:24:47 2016(r310174)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h   Fri Dec 16 
20:44:14 2016(r310175)
@@ -738,8 +738,8 @@ typedef struct dof_sec {
((x) == DOF_SECT_PRARGS) || ((x) == DOF_SECT_PROFFS) || \
((x) == DOF_SECT_INTTAB) || ((x) == DOF_SECT_XLTAB) ||  \
((x) == DOF_SECT_XLMEMBERS) || ((x) == DOF_SECT_XLIMPORT) ||\
-   ((x) == DOF_SECT_XLIMPORT) || ((x) == DOF_SECT_XLEXPORT) || \
-   ((x) == DOF_SECT_PREXPORT) || ((x) == DOF_SECT_PRENOFFS))
+   ((x) == DOF_SECT_XLEXPORT) ||  ((x) == DOF_SECT_PREXPORT) ||\
+   ((x) == DOF_SECT_PRENOFFS))
 
 typedef struct dof_ecbdesc {
dof_secidx_t dofe_probes;   /* link to DOF_SECT_PROBEDESC */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309791 - head/sys/arm64/conf

2016-12-10 Thread George V. Neville-Neil
Author: gnn
Date: Sat Dec 10 10:00:27 2016
New Revision: 309791
URL: https://svnweb.freebsd.org/changeset/base/309791

Log:
  This adds a configuration for arm64 users that track CURRENT but
  don't need the extra debug facilities.  Copied from the amd64
  configuration of the same name.
  
  Submitted by: Nikolai Lifanov
  Reviewed by: emaste
  MFC after: 2 weeks

Added:
  head/sys/arm64/conf/GENERIC-NODEBUG
 - copied, changed from r309790, head/sys/amd64/conf/GENERIC-NODEBUG

Copied and modified: head/sys/arm64/conf/GENERIC-NODEBUG (from r309790, 
head/sys/amd64/conf/GENERIC-NODEBUG)
==
--- head/sys/amd64/conf/GENERIC-NODEBUG Sat Dec 10 09:10:48 2016
(r309790, copy source)
+++ head/sys/arm64/conf/GENERIC-NODEBUG Sat Dec 10 10:00:27 2016
(r309791)
@@ -1,6 +1,6 @@
 #
 # GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file 
-#   for FreeBSD/amd64
+#   for FreeBSD/arm64
 #
 # This configuration file removes several debugging options, including
 # WITNESS and INVARIANTS checking, which are known to have significant
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309669 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace

2016-12-06 Thread George V. Neville-Neil
Author: gnn
Date: Wed Dec  7 07:27:47 2016
New Revision: 309669
URL: https://svnweb.freebsd.org/changeset/base/309669

Log:
  Fix a kernel panic in DTrace's rw_iswriter subroutine.
  On FreeBSD the sense of rw_write_held() and rw_iswriter() were reversed,
  probably due to a cut and paste error. Using rw_iswriter() would cause
  the kernel to panic.
  
  Reviewed by:  markj
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D8718

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Dec 
 7 06:57:08 2016(r309668)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Dec 
 7 07:27:47 2016(r309669)
@@ -4391,8 +4391,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
break;
}
l.lx = dtrace_loadptr(tupregs[0].dttk_value);
-   LOCK_CLASS(l.li)->lc_owner(l.li, );
-   regs[rd] = (lowner == curthread);
+   regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, ) &&
+   lowner != NULL;
break;
 
case DIF_SUBR_RW_ISWRITER:
@@ -4403,8 +4403,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
break;
}
l.lx = dtrace_loadptr(tupregs[0].dttk_value);
-   regs[rd] = LOCK_CLASS(l.li)->lc_owner(l.li, ) &&
-   lowner != NULL;
+   LOCK_CLASS(l.li)->lc_owner(l.li, );
+   regs[rd] = (lowner == curthread);
break;
 #endif /* illumos */
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309069 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace

2016-11-23 Thread George V. Neville-Neil
Author: gnn
Date: Wed Nov 23 22:50:20 2016
New Revision: 309069
URL: https://svnweb.freebsd.org/changeset/base/309069

Log:
  Add tunable to disable destructive dtrace
  
  Submitted by: Joerg Pernfuss 
  Reviewed by:  rstone, markj
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D8624

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/dev/dtrace/dtrace_load.c
  head/sys/cddl/dev/dtrace/dtrace_sysctl.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Nov 
23 20:21:53 2016(r309068)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cWed Nov 
23 22:50:20 2016(r309069)
@@ -157,6 +157,10 @@
  * /etc/system.
  */
 intdtrace_destructive_disallow = 0;
+#ifndef illumos
+/* Positive logic version of dtrace_destructive_disallow for loader tunable */
+intdtrace_allow_destructive = 1;
+#endif
 dtrace_optval_tdtrace_nonroot_maxsize = (16 * 1024 * 1024);
 size_t dtrace_difo_maxsize = (256 * 1024);
 dtrace_optval_tdtrace_dof_maxsize = (8 * 1024 * 1024);

Modified: head/sys/cddl/dev/dtrace/dtrace_load.c
==
--- head/sys/cddl/dev/dtrace/dtrace_load.c  Wed Nov 23 20:21:53 2016
(r309068)
+++ head/sys/cddl/dev/dtrace/dtrace_load.c  Wed Nov 23 22:50:20 2016
(r309069)
@@ -52,6 +52,17 @@ dtrace_load(void *dummy)
int i;
 #endif
 
+#ifndef illumos
+   /*
+* DTrace uses negative logic for the destructive mode switch, so it
+* is required to translate from the sysctl which uses positive logic.
+*/ 
+   if (dtrace_allow_destructive)
+   dtrace_destructive_disallow = 0;
+   else
+   dtrace_destructive_disallow = 1;
+#endif
+
/* Hook into the trap handler. */
dtrace_trap_func = dtrace_trap;
 

Modified: head/sys/cddl/dev/dtrace/dtrace_sysctl.c
==
--- head/sys/cddl/dev/dtrace/dtrace_sysctl.cWed Nov 23 20:21:53 2016
(r309068)
+++ head/sys/cddl/dev/dtrace/dtrace_sysctl.cWed Nov 23 22:50:20 2016
(r309069)
@@ -92,3 +92,6 @@ SYSCTL_QUAD(_kern_dtrace, OID_AUTO, dof_
 
 SYSCTL_QUAD(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW,
 _helper_actions_max, 0, "maximum number of allowed helper actions");
+
+SYSCTL_INT(_security_bsd, OID_AUTO, allow_destructive_dtrace, CTLFLAG_RDTUN,
+_allow_destructive, 1, "Allow destructive mode DTrace scripts");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r309057 - stable/11/sys/netinet6

2016-11-23 Thread George V. Neville-Neil
Author: gnn
Date: Wed Nov 23 13:14:19 2016
New Revision: 309057
URL: https://svnweb.freebsd.org/changeset/base/309057

Log:
  MFC: 307541
  
  Limit the number of mbufs that can be allocated for IPV6_2292PKTOPTIONS
  (and IPV6_PKTOPTIONS).
  
  PR:   100219
  Submitted by: Joseph Kong

Modified:
  stable/11/sys/netinet6/ip6_output.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet6/ip6_output.c
==
--- stable/11/sys/netinet6/ip6_output.c Wed Nov 23 12:20:38 2016
(r309056)
+++ stable/11/sys/netinet6/ip6_output.c Wed Nov 23 13:14:19 2016
(r309057)
@@ -1398,6 +1398,15 @@ ip6_ctloutput(struct socket *so, struct 
int retval;
 #endif
 
+/*
+ * Don't use more than a quarter of mbuf clusters.  N.B.:
+ * nmbclusters is an int, but nmbclusters * MCLBYTES may overflow
+ * on LP64 architectures, so cast to u_long to avoid undefined
+ * behavior.  ILP32 architectures cannot have nmbclusters
+ * large enough to overflow for other reasons.
+ */
+#define IPV6_PKTOPTIONS_MBUF_LIMIT ((u_long)nmbclusters * MCLBYTES / 4)
+
level = sopt->sopt_level;
op = sopt->sopt_dir;
optname = sopt->sopt_name;
@@ -1453,6 +1462,12 @@ ip6_ctloutput(struct socket *so, struct 
{
struct mbuf *m;
 
+   if (optlen > IPV6_PKTOPTIONS_MBUF_LIMIT) {
+   printf("ip6_ctloutput: mbuf limit 
hit\n");
+   error = ENOBUFS;
+   break;
+   }
+
error = soopt_getm(sopt, ); /* XXX */
if (error != 0)
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r308053 - stable/11/cddl/contrib/opensolaris/lib/libdtrace/common

2016-10-28 Thread George V. Neville-Neil
Author: gnn
Date: Fri Oct 28 16:27:58 2016
New Revision: 308053
URL: https://svnweb.freebsd.org/changeset/base/308053

Log:
  Corrected non-portable reuse of va_list in dt_printf()
  
  Submitted by:   Graeme Jenkinson
  Reviewed by:markj

Modified:
  stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c
==
--- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c   Fri Oct 
28 16:22:45 2016(r308052)
+++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c   Fri Oct 
28 16:27:58 2016(r308053)
@@ -581,6 +581,7 @@ int
 dt_printf(dtrace_hdl_t *dtp, FILE *fp, const char *format, ...)
 {
va_list ap;
+   va_list ap2;
int n;
 
 #ifndef illumos
@@ -605,11 +606,13 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c
len = dtp->dt_sprintf_buflen - len;
assert(len >= 0);
 
-   if ((n = vsnprintf(buf, len, format, ap)) < 0)
+   va_copy(ap2, ap);
+   if ((n = vsnprintf(buf, len, format, ap2)) < 0)
n = dt_set_errno(dtp, errno);
 
+   va_end(ap2);
va_end(ap);
-
+   
return (n);
}
 
@@ -640,11 +643,14 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c
dtp->dt_buffered_buf[0] = '\0';
}
 
-   if ((needed = vsnprintf(NULL, 0, format, ap)) < 0) {
+   va_copy(ap2, ap);
+   if ((needed = vsnprintf(NULL, 0, format, ap2)) < 0) {
rval = dt_set_errno(dtp, errno);
+   va_end(ap2);
va_end(ap);
return (rval);
}
+   va_end(ap2);
 
if (needed == 0) {
va_end(ap);
@@ -670,12 +676,15 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c
dtp->dt_buffered_size <<= 1;
}
 
+   va_copy(ap2, ap);
if (vsnprintf(>dt_buffered_buf[dtp->dt_buffered_offs],
-   avail, format, ap) < 0) {
+   avail, format, ap2) < 0) {
rval = dt_set_errno(dtp, errno);
+   va_end(ap2);
va_end(ap);
return (rval);
}
+   va_end(ap2);
 
dtp->dt_buffered_offs += needed;
assert(dtp->dt_buffered_buf[dtp->dt_buffered_offs] == '\0');
@@ -683,8 +692,10 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c
return (0);
}
 
-   n = vfprintf(fp, format, ap);
+   va_copy(ap2, ap);
+   n = vfprintf(fp, format, ap2);
fflush(fp);
+   va_end(ap2);
va_end(ap);
 
if (n < 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r307541 - head/sys/netinet6

2016-10-17 Thread George V. Neville-Neil
Author: gnn
Date: Mon Oct 17 23:25:31 2016
New Revision: 307541
URL: https://svnweb.freebsd.org/changeset/base/307541

Log:
  Limit the number of mbufs that can be allocated for IPV6_2292PKTOPTIONS
  (and IPV6_PKTOPTIONS).
  
  PR:   100219
  Submitted by: Joseph Kong
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D5157

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Mon Oct 17 22:57:41 2016
(r307540)
+++ head/sys/netinet6/ip6_output.c  Mon Oct 17 23:25:31 2016
(r307541)
@@ -1393,6 +1393,15 @@ ip6_ctloutput(struct socket *so, struct 
int retval;
 #endif
 
+/*
+ * Don't use more than a quarter of mbuf clusters.  N.B.:
+ * nmbclusters is an int, but nmbclusters * MCLBYTES may overflow
+ * on LP64 architectures, so cast to u_long to avoid undefined
+ * behavior.  ILP32 architectures cannot have nmbclusters
+ * large enough to overflow for other reasons.
+ */
+#define IPV6_PKTOPTIONS_MBUF_LIMIT ((u_long)nmbclusters * MCLBYTES / 4)
+
level = sopt->sopt_level;
op = sopt->sopt_dir;
optname = sopt->sopt_name;
@@ -1448,6 +1457,12 @@ ip6_ctloutput(struct socket *so, struct 
{
struct mbuf *m;
 
+   if (optlen > IPV6_PKTOPTIONS_MBUF_LIMIT) {
+   printf("ip6_ctloutput: mbuf limit 
hit\n");
+   error = ENOBUFS;
+   break;
+   }
+
error = soopt_getm(sopt, ); /* XXX */
if (error != 0)
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r307044 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2016-10-11 Thread George V. Neville-Neil
Author: gnn
Date: Tue Oct 11 16:12:12 2016
New Revision: 307044
URL: https://svnweb.freebsd.org/changeset/base/307044

Log:
  Corrected non-portable reuse of va_list in dt_printf()
  
  Submitted by: Graeme Jenkinson
  Reviewed by:  markj
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D8157

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.cTue Oct 
11 15:55:45 2016(r307043)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.cTue Oct 
11 16:12:12 2016(r307044)
@@ -581,6 +581,7 @@ int
 dt_printf(dtrace_hdl_t *dtp, FILE *fp, const char *format, ...)
 {
va_list ap;
+   va_list ap2;
int n;
 
 #ifndef illumos
@@ -605,11 +606,13 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c
len = dtp->dt_sprintf_buflen - len;
assert(len >= 0);
 
-   if ((n = vsnprintf(buf, len, format, ap)) < 0)
+   va_copy(ap2, ap);
+   if ((n = vsnprintf(buf, len, format, ap2)) < 0)
n = dt_set_errno(dtp, errno);
 
+   va_end(ap2);
va_end(ap);
-
+   
return (n);
}
 
@@ -640,11 +643,14 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c
dtp->dt_buffered_buf[0] = '\0';
}
 
-   if ((needed = vsnprintf(NULL, 0, format, ap)) < 0) {
+   va_copy(ap2, ap);
+   if ((needed = vsnprintf(NULL, 0, format, ap2)) < 0) {
rval = dt_set_errno(dtp, errno);
+   va_end(ap2);
va_end(ap);
return (rval);
}
+   va_end(ap2);
 
if (needed == 0) {
va_end(ap);
@@ -670,12 +676,15 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c
dtp->dt_buffered_size <<= 1;
}
 
+   va_copy(ap2, ap);
if (vsnprintf(>dt_buffered_buf[dtp->dt_buffered_offs],
-   avail, format, ap) < 0) {
+   avail, format, ap2) < 0) {
rval = dt_set_errno(dtp, errno);
+   va_end(ap2);
va_end(ap);
return (rval);
}
+   va_end(ap2);
 
dtp->dt_buffered_offs += needed;
assert(dtp->dt_buffered_buf[dtp->dt_buffered_offs] == '\0');
@@ -683,8 +692,10 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, c
return (0);
}
 
-   n = vfprintf(fp, format, ap);
+   va_copy(ap2, ap);
+   n = vfprintf(fp, format, ap2);
fflush(fp);
+   va_end(ap2);
va_end(ap);
 
if (n < 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306296 - stable/11/tools/tools/crypto

2016-09-24 Thread George V. Neville-Neil
Author: gnn
Date: Sat Sep 24 13:44:18 2016
New Revision: 306296
URL: https://svnweb.freebsd.org/changeset/base/306296

Log:
  MFC: 305066,305304,305312
  
  Update cryptotest for modern algorithms
  Clean up the usage message and remove dead code.
  Add cpuset support to separate forked processes.
  
  Reviewed by:cem
  Sponsored by:   Rubicon Communications, LLC (Netgate)

Modified:
  stable/11/tools/tools/crypto/cryptotest.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tools/tools/crypto/cryptotest.c
==
--- stable/11/tools/tools/crypto/cryptotest.c   Sat Sep 24 13:23:47 2016
(r306295)
+++ stable/11/tools/tools/crypto/cryptotest.c   Sat Sep 24 13:44:18 2016
(r306296)
@@ -84,6 +84,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -96,6 +97,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -126,12 +128,10 @@ struct alg {
{ "blf",0,  8,  5,  56, CRYPTO_BLF_CBC },
{ "cast",   0,  8,  5,  16, CRYPTO_CAST_CBC },
{ "skj",0,  8,  10, 10, CRYPTO_SKIPJACK_CBC },
-   { "aes",0,  16, 16, 16, CRYPTO_RIJNDAEL128_CBC},
-   { "aes192", 0,  16, 24, 24, CRYPTO_RIJNDAEL128_CBC},
-   { "aes256", 0,  16, 32, 32, CRYPTO_RIJNDAEL128_CBC},
-#ifdef notdef
-   { "arc4",   0,  8,  1,  32, CRYPTO_ARC4 },
-#endif
+   { "rij",0,  16, 16, 16, CRYPTO_RIJNDAEL128_CBC},
+   { "aes",0,  16, 16, 16, CRYPTO_AES_CBC},
+   { "aes192", 0,  16, 24, 24, CRYPTO_AES_CBC},
+   { "aes256", 0,  16, 32, 32, CRYPTO_AES_CBC},
{ "md5",1,  8,  16, 16, CRYPTO_MD5_HMAC },
{ "sha1",   1,  8,  20, 20, CRYPTO_SHA1_HMAC },
{ "sha256", 1,  8,  32, 32, CRYPTO_SHA2_256_HMAC },
@@ -139,27 +139,29 @@ struct alg {
{ "sha512", 1,  8,  64, 64, CRYPTO_SHA2_512_HMAC },
 };
 
-static void
+void
 usage(const char* cmd)
 {
printf("usage: %s [-czsbv] [-d dev] [-a algorithm] [count] [size 
...]\n",
cmd);
printf("where algorithm is one of:\n");
-   printf("des 3des (default) blowfish cast skipjack\n");
-   printf("aes (aka rijndael) aes192 aes256 arc4\n");
+   printf("null des 3des (default) blowfish cast skipjack rij\n");
+   printf("aes aes192 aes256 md5 sha1 sha256 sha384 sha512\n");
printf("count is the number of encrypt/decrypt ops to do\n");
printf("size is the number of bytes of text to encrypt+decrypt\n");
printf("\n");
printf("-c check the results (slows timing)\n");
-   printf("-d use specific device\n");
+   printf("-d use specific device, specify 'soft' for testing software 
implementations\n");
+   printf("\tNOTE: to use software you must set:\n\t sysctl 
kern.cryptodevallowsoft=1\n");
printf("-z run all available algorithms on a variety of sizes\n");
printf("-v be verbose\n");
printf("-b mark operations for batching\n");
printf("-p profile kernel crypto operation (must be root)\n");
+   printf("-t n for n threads and run tests concurrently\n");
exit(-1);
 }
 
-static struct alg*
+struct alg*
 getalgbycode(int cipher)
 {
int i;
@@ -170,7 +172,7 @@ getalgbycode(int cipher)
return NULL;
 }
 
-static struct alg*
+struct alg*
 getalgbyname(const char* name)
 {
int i;
@@ -181,10 +183,10 @@ getalgbyname(const char* name)
return NULL;
 }
 
-static int
+int
 devcrypto(void)
 {
-   static int fd = -1;
+   int fd = -1;
 
if (fd < 0) {
fd = open(_PATH_DEV "crypto", O_RDWR, 0);
@@ -196,11 +198,14 @@ devcrypto(void)
return fd;
 }
 
-static int
+int
 crlookup(const char *devname)
 {
struct crypt_find_op find;
 
+   if (strncmp(devname, "soft", 4) == 0)
+   return CRYPTO_FLAG_SOFTWARE;
+
find.crid = -1;
strlcpy(find.name, devname, sizeof(find.name));
if (ioctl(devcrypto(), CIOCFINDDEV, ) == -1)
@@ -208,10 +213,10 @@ crlookup(const char *devname)
return find.crid;
 }
 
-static const char *
+const char *
 crfind(int crid)
 {
-   static struct crypt_find_op find;
+   struct crypt_find_op find;
 
bzero(, sizeof(find));
find.crid = crid;
@@ -220,7 +225,7 @@ crfind(int crid)
return find.name;
 }
 
-static int
+int
 crget(void)
 {
int fd;
@@ -232,7 +237,7 @@ crget(void)
return fd;
 }
 
-static char
+char
 rdigit(void)
 {
const char a[] = {
@@ -242,7 +247,7 @@ rdigit(void)
return 0x20+a[random()%nitems(a)];
 }
 
-static void
+void
 runtest(struct alg *alg, int count, int size, 

svn commit: r305748 - stable/10/cddl/lib/libdtrace

2016-09-12 Thread George V. Neville-Neil
Author: gnn
Date: Mon Sep 12 17:05:42 2016
New Revision: 305748
URL: https://svnweb.freebsd.org/changeset/base/305748

Log:
  MFC: 304825
  Unlike Solaris, in FreeBSD p_args can be 0 so check for that
  instead of walking down to ar_args blindly.
  
  Reported by:  Amanda Strnad
  Reviewed by:  markj, jhb
  Sponsored by: DARPA, AFRL

Modified:
  stable/10/cddl/lib/libdtrace/psinfo.d
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/lib/libdtrace/psinfo.d
==
--- stable/10/cddl/lib/libdtrace/psinfo.d   Mon Sep 12 17:02:22 2016
(r305747)
+++ stable/10/cddl/lib/libdtrace/psinfo.d   Mon Sep 12 17:05:42 2016
(r305748)
@@ -57,7 +57,7 @@ translator psinfo_t < struct proc *T > {
pr_gid = T->p_ucred->cr_rgid;
pr_egid = T->p_ucred->cr_groups[0];
pr_addr = 0;
-   pr_psargs = (T->p_args->ar_args == 0) ? "" :
+   pr_psargs = (T->p_args == 0) ? "" :
memstr(T->p_args->ar_args, ' ', T->p_args->ar_length);
pr_arglen = T->p_args->ar_length;
pr_jailid = T->p_ucred->cr_prison->pr_id;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r305747 - stable/11/cddl/lib/libdtrace

2016-09-12 Thread George V. Neville-Neil
Author: gnn
Date: Mon Sep 12 17:02:22 2016
New Revision: 305747
URL: https://svnweb.freebsd.org/changeset/base/305747

Log:
  MFC: 304825
  Unlike Solaris, in FreeBSD p_args can be 0 so check for that
  instead of walking down to ar_args blindly.
  
  Reported by:  Amanda Strnad
  Reviewed by:  markj, jhb
  Sponsored by: DARPA, AFRL

Modified:
  stable/11/cddl/lib/libdtrace/psinfo.d
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/lib/libdtrace/psinfo.d
==
--- stable/11/cddl/lib/libdtrace/psinfo.d   Mon Sep 12 16:55:16 2016
(r305746)
+++ stable/11/cddl/lib/libdtrace/psinfo.d   Mon Sep 12 17:02:22 2016
(r305747)
@@ -59,7 +59,7 @@ translator psinfo_t < struct proc *T > {
pr_gid = T->p_ucred->cr_rgid;
pr_egid = T->p_ucred->cr_groups[0];
pr_addr = 0;
-   pr_psargs = (T->p_args->ar_args == 0) ? "" :
+   pr_psargs = (T->p_args == 0) ? "" :
memstr(T->p_args->ar_args, ' ', T->p_args->ar_length);
pr_arglen = T->p_args->ar_length;
pr_jailid = T->p_ucred->cr_prison->pr_id;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r305312 - head/tools/tools/crypto

2016-09-02 Thread George V. Neville-Neil
Author: gnn
Date: Sat Sep  3 00:22:42 2016
New Revision: 305312
URL: https://svnweb.freebsd.org/changeset/base/305312

Log:
  Add cpuset support to separate forked processes.
  
  Reviewed by:  cem
  Sponsored by: Rubicon Communications, LLC (Netgate)
  Differential Revision:https://reviews.freebsd.org/D7766

Modified:
  head/tools/tools/crypto/cryptotest.c

Modified: head/tools/tools/crypto/cryptotest.c
==
--- head/tools/tools/crypto/cryptotest.cFri Sep  2 22:47:57 2016
(r305311)
+++ head/tools/tools/crypto/cryptotest.cSat Sep  3 00:22:42 2016
(r305312)
@@ -97,6 +97,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -468,6 +469,11 @@ runtests(struct alg *alg, int count, int
if (threads > 1) {
for (i = 0; i < threads; i++)
if (fork() == 0) {
+   cpuset_t mask;
+   CPU_ZERO();
+   CPU_SET(i, );
+   cpuset_setaffinity(CPU_LEVEL_WHICH, 
CPU_WHICH_PID,
+   -1, sizeof(mask), );
runtest(alg, count, size, cmd, [i]);
exit(0);
}
@@ -573,6 +579,9 @@ main(int argc, char **argv)
}
argc--, argv++;
}
+   if (maxthreads > CPU_SETSIZE)
+   errx(EX_USAGE, "Too many threads, %d, choose fewer.", 
maxthreads);
+   
if (nsizes == 0) {
if (alg)
sizes[nsizes++] = alg->blocksize;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r305307 - head/tools/tools/crypto

2016-09-02 Thread George V. Neville-Neil
Author: gnn
Date: Fri Sep  2 21:35:32 2016
New Revision: 305307
URL: https://svnweb.freebsd.org/changeset/base/305307

Log:
  Add a runner script for cryptotest.
  
  Althought cryptotest itself has a -z mode to test all algorithms at a variety
  of sizes, this script allows us to be more selective.  Threads and buffer 
sizes
  move in powers of two from 1, for threads, and 256 for buffer sizes.
  
  e.g.  cryptorun.sh aes 4 512
  
  Test aes with 1, 2 and 4 processes, and at sizes of 256 and 512 bytes.
  
  Sponsored by: Rubicon Communications, LLC (Netgate)

Added:
  head/tools/tools/crypto/cryptorun.sh   (contents, props changed)

Added: head/tools/tools/crypto/cryptorun.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/crypto/cryptorun.shFri Sep  2 21:35:32 2016
(r305307)
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# A simple test runner for cryptotest
+#
+# Althought cryptotest itself has a -z mode to test all algorithms at
+# a variety of sizes, this script allows us to be more selective.
+# Threads and buffer sizes move in powers of two from 1, for threads,
+# and 256 for buffer sizes.
+#
+# e.g.  cryptorun.sh aes 4 512
+#
+# Test aes with 1, 2 and 4 processes, and at sizes of 256 and 512 bytes.
+#
+# $FreeBSD$
+#
+
+threads=1
+size=256
+iterations=100
+crypto="/tank/users/gnn/Repos/svn/FreeBSD.HEAD/tools/tools/crypto/cryptotest"
+max_threads=$2
+max_size=$3 
+
+while [ "$threads" -le "$max_threads" ]; do
+   echo "Testing with $threads processes."
+   while [ "$size" -le "$max_size" ]; do
+   $crypto -t $threads -a $1 $iterations $size
+   size=$(($size * 2))
+   done
+   size=256
+   threads=$(($threads * 2))
+done
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r305304 - head/tools/tools/crypto

2016-09-02 Thread George V. Neville-Neil
Author: gnn
Date: Fri Sep  2 21:11:37 2016
New Revision: 305304
URL: https://svnweb.freebsd.org/changeset/base/305304

Log:
  Clean up the usage message and remove dead code.
  
  Reviewed by:  cem
  MFC after:2 weeks
  Sponsored by: Rubicon Communications, LLC (Netgate)
  Differential Revision:https://reviews.freebsd.org/D7765

Modified:
  head/tools/tools/crypto/cryptotest.c

Modified: head/tools/tools/crypto/cryptotest.c
==
--- head/tools/tools/crypto/cryptotest.cFri Sep  2 20:41:43 2016
(r305303)
+++ head/tools/tools/crypto/cryptotest.cFri Sep  2 21:11:37 2016
(r305304)
@@ -84,6 +84,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -130,9 +131,6 @@ struct alg {
{ "aes",0,  16, 16, 16, CRYPTO_AES_CBC},
{ "aes192", 0,  16, 24, 24, CRYPTO_AES_CBC},
{ "aes256", 0,  16, 32, 32, CRYPTO_AES_CBC},
-#ifdef notdef
-   { "arc4",   0,  8,  1,  32, CRYPTO_ARC4 },
-#endif
{ "md5",1,  8,  16, 16, CRYPTO_MD5_HMAC },
{ "sha1",   1,  8,  20, 20, CRYPTO_SHA1_HMAC },
{ "sha256", 1,  8,  32, 32, CRYPTO_SHA2_256_HMAC },
@@ -146,8 +144,8 @@ usage(const char* cmd)
printf("usage: %s [-czsbv] [-d dev] [-a algorithm] [count] [size 
...]\n",
cmd);
printf("where algorithm is one of:\n");
-   printf("des 3des (default) blowfish cast skipjack rij\n");
-   printf("aes aes192 aes256 arc4\n");
+   printf("null des 3des (default) blowfish cast skipjack rij\n");
+   printf("aes aes192 aes256 md5 sha1 sha256 sha384 sha512\n");
printf("count is the number of encrypt/decrypt ops to do\n");
printf("size is the number of bytes of text to encrypt+decrypt\n");
printf("\n");
@@ -158,6 +156,7 @@ usage(const char* cmd)
printf("-v be verbose\n");
printf("-b mark operations for batching\n");
printf("-p profile kernel crypto operation (must be root)\n");
+   printf("-t n for n threads and run tests concurrently\n");
exit(-1);
 }
 
@@ -483,17 +482,10 @@ runtests(struct alg *alg, int count, int
if (t) {
int nops = alg->ishash ? count : 2*count;
 
-#if 0
-   t /= threads;
-   printf("%6.3lf sec, %7d %6s crypts, %7d bytes, %8.0lf byte/sec, 
%7.1lf Mb/sec\n",
-   t, nops, alg->name, size, (double)nops*size / t,
-   (double)nops*size / t * 8 / 1024 / 1024);
-#else
nops *= threads;
printf("%8.3lf sec, %7d %6s crypts, %7d bytes, %8.0lf byte/sec, 
%7.1lf Mb/sec\n",
t, nops, alg->name, size, (double)nops*size / t,
(double)nops*size / t * 8 / 1024 / 1024);
-#endif
}
 #ifdef __FreeBSD__
if (profile) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r305066 - head/tools/tools/crypto

2016-08-30 Thread George V. Neville-Neil
Author: gnn
Date: Tue Aug 30 14:28:35 2016
New Revision: 305066
URL: https://svnweb.freebsd.org/changeset/base/305066

Log:
  Update cryptotest for modern algorithms
  
  Reviewed by:  cem
  Sponsored by: Rubicon Communications, LLC (Netgate)
  Differential Revision:https://reviews.freebsd.org/D7598

Modified:
  head/tools/tools/crypto/cryptotest.c

Modified: head/tools/tools/crypto/cryptotest.c
==
--- head/tools/tools/crypto/cryptotest.cTue Aug 30 14:09:24 2016
(r305065)
+++ head/tools/tools/crypto/cryptotest.cTue Aug 30 14:28:35 2016
(r305066)
@@ -126,9 +126,10 @@ struct alg {
{ "blf",0,  8,  5,  56, CRYPTO_BLF_CBC },
{ "cast",   0,  8,  5,  16, CRYPTO_CAST_CBC },
{ "skj",0,  8,  10, 10, CRYPTO_SKIPJACK_CBC },
-   { "aes",0,  16, 16, 16, CRYPTO_RIJNDAEL128_CBC},
-   { "aes192", 0,  16, 24, 24, CRYPTO_RIJNDAEL128_CBC},
-   { "aes256", 0,  16, 32, 32, CRYPTO_RIJNDAEL128_CBC},
+   { "rij",0,  16, 16, 16, CRYPTO_RIJNDAEL128_CBC},
+   { "aes",0,  16, 16, 16, CRYPTO_AES_CBC},
+   { "aes192", 0,  16, 24, 24, CRYPTO_AES_CBC},
+   { "aes256", 0,  16, 32, 32, CRYPTO_AES_CBC},
 #ifdef notdef
{ "arc4",   0,  8,  1,  32, CRYPTO_ARC4 },
 #endif
@@ -139,19 +140,20 @@ struct alg {
{ "sha512", 1,  8,  64, 64, CRYPTO_SHA2_512_HMAC },
 };
 
-static void
+void
 usage(const char* cmd)
 {
printf("usage: %s [-czsbv] [-d dev] [-a algorithm] [count] [size 
...]\n",
cmd);
printf("where algorithm is one of:\n");
-   printf("des 3des (default) blowfish cast skipjack\n");
-   printf("aes (aka rijndael) aes192 aes256 arc4\n");
+   printf("des 3des (default) blowfish cast skipjack rij\n");
+   printf("aes aes192 aes256 arc4\n");
printf("count is the number of encrypt/decrypt ops to do\n");
printf("size is the number of bytes of text to encrypt+decrypt\n");
printf("\n");
printf("-c check the results (slows timing)\n");
-   printf("-d use specific device\n");
+   printf("-d use specific device, specify 'soft' for testing software 
implementations\n");
+   printf("\tNOTE: to use software you must set:\n\t sysctl 
kern.cryptodevallowsoft=1\n");
printf("-z run all available algorithms on a variety of sizes\n");
printf("-v be verbose\n");
printf("-b mark operations for batching\n");
@@ -159,7 +161,7 @@ usage(const char* cmd)
exit(-1);
 }
 
-static struct alg*
+struct alg*
 getalgbycode(int cipher)
 {
int i;
@@ -170,7 +172,7 @@ getalgbycode(int cipher)
return NULL;
 }
 
-static struct alg*
+struct alg*
 getalgbyname(const char* name)
 {
int i;
@@ -181,10 +183,10 @@ getalgbyname(const char* name)
return NULL;
 }
 
-static int
+int
 devcrypto(void)
 {
-   static int fd = -1;
+   int fd = -1;
 
if (fd < 0) {
fd = open(_PATH_DEV "crypto", O_RDWR, 0);
@@ -196,11 +198,14 @@ devcrypto(void)
return fd;
 }
 
-static int
+int
 crlookup(const char *devname)
 {
struct crypt_find_op find;
 
+   if (strncmp(devname, "soft", 4) == 0)
+   return CRYPTO_FLAG_SOFTWARE;
+
find.crid = -1;
strlcpy(find.name, devname, sizeof(find.name));
if (ioctl(devcrypto(), CIOCFINDDEV, ) == -1)
@@ -208,10 +213,10 @@ crlookup(const char *devname)
return find.crid;
 }
 
-static const char *
+const char *
 crfind(int crid)
 {
-   static struct crypt_find_op find;
+   struct crypt_find_op find;
 
bzero(, sizeof(find));
find.crid = crid;
@@ -220,7 +225,7 @@ crfind(int crid)
return find.name;
 }
 
-static int
+int
 crget(void)
 {
int fd;
@@ -232,7 +237,7 @@ crget(void)
return fd;
 }
 
-static char
+char
 rdigit(void)
 {
const char a[] = {
@@ -242,7 +247,7 @@ rdigit(void)
return 0x20+a[random()%nitems(a)];
 }
 
-static void
+void
 runtest(struct alg *alg, int count, int size, u_long cmd, struct timeval *tv)
 {
int i, fd = crget();
@@ -386,7 +391,7 @@ runtest(struct alg *alg, int count, int 
 }
 
 #ifdef __FreeBSD__
-static void
+void
 resetstats()
 {
struct cryptostats stats;
@@ -409,7 +414,7 @@ resetstats()
perror("kern.cryptostats");
 }
 
-static void
+void
 printt(const char* tag, struct cryptotstat *ts)
 {
uint64_t avg, min, max;
@@ -424,7 +429,7 @@ printt(const char* tag, struct cryptotst
 }
 #endif
 
-static void
+void
 runtests(struct alg *alg, int count, int size, u_long cmd, int threads, int 
profile)
 {
int i, status;

svn commit: r304825 - head/cddl/lib/libdtrace

2016-08-25 Thread George V. Neville-Neil
Author: gnn
Date: Thu Aug 25 23:24:57 2016
New Revision: 304825
URL: https://svnweb.freebsd.org/changeset/base/304825

Log:
  Unlike Solaris, in FreeBSD p_args can be 0 so check for that
  instead of walking down to ar_args blindly.
  
  Reported by:  Amanda Strnad
  Reviewed by:  markj, jhb
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL

Modified:
  head/cddl/lib/libdtrace/psinfo.d

Modified: head/cddl/lib/libdtrace/psinfo.d
==
--- head/cddl/lib/libdtrace/psinfo.dThu Aug 25 23:06:12 2016
(r304824)
+++ head/cddl/lib/libdtrace/psinfo.dThu Aug 25 23:24:57 2016
(r304825)
@@ -59,7 +59,7 @@ translator psinfo_t < struct proc *T > {
pr_gid = T->p_ucred->cr_rgid;
pr_egid = T->p_ucred->cr_groups[0];
pr_addr = 0;
-   pr_psargs = (T->p_args->ar_args == 0) ? "" :
+   pr_psargs = (T->p_args == 0) ? "" :
memstr(T->p_args->ar_args, ' ', T->p_args->ar_length);
pr_arglen = T->p_args->ar_length;
pr_jailid = T->p_ucred->cr_prison->pr_id;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304402 - in head: . sys/compat/freebsd32 sys/kern sys/sys

2016-08-18 Thread George V. Neville-Neil
Author: gnn
Date: Thu Aug 18 10:54:39 2016
New Revision: 304402
URL: https://svnweb.freebsd.org/changeset/base/304402

Log:
  Remove the obsolete and unused openbsd_poll system call. (Phase 2)
  
  Reported by:  brooks
  Reviewed by:  brooks, jhb
  Differential Revision:https://reviews.freebsd.org/D7548

Modified:
  head/UPDATING
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/UPDATING
==
--- head/UPDATING   Thu Aug 18 10:54:21 2016(r304401)
+++ head/UPDATING   Thu Aug 18 10:54:39 2016(r304402)
@@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20160818:
+   Remove the openbsd_poll system call.
+__FreeBSD_version has been bumped because of this.
+
 20160622:
The libc stub for the pipe(2) system call has been replaced with
a wrapper that calls the pipe2(2) system call and the pipe(2)

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==
--- head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 18 10:54:21 2016
(r304401)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 18 10:54:39 2016
(r304402)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 
2016-08-15 19:08:51Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304395 
2016-08-18 10:50:40Z gnn 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Thu Aug 18 10:54:21 
2016(r304401)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Thu Aug 18 10:54:39 
2016(r304402)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 
2016-08-15 19:08:51Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304395 
2016-08-18 10:50:40Z gnn 
  */
 
 #defineFREEBSD32_SYS_syscall   0
@@ -218,7 +218,7 @@
 #defineFREEBSD32_SYS_freebsd32_clock_getcpuclockid2247
 #defineFREEBSD32_SYS_minherit  250
 #defineFREEBSD32_SYS_rfork 251
-#defineFREEBSD32_SYS_openbsd_poll  252
+   /* 252 is obsolete openbsd_poll */
 #defineFREEBSD32_SYS_issetugid 253
 #defineFREEBSD32_SYS_lchown254
 #defineFREEBSD32_SYS_freebsd32_aio_read255

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- head/sys/compat/freebsd32/freebsd32_syscalls.c  Thu Aug 18 10:54:21 
2016(r304401)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c  Thu Aug 18 10:54:39 
2016(r304402)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 
2016-08-15 19:08:51Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304395 
2016-08-18 10:50:40Z gnn 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -262,7 +262,7 @@ const char *freebsd32_syscallnames[] = {
"#249", /* 249 = nosys */
"minherit", /* 250 = minherit */
"rfork",/* 251 = rfork */
-   "openbsd_poll", /* 252 = openbsd_poll */
+   "obs_openbsd_poll", /* 252 = obsolete openbsd_poll 
*/
"issetugid",/* 253 = issetugid */
"lchown",   /* 254 = lchown */
"freebsd32_aio_read",   /* 255 = freebsd32_aio_read */

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==
--- head/sys/compat/freebsd32/freebsd32_sysent.cThu Aug 18 10:54:21 
2016(r304401)
+++ head/sys/compat/freebsd32/freebsd32_sysent.cThu Aug 18 10:54:39 
2016(r304402)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 
2016-08-15 19:08:51Z kib 
+ * 

svn commit: r304395 - in head: lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/mips/sys lib/libc/powerpc/sys lib/libc/powerpc64/sys lib/libc/riscv/sys lib/libc/s...

2016-08-18 Thread George V. Neville-Neil
Author: gnn
Date: Thu Aug 18 10:50:40 2016
New Revision: 304395
URL: https://svnweb.freebsd.org/changeset/base/304395

Log:
  Remove unusedd and obsolete openbsd_poll system call.  (Phase 1)
  
  Reported by:  brooks
  Reviewed by:  brooks,jhb
  Differential Revision:https://reviews.freebsd.org/D7548

Modified:
  head/lib/libc/aarch64/sys/Makefile.inc
  head/lib/libc/amd64/sys/Makefile.inc
  head/lib/libc/arm/sys/Makefile.inc
  head/lib/libc/i386/sys/Makefile.inc
  head/lib/libc/mips/sys/Makefile.inc
  head/lib/libc/powerpc/sys/Makefile.inc
  head/lib/libc/powerpc64/sys/Makefile.inc
  head/lib/libc/riscv/sys/Makefile.inc
  head/lib/libc/sparc64/sys/Makefile.inc
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/capabilities.conf
  head/sys/kern/sys_generic.c
  head/sys/kern/syscalls.master
  head/sys/sys/param.h

Modified: head/lib/libc/aarch64/sys/Makefile.inc
==
--- head/lib/libc/aarch64/sys/Makefile.inc  Thu Aug 18 10:50:27 2016
(r304394)
+++ head/lib/libc/aarch64/sys/Makefile.inc  Thu Aug 18 10:50:40 2016
(r304395)
@@ -15,7 +15,6 @@ MDASM=cerror.S \
 NOASM= break.o \
exit.o \
getlogin.o \
-   openbsd_poll.o \
sbrk.o \
sstk.o \
vfork.o \

Modified: head/lib/libc/amd64/sys/Makefile.inc
==
--- head/lib/libc/amd64/sys/Makefile.incThu Aug 18 10:50:27 2016
(r304394)
+++ head/lib/libc/amd64/sys/Makefile.incThu Aug 18 10:50:40 2016
(r304395)
@@ -8,6 +8,6 @@ MDASM=  vfork.S brk.S cerror.S exect.S ge
sbrk.S setlogin.S sigreturn.S
 
 # Don't generate default code for these syscalls:
-NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
+NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o
 
 PSEUDO=_getlogin.o _exit.o

Modified: head/lib/libc/arm/sys/Makefile.inc
==
--- head/lib/libc/arm/sys/Makefile.inc  Thu Aug 18 10:50:27 2016
(r304394)
+++ head/lib/libc/arm/sys/Makefile.inc  Thu Aug 18 10:50:40 2016
(r304395)
@@ -5,6 +5,6 @@ SRCS+=  __vdso_gettc.c
 MDASM= Ovfork.S brk.S cerror.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S
 
 # Don't generate default code for these syscalls:
-NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
+NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o
 
 PSEUDO= _exit.o _getlogin.o

Modified: head/lib/libc/i386/sys/Makefile.inc
==
--- head/lib/libc/i386/sys/Makefile.inc Thu Aug 18 10:50:27 2016
(r304394)
+++ head/lib/libc/i386/sys/Makefile.inc Thu Aug 18 10:50:40 2016
(r304395)
@@ -11,7 +11,7 @@ MDASM=Ovfork.S brk.S cerror.S exect.S g
sbrk.S setlogin.S sigreturn.S syscall.S
 
 # Don't generate default code for these syscalls:
-NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
+NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o
 
 PSEUDO=_getlogin.o _exit.o
 

Modified: head/lib/libc/mips/sys/Makefile.inc
==
--- head/lib/libc/mips/sys/Makefile.inc Thu Aug 18 10:50:27 2016
(r304394)
+++ head/lib/libc/mips/sys/Makefile.inc Thu Aug 18 10:50:40 2016
(r304395)
@@ -6,6 +6,6 @@ MDASM=  Ovfork.S brk.S cerror.S exect.S 
ptrace.S sbrk.S syscall.S
 
 # Don't generate default code for these syscalls:
-NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o
+NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o
 
 PSEUDO= _exit.o _getlogin.o

Modified: head/lib/libc/powerpc/sys/Makefile.inc
==
--- head/lib/libc/powerpc/sys/Makefile.inc  Thu Aug 18 10:50:27 2016
(r304394)
+++ head/lib/libc/powerpc/sys/Makefile.inc  Thu Aug 18 10:50:40 2016
(r304395)
@@ -3,6 +3,6 @@
 MDASM+=brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S
 
 # Don't generate default code for these syscalls:
-NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o
+NOASM= break.o exit.o getlogin.o sstk.o yield.o
 
 PSEUDO=_getlogin.o _exit.o

Modified: head/lib/libc/powerpc64/sys/Makefile.inc
==
--- head/lib/libc/powerpc64/sys/Makefile.incThu Aug 18 10:50:27 2016
(r304394)
+++ head/lib/libc/powerpc64/sys/Makefile.incThu Aug 18 10:50:40 2016
(r304395)
@@ -3,6 +3,6 @@
 MDASM+=brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S
 
 # Don't generate default code for these syscalls:
-NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o
+NOASM= break.o exit.o getlogin.o sstk.o yield.o
 
 PSEUDO=_getlogin.o _exit.o


svn commit: r302474 - in head: cddl/lib/libdtrace tests/sys/netinet

2016-07-08 Thread George V. Neville-Neil
Author: gnn
Date: Fri Jul  8 23:44:09 2016
New Revision: 302474
URL: https://svnweb.freebsd.org/changeset/base/302474

Log:
  On FreeBSD there is a setsockopt option SO_USER_COOKIE which allows
  setting a 32 bit value on each socket. This can be used by applications
  and DTrace as a rendezvous point so that an applicaton's data can
  more easily be captured at run time. Expose the user cookie via
  DTrace by updating the translator in tcp.d and add a quick test
  program, a TCP server, that sets the cookie on each connection
  accepted.
  
  Reviewed by:  hiren
  MFC after:1 week
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D7152

Added:
  head/tests/sys/netinet/tcp_user_cookie.c   (contents, props changed)
Modified:
  head/cddl/lib/libdtrace/tcp.d
  head/tests/sys/netinet/Makefile

Modified: head/cddl/lib/libdtrace/tcp.d
==
--- head/cddl/lib/libdtrace/tcp.d   Fri Jul  8 23:40:25 2016
(r302473)
+++ head/cddl/lib/libdtrace/tcp.d   Fri Jul  8 23:44:09 2016
(r302474)
@@ -126,6 +126,7 @@ typedef struct tcpsinfo {
int tcps_retransmit;/* retransmit send event, boolean */
int tcps_srtt;  /* smoothed RTT in units of 
(TCP_RTT_SCALE*hz) */
int tcps_debug; /* socket has SO_DEBUG set */
+   int tcps_cookie;/* expose the socket's SO_USER_COOKIE */
int32_t tcps_dupacks;   /* consecutive dup acks received */
uint32_t tcps_rtttime;  /* RTT measurement start time */
uint32_t tcps_rtseq;/* sequence # being timed */
@@ -224,6 +225,8 @@ translator tcpsinfo_t < struct tcpcb *p 
tcps_srtt = p == NULL ? -1  : p->t_srtt;   /* smoothed RTT 
in units of (TCP_RTT_SCALE*hz) */
tcps_debug =p == NULL ? 0 :
p->t_inpcb->inp_socket->so_options & 1;
+   tcps_cookie =   p == NULL ? -1 :
+   p->t_inpcb->inp_socket->so_user_cookie;
tcps_dupacks =  p == NULL ? -1  : p->t_dupacks;
tcps_rtttime =  p == NULL ? -1  : p->t_rtttime;
tcps_rtseq =p == NULL ? -1  : p->t_rtseq;

Modified: head/tests/sys/netinet/Makefile
==
--- head/tests/sys/netinet/Makefile Fri Jul  8 23:40:25 2016
(r302473)
+++ head/tests/sys/netinet/Makefile Fri Jul  8 23:44:09 2016
(r302474)
@@ -5,7 +5,7 @@ BINDIR= ${TESTSDIR}
 
 ATF_TESTS_SH=  fibs_test
 
-PROGS= udp_dontroute
+PROGS= udp_dontroute tcp_user_cookie
 
 MAN=
 

Added: head/tests/sys/netinet/tcp_user_cookie.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/netinet/tcp_user_cookie.cFri Jul  8 23:44:09 2016
(r302474)
@@ -0,0 +1,111 @@
+/*
+ *  Copyright (c) 2016 Limelight Networks
+ *  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *  1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ *  2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ *
+ *  NO WARRANTY
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ *  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ *  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ *  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ *  IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ *  POSSIBILITY OF SUCH DAMAGES.
+ *
+ *  Authors: George Neville-Neil
+ *
+ * $FreeBSD$
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define buflen 80
+
+/*
+ * Setup a TCP server listening on a port for connections, all of
+ * which subseuqently have their user cookie set.
+ */
+int
+main(int argc, char **argv)
+{
+   struct sockaddr_in srv;
+   int sock, accepted, port, cookie;
+   int ret;
+   

svn commit: r301901 - svnadmin/conf

2016-06-14 Thread George V. Neville-Neil
Author: gnn
Date: Tue Jun 14 23:58:02 2016
New Revision: 301901
URL: https://svnweb.freebsd.org/changeset/base/301901

Log:
  Add Mike Karels (karels@) with myself as his mentor.
  
  Approved by:  core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessTue Jun 14 23:52:32 2016(r301900)
+++ svnadmin/conf/accessTue Jun 14 23:58:02 2016(r301901)
@@ -138,6 +138,7 @@ jwd
 kadesai
 kaiw
 kan
+karels
 ken
 kensmith
 kevlo

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Tue Jun 14 23:52:32 2016(r301900)
+++ svnadmin/conf/mentors   Tue Jun 14 23:58:02 2016(r301901)
@@ -22,6 +22,7 @@ jkh   rwatson
 jonathan   rwatson
 jwdrmacklem
 kadesaiken Co-mentor: scottl, ambrisko
+karels gnn
 landonfadrian
 mahrensmckusick
 manu   andrew  Co-mentor: cognet
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301478 - head/sys/netinet

2016-06-05 Thread George V. Neville-Neil
Author: gnn
Date: Mon Jun  6 00:35:45 2016
New Revision: 301478
URL: https://svnweb.freebsd.org/changeset/base/301478

Log:
  Add missing constants from RFCs 4443 and 6550

Modified:
  head/sys/netinet/icmp6.h

Modified: head/sys/netinet/icmp6.h
==
--- head/sys/netinet/icmp6.hSun Jun  5 23:56:28 2016(r301477)
+++ head/sys/netinet/icmp6.hMon Jun  6 00:35:45 2016(r301478)
@@ -144,6 +144,9 @@ struct icmp6_hdr {
 #define ICMP6_DST_UNREACH_BEYONDSCOPE  2   /* beyond scope of source 
address */
 #define ICMP6_DST_UNREACH_ADDR 3   /* address unreachable */
 #define ICMP6_DST_UNREACH_NOPORT   4   /* port unreachable */
+#define ICMP6_DST_UNREACH_POLICY   5   /* failed ingress/egress policy 
*/
+#define ICMP6_DST_UNREACH_REJECT   6   /* Reject route to destination 
*/
+#define ICMP6_DST_UNREACH_SRCROUTE 7   /* Error in source routing 
header */
 
 #define ICMP6_TIME_EXCEED_TRANSIT  0   /* ttl==0 in transit */
 #define ICMP6_TIME_EXCEED_REASSEMBLY   1   /* ttl==0 in reass */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301229 - in head/sys/ofed/drivers/infiniband: core ulp/ipoib

2016-06-02 Thread George V. Neville-Neil
Author: gnn
Date: Thu Jun  2 20:53:43 2016
New Revision: 301229
URL: https://svnweb.freebsd.org/changeset/base/301229

Log:
  Fix up the Infiniband code to handle the new arpresolve.

Modified:
  head/sys/ofed/drivers/infiniband/core/addr.c
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c

Modified: head/sys/ofed/drivers/infiniband/core/addr.c
==
--- head/sys/ofed/drivers/infiniband/core/addr.cThu Jun  2 20:31:02 
2016(r301228)
+++ head/sys/ofed/drivers/infiniband/core/addr.cThu Jun  2 20:53:43 
2016(r301229)
@@ -395,13 +395,13 @@ mcast:
 #ifdef INET
case AF_INET:
error = arpresolve(ifp, is_gw, NULL,
-   is_gw ? rte->rt_gateway : dst_in, edst, NULL);
+   is_gw ? rte->rt_gateway : dst_in, edst, NULL, NULL);
break;
 #endif
 #ifdef INET6
case AF_INET6:
error = nd6_resolve(ifp, is_gw, NULL,
-   is_gw ? rte->rt_gateway : dst_in, edst, NULL);
+   is_gw ? rte->rt_gateway : dst_in, edst, NULL, NULL);
break;
 #endif
default:

Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c
==
--- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Thu Jun  2 
20:31:02 2016(r301228)
+++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Thu Jun  2 
20:53:43 2016(r301229)
@@ -1296,7 +1296,7 @@ ipoib_output(struct ifnet *ifp, struct m
else if (m->m_flags & M_MCAST)
ip_ib_mc_map(((struct sockaddr_in 
*)dst)->sin_addr.s_addr, ifp->if_broadcastaddr, edst);
else
-   error = arpresolve(ifp, is_gw, m, dst, edst, NULL);
+   error = arpresolve(ifp, is_gw, m, dst, edst, NULL, 
NULL);
if (error)
return (error == EWOULDBLOCK ? 0 : error);
type = htons(ETHERTYPE_IP);
@@ -1334,7 +1334,7 @@ ipoib_output(struct ifnet *ifp, struct m
else if (m->m_flags & M_MCAST)
ipv6_ib_mc_map(&((struct sockaddr_in6 
*)dst)->sin6_addr, ifp->if_broadcastaddr, edst);
else
-   error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL);
+   error = nd6_resolve(ifp, is_gw, m, dst, edst, NULL, 
NULL);
if (error)
return error;
type = htons(ETHERTYPE_IPV6);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r301217 - in head/sys: net netinet netinet6

2016-06-02 Thread George V. Neville-Neil
Author: gnn
Date: Thu Jun  2 17:51:29 2016
New Revision: 301217
URL: https://svnweb.freebsd.org/changeset/base/301217

Log:
  This change re-adds L2 caching for TCP and UDP, as originally added in D4306
  but removed due to other changes in the system. Restore the llentry pointer
  to the "struct route", and use it to cache the L2 lookup (ARP or ND6) as
  appropriate.
  
  Submitted by: Mike Karels
  Differential Revision:https://reviews.freebsd.org/D6262

Modified:
  head/sys/net/flowtable.c
  head/sys/net/if_arcsubr.c
  head/sys/net/if_ethersubr.c
  head/sys/net/if_fddisubr.c
  head/sys/net/if_fwsubr.c
  head/sys/net/if_iso88025subr.c
  head/sys/net/if_llatbl.h
  head/sys/net/route.c
  head/sys/net/route.h
  head/sys/netinet/if_ether.c
  head/sys/netinet/if_ether.h
  head/sys/netinet/in_pcb.c
  head/sys/netinet/ip_output.c
  head/sys/netinet/toecore.c
  head/sys/netinet6/in6.h
  head/sys/netinet6/in6_pcb.c
  head/sys/netinet6/ip6_output.c
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6.h

Modified: head/sys/net/flowtable.c
==
--- head/sys/net/flowtable.cThu Jun  2 17:31:37 2016(r301216)
+++ head/sys/net/flowtable.cThu Jun  2 17:51:29 2016(r301217)
@@ -696,13 +696,8 @@ flowtable_lookup(sa_family_t sa, struct 
ro->ro_rt = fle->f_rt;
ro->ro_flags |= RT_NORTREF;
lle = fle->f_lle;
-   if (lle != NULL && (lle->la_flags & LLE_VALID)) {
-   ro->ro_prepend = lle->r_linkdata;
-   ro->ro_plen = lle->r_hdrlen;
-   ro->ro_flags |= RT_MAY_LOOP;
-   if (lle->la_flags & LLE_IFADDR)
-   ro->ro_flags |= RT_L2_ME;
-   }
+   if (lle != NULL && (lle->la_flags & LLE_VALID))
+   ro->ro_lle = lle;   /* share ref with fle->f_lle */
 
return (0);
 }

Modified: head/sys/net/if_arcsubr.c
==
--- head/sys/net/if_arcsubr.c   Thu Jun  2 17:31:37 2016(r301216)
+++ head/sys/net/if_arcsubr.c   Thu Jun  2 17:51:29 2016(r301217)
@@ -129,7 +129,8 @@ arc_output(struct ifnet *ifp, struct mbu
else if (ifp->if_flags & IFF_NOARP)
adst = ntohl(SIN(dst)->sin_addr.s_addr) & 0xFF;
else {
-   error = arpresolve(ifp, is_gw, m, dst, , NULL);
+   error = arpresolve(ifp, is_gw, m, dst, , NULL,
+   NULL);
if (error)
return (error == EWOULDBLOCK ? 0 : error);
}
@@ -170,7 +171,8 @@ arc_output(struct ifnet *ifp, struct mbu
if ((m->m_flags & M_MCAST) != 0)
adst = arcbroadcastaddr; /* ARCnet broadcast address */
else {
-   error = nd6_resolve(ifp, is_gw, m, dst, , NULL);
+   error = nd6_resolve(ifp, is_gw, m, dst, , NULL,
+   NULL);
if (error != 0)
return (error == EWOULDBLOCK ? 0 : error);
}

Modified: head/sys/net/if_ethersubr.c
==
--- head/sys/net/if_ethersubr.c Thu Jun  2 17:31:37 2016(r301216)
+++ head/sys/net/if_ethersubr.c Thu Jun  2 17:51:29 2016(r301217)
@@ -199,7 +199,7 @@ ether_requestencap(struct ifnet *ifp, st
 static int
 ether_resolve_addr(struct ifnet *ifp, struct mbuf *m,
const struct sockaddr *dst, struct route *ro, u_char *phdr,
-   uint32_t *pflags)
+   uint32_t *pflags, struct llentry **plle)
 {
struct ether_header *eh;
uint32_t lleflags = 0;
@@ -208,13 +208,16 @@ ether_resolve_addr(struct ifnet *ifp, st
uint16_t etype;
 #endif
 
+   if (plle)
+   *plle = NULL;
eh = (struct ether_header *)phdr;
 
switch (dst->sa_family) {
 #ifdef INET
case AF_INET:
if ((m->m_flags & (M_BCAST | M_MCAST)) == 0)
-   error = arpresolve(ifp, 0, m, dst, phdr, );
+   error = arpresolve(ifp, 0, m, dst, phdr, ,
+   plle);
else {
if (m->m_flags & M_BCAST)
memcpy(eh->ether_dhost, ifp->if_broadcastaddr,
@@ -233,7 +236,8 @@ ether_resolve_addr(struct ifnet *ifp, st
 #ifdef INET6
case AF_INET6:
if ((m->m_flags & M_MCAST) == 0)
-   error = nd6_resolve(ifp, 0, m, dst, phdr, );
+   error = nd6_resolve(ifp, 0, m, dst, phdr, ,
+   plle);
else {
const struct in6_addr *a6;
a6 = &(((const struct sockaddr_in6 *)dst)->sin6_addr);
@@ -283,14 +287,40 @@ ether_output(struct ifnet *ifp, struct m
int loop_copy 

svn commit: r301182 - head/sys/dev/ath

2016-06-02 Thread George V. Neville-Neil
Author: gnn
Date: Thu Jun  2 01:59:41 2016
New Revision: 301182
URL: https://svnweb.freebsd.org/changeset/base/301182

Log:
  Fix kernel build.  Improper definition location of a variable.

Modified:
  head/sys/dev/ath/if_ath_btcoex_mci.c

Modified: head/sys/dev/ath/if_ath_btcoex_mci.c
==
--- head/sys/dev/ath/if_ath_btcoex_mci.cThu Jun  2 00:51:36 2016
(r301181)
+++ head/sys/dev/ath/if_ath_btcoex_mci.cThu Jun  2 01:59:41 2016
(r301182)
@@ -436,6 +436,7 @@ ath_btcoex_mci_intr(struct ath_softc *sc
uint32_t offset, subtype, opcode;
uint32_t *pGpm;
uint32_t more_data = HAL_MCI_GPM_MORE;
+   int8_t value_dbm;
bool skip_gpm = false;
 
DPRINTF(sc, ATH_DEBUG_BTCOEX, "%s: called\n", __func__);
@@ -607,7 +608,7 @@ ath_btcoex_mci_intr(struct ath_softc *sc
DPRINTF(sc, ATH_DEBUG_BTCOEX, "(MCI) LNA_INFO\n");
}
if (mciIntRxMsg & HAL_MCI_INTERRUPT_RX_MSG_CONT_INFO) {
-   int8_t value_dbm = ath_hal_btcoex_mci_state(sc->sc_ah,
+   value_dbm = ath_hal_btcoex_mci_state(sc->sc_ah,
HAL_MCI_STATE_CONT_RSSI_POWER, NULL);
 
mciIntRxMsg &= ~HAL_MCI_INTERRUPT_RX_MSG_CONT_INFO;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300256 - in head: . etc/mtree

2016-05-19 Thread George V. Neville-Neil
Author: gnn
Date: Fri May 20 01:38:31 2016
New Revision: 300256
URL: https://svnweb.freebsd.org/changeset/base/300256

Log:
  Remove DTrace tooklkit from the mtree and add the files to remove
  to the ObsoleteFiles list.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/ObsoleteFiles.inc
  head/etc/mtree/BSD.usr.dist

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri May 20 01:25:14 2016(r300255)
+++ head/ObsoleteFiles.inc  Fri May 20 01:38:31 2016(r300256)
@@ -38,6 +38,13 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20160519: remove DTrace Toolkit from base
+OLD_FILES+=usr/share/dtrace/toolkit/execsnoop*
+OLD_FILES+=usr/share/dtrace/toolkit/hotkernel*
+OLD_FILES+=usr/share/dtrace/toolkit/hotuser*
+OLD_FILES+=usr/share/dtrace/toolkit/opensnoop*
+OLD_FILES+=usr/share/dtrace/toolkit/procsystime*
+OLD_DIRS+=usr/share/dtrace/toolkit
 # 20160519: stale MLINK removed
 OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz
 # 20160517: ReiserFS removed

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Fri May 20 01:25:14 2016(r300255)
+++ head/etc/mtree/BSD.usr.dist Fri May 20 01:38:31 2016(r300256)
@@ -309,8 +309,6 @@
 ..
 ..
 dtrace
-toolkit
-..
 ..
 examples
 BSD_daemon
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300226 - in head: cddl/contrib/dtracetoolkit cddl/usr.sbin cddl/usr.sbin/dtruss share/dtrace share/dtrace/toolkit

2016-05-19 Thread George V. Neville-Neil
Author: gnn
Date: Thu May 19 19:51:39 2016
New Revision: 300226
URL: https://svnweb.freebsd.org/changeset/base/300226

Log:
  Remove the old version of the DTraceToolkit from the source tree.
  The DTraceToolkit is part of the Open DTrace effort and is supported
  on FreeBSD as a port (sysutils/DTraceToolkit) which has been updated
  to properly track toolkit development upstream.
  
  Sponsored by: DARPA, AFRL

Deleted:
  head/cddl/contrib/dtracetoolkit/
  head/cddl/usr.sbin/dtruss/
  head/share/dtrace/toolkit/
Modified:
  head/cddl/usr.sbin/Makefile
  head/share/dtrace/Makefile
  head/share/dtrace/README

Modified: head/cddl/usr.sbin/Makefile
==
--- head/cddl/usr.sbin/Makefile Thu May 19 19:27:33 2016(r300225)
+++ head/cddl/usr.sbin/Makefile Thu May 19 19:51:39 2016(r300226)
@@ -3,7 +3,6 @@
 .include 
 
 SUBDIR=${_dtrace} \
-   ${_dtruss} \
${_lockstat} \
${_plockstat} \
${_tests} \
@@ -23,14 +22,12 @@ _zhack= zhack
 
 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 _dtrace=   dtrace
-_dtruss=   dtruss
 _lockstat= lockstat
 _plockstat=plockstat
 .endif
 
 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
 _dtrace=   dtrace
-_dtruss=   dtruss
 _lockstat= lockstat
 .endif
 
@@ -40,7 +37,6 @@ _dtrace=  dtrace
 
 .if ${MACHINE_CPUARCH} == "powerpc"
 _dtrace=   dtrace
-_dtruss=   dtruss
 _lockstat= lockstat
 .endif
 

Modified: head/share/dtrace/Makefile
==
--- head/share/dtrace/Makefile  Thu May 19 19:27:33 2016(r300225)
+++ head/share/dtrace/Makefile  Thu May 19 19:51:39 2016(r300226)
@@ -6,12 +6,6 @@
 
 .include 
 
-SUBDIR= ${_toolkit}
-
-.if ${MK_CDDL} != "no"
-_toolkit=  toolkit
-.endif
-
 SCRIPTS=   blocking \
disklatency \
disklatencycmd \

Modified: head/share/dtrace/README
==
--- head/share/dtrace/READMEThu May 19 19:27:33 2016(r300225)
+++ head/share/dtrace/READMEThu May 19 19:51:39 2016(r300226)
@@ -1,11 +1,5 @@
 $FreeBSD$
 
-This directory contains scripts for use with the DTrace system.  The
-toolkit/ directory installs the latest vendor import of Brendan
-Gregg's DTraceToolkit while the other files and directories
-contain code generated by the FreeBSD Project for use with DTrace on
-FreeBSD.
-
-NOTE: Do not add new scripts to the toolkit directory. New DTraceToolkit
-scripts should be send to the maintainer of the toolkit and then brought
-back into FreeBSD via future vendor imports.
+This directory contains scripts for use with the DTrace system.
+These files and directories contain code generated by the FreeBSD
+Project for use with DTrace on FreeBSD.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300067 - head/sys/conf

2016-05-17 Thread George V. Neville-Neil
Author: gnn
Date: Tue May 17 17:09:45 2016
New Revision: 300067
URL: https://svnweb.freebsd.org/changeset/base/300067

Log:
  Final nit in ReiserFS removal.

Modified:
  head/sys/conf/options

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Tue May 17 17:08:13 2016(r300066)
+++ head/sys/conf/options   Tue May 17 17:09:45 2016(r300067)
@@ -242,7 +242,6 @@ NANDFS  opt_dontuse.h
 NULLFS opt_dontuse.h
 PROCFS opt_dontuse.h
 PSEUDOFS   opt_dontuse.h
-REISERFS   opt_dontuse.h
 SMBFS  opt_dontuse.h
 TMPFS  opt_dontuse.h
 UDFopt_dontuse.h
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300065 - head/sys/conf

2016-05-17 Thread George V. Neville-Neil
Author: gnn
Date: Tue May 17 16:59:53 2016
New Revision: 300065
URL: https://svnweb.freebsd.org/changeset/base/300065

Log:
  Finish cleaning up after killing ReiserFS.
  
  Remove LINT/NOTES option and file linkages.

Modified:
  head/sys/conf/NOTES
  head/sys/conf/files

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Tue May 17 16:58:39 2016(r300064)
+++ head/sys/conf/NOTES Tue May 17 16:59:53 2016(r300065)
@@ -1139,12 +1139,6 @@ options  NFS_DEBUG   # Enable NFS Debuggi
 #
 optionsEXT2FS
 
-#
-# Add support for the ReiserFS filesystem (used in Linux). Currently,
-# this is limited to read-only access.
-#
-optionsREISERFS
-
 # Cryptographically secure random number generator; /dev/random
 device random
 
@@ -3063,4 +3057,4 @@ options   EM_MULTIQUEUE # Activate multiq
 optionsGZIO
 
 # BHND(4) drivers
-optionsBHND_LOGLEVEL   # Logging threshold level
\ No newline at end of file
+optionsBHND_LOGLEVEL   # Logging threshold level

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue May 17 16:58:39 2016(r300064)
+++ head/sys/conf/files Tue May 17 16:59:53 2016(r300065)
@@ -3155,15 +3155,6 @@ fs/ext2fs/ext2_lookup.c  optional ext2fs
 fs/ext2fs/ext2_subr.c  optional ext2fs
 fs/ext2fs/ext2_vfsops.coptional ext2fs
 fs/ext2fs/ext2_vnops.c optional ext2fs
-gnu/fs/reiserfs/reiserfs_hashes.c  optional reiserfs \
-   warning "kernel contains GPL contaminated ReiserFS filesystem"
-gnu/fs/reiserfs/reiserfs_inode.c   optional reiserfs
-gnu/fs/reiserfs/reiserfs_item_ops.coptional reiserfs
-gnu/fs/reiserfs/reiserfs_namei.c   optional reiserfs
-gnu/fs/reiserfs/reiserfs_prints.c  optional reiserfs
-gnu/fs/reiserfs/reiserfs_stree.c   optional reiserfs
-gnu/fs/reiserfs/reiserfs_vfsops.c  optional reiserfs
-gnu/fs/reiserfs/reiserfs_vnops.c   optional reiserfs
 #
 isa/isa_if.m   standard
 isa/isa_common.c   optional isa
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r300062 - in head/sys: gnu/fs modules modules/reiserfs

2016-05-17 Thread George V. Neville-Neil
Author: gnn
Date: Tue May 17 15:36:40 2016
New Revision: 300062
URL: https://svnweb.freebsd.org/changeset/base/300062

Log:
  Kill off ReiserFS as it is no longer supported, for obvious reasons.

Deleted:
  head/sys/gnu/fs/
  head/sys/modules/reiserfs/
Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Tue May 17 15:21:17 2016(r300061)
+++ head/sys/modules/Makefile   Tue May 17 15:36:40 2016(r300062)
@@ -312,7 +312,6 @@ SUBDIR= \
${_rdma} \
${_rdrand_rng} \
re \
-   reiserfs \
rl \
rtwn \
${_rtwnfw} \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r298892 - head/tools/tools/netmap

2016-05-01 Thread George V. Neville-Neil
Author: gnn
Date: Sun May  1 17:55:45 2016
New Revision: 298892
URL: https://svnweb.freebsd.org/changeset/base/298892

Log:
  Add a manual page for pkt-gen.
  
  Sponsored by: EMC / Isilon Storage Division

Added:
  head/tools/tools/netmap/pkt-gen.8   (contents, props changed)

Added: head/tools/tools/netmap/pkt-gen.8
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/netmap/pkt-gen.8   Sun May  1 17:55:45 2016
(r298892)
@@ -0,0 +1,179 @@
+.\" Copyright (c) 2016, George V. Neville-Neil
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright notice,
+.\"this list of conditions and the following disclaimer.
+.\"
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 1, 2016
+.Dt PKT-GEN 8
+.Os
+.Sh NAME
+.Nm pkt-gen
+.Nd Packet generator for use with
+.Xr netmap 4
+.Sh SYNOPSIS
+.Bl -item -compact
+.It
+.Nm
+.Op Fl i Ar interface
+.Op Fl f Ar function
+.Op Fl n Ar count
+.Op Fl t Ar pkts_to_send
+.Op Fl r Ar pkts_to_receive
+.Op Fl l Ar pkt_size
+.Op Fl d Ar dst_ip[:port[-dst_ip:port]]
+.Op Fl s Ar src_ip[:port[-src_ip:port]]
+.Op Fl D Ar dst-mac
+.Op Fl S Ar src-mac
+.Op Fl a Ar cpu_id
+.Op Fl b Ar burst size
+.Op Fl c Ar cores
+.Op Fl p Ar threads
+.Op Fl T Ar report_ms
+.Op Fl P
+.Op Fl w Ar wait_for_link_time
+.Op Fl R Ar rate
+.Op Fl X
+.Op Fl H Ar len
+.Op Fl P Ar xfile
+.Op Fl z
+.Op Fl Z
+.Sh DESCRIPTION
+.Nm
+generates and receives raw network packets using
+.Xr netmap 4 .
+The arguments are as follows:
+.Pp
+.Bl -tag -width Ds
+.It Fl i Ar interface
+Network interface name.
+.It Fl f Ar function tx rx ping pong
+Set the function to transmit, receive of ping/pong.
+.It Fl n count
+Number of iterations (can be 0).
+.It Fl t pkts_to_send
+Number of packets to send.  Also forces transmit mode.
+.It Fl r Ar pkts_to_receive
+Number of packets to receive.  Also forces rx mode.
+.It Fl l Ar pkt_size
+Packet size in bytes excluding CRC.
+.It Fl d Ar dst_ip[:port[-dst_ip:port]]
+Destination IPv4 address and port, single or range.
+.It Fl s Ar src_ip[:port[-src_ip:port]]
+Source IPv4 address and port, single or range.
+.It Fl D Ar dst-mac
+Destination MAC address in colon notation.
+.It Fl S Ar src-mac
+Source MAC address in colon notation.
+.It Fl a Ar cpu_id
+Tie
+.Nm
+to a particular CPU core using
+.Xr setaffinity 2.
+.It Fl b Ar burst size
+Set the size of a burst of packets.
+.It Fl c Ar cores
+Number of cores to use.
+.It Fl p Ar threads
+Number of threads to use.
+.It Fl T Ar report_ms
+Number of milliseconds between reports.
+.It Fl P
+Use libpcap instead of netmap for reading or writing.
+.It Fl w Ar wait_for_link_time
+Number of seconds to wait to make sure that the network link is up.  A
+network device driver may take some time to create a new
+transmit/receive ring pair when
+.Xr netmap 4
+requests one.
+.It Fl R Ar rate
+Packet transmission rate.  Not setting the packet transmission rate tells
+.Nm
+to transmit packets as quickly as possible.  On servers from 2010 on-wards
+.Xr netmap 4
+is able to completely use all of the bandwidth of a 10 or 40Gbps link,
+so this option should be used unless your intention is to saturate the link.
+.It Fl X
+Dump payload transmitted or received.
+.It Fl H Ar len
+Add empty virtio-net-header with size 'len'.  This option is only use
+with Virtual Machine technologies that use virtio as a network interface.
+.It Fl P Ar file
+Load the packet from a pcap file rather than constructing it inside of
+.Nm
+.It Fl z
+Use random IPv4 src address/port
+.It Fl Z
+Use random IPv4 dst address/por

svn commit: r298386 - head/share/dtrace

2016-04-20 Thread George V. Neville-Neil
Author: gnn
Date: Thu Apr 21 03:17:53 2016
New Revision: 298386
URL: https://svnweb.freebsd.org/changeset/base/298386

Log:
  Add the address at which the routine returned.
  
  MFC after:1 week
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  head/share/dtrace/retval

Modified: head/share/dtrace/retval
==
--- head/share/dtrace/retvalWed Apr 20 23:56:25 2016(r298385)
+++ head/share/dtrace/retvalThu Apr 21 03:17:53 2016(r298386)
@@ -37,6 +37,6 @@
 #pragma D option quiet
 
 fbt::$1:return {
-   printf("%s %d\n", probefunc, arg1);
+   printf("%s+0x%x returned %d\n", probefunc, arg0, arg1);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297799 - stable/10/sys/net

2016-04-10 Thread George V. Neville-Neil
Author: gnn
Date: Mon Apr 11 02:42:04 2016
New Revision: 297799
URL: https://svnweb.freebsd.org/changeset/base/297799

Log:
  MFC 297358
  Add ethertype reserved for network testing

Modified:
  stable/10/sys/net/ethernet.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/ethernet.h
==
--- stable/10/sys/net/ethernet.hMon Apr 11 02:21:42 2016
(r297798)
+++ stable/10/sys/net/ethernet.hMon Apr 11 02:42:04 2016
(r297799)
@@ -314,6 +314,7 @@ struct ether_addr {
 #defineETHERTYPE_SLOW  0x8809  /* 802.3ad link aggregation 
(LACP) */
 #defineETHERTYPE_PPP   0x880B  /* PPP (obsolete by PPPoE) */
 #defineETHERTYPE_HITACHI   0x8820  /* Hitachi Cable 
(Optoelectronic Systems Laboratory) */
+#define ETHERTYPE_TEST 0x8822  /* Network Conformance Testing */
 #defineETHERTYPE_MPLS  0x8847  /* MPLS Unicast */
 #defineETHERTYPE_MPLS_MCAST0x8848  /* MPLS Multicast */
 #defineETHERTYPE_AXIS  0x8856  /* Axis Communications AB 
proprietary bootstrap/config */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-03-30 Thread George V. Neville-Neil
Author: gnn
Date: Thu Mar 31 00:53:23 2016
New Revision: 297439
URL: https://svnweb.freebsd.org/changeset/base/297439

Log:
  Unbreak the RSS/PCBGROUp build.

Modified:
  head/sys/netinet/in_pcbgroup.c
  head/sys/netinet6/in6_pcbgroup.c

Modified: head/sys/netinet/in_pcbgroup.c
==
--- head/sys/netinet/in_pcbgroup.c  Thu Mar 31 00:26:40 2016
(r297438)
+++ head/sys/netinet/in_pcbgroup.c  Thu Mar 31 00:53:23 2016
(r297439)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 

Modified: head/sys/netinet6/in6_pcbgroup.c
==
--- head/sys/netinet6/in6_pcbgroup.cThu Mar 31 00:26:40 2016
(r297438)
+++ head/sys/netinet6/in6_pcbgroup.cThu Mar 31 00:53:23 2016
(r297439)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #include 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297358 - head/sys/net

2016-03-28 Thread George V. Neville-Neil
Author: gnn
Date: Mon Mar 28 18:25:54 2016
New Revision: 297358
URL: https://svnweb.freebsd.org/changeset/base/297358

Log:
  Add ethertype reserved for network testing
  
  MFC after:2 weeks

Modified:
  head/sys/net/ethernet.h

Modified: head/sys/net/ethernet.h
==
--- head/sys/net/ethernet.h Mon Mar 28 17:42:14 2016(r297357)
+++ head/sys/net/ethernet.h Mon Mar 28 18:25:54 2016(r297358)
@@ -333,6 +333,7 @@ struct ether_vlan_header {
 #defineETHERTYPE_SLOW  0x8809  /* 802.3ad link aggregation 
(LACP) */
 #defineETHERTYPE_PPP   0x880B  /* PPP (obsolete by PPPoE) */
 #defineETHERTYPE_HITACHI   0x8820  /* Hitachi Cable 
(Optoelectronic Systems Laboratory) */
+#define ETHERTYPE_TEST 0x8822  /* Network Conformance Testing */
 #defineETHERTYPE_MPLS  0x8847  /* MPLS Unicast */
 #defineETHERTYPE_MPLS_MCAST0x8848  /* MPLS Multicast */
 #defineETHERTYPE_AXIS  0x8856  /* Axis Communications AB 
proprietary bootstrap/config */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297225 - in head/sys: net netinet netinet6

2016-03-25 Thread George V. Neville-Neil


On 03/24/16 04:31 PM, Gleb Smirnoff wrote:
> On Thu, Mar 24, 2016 at 07:54:56AM +0000, George V. Neville-Neil wrote:
> G> Author: gnn
> G> Date: Thu Mar 24 07:54:56 2016
> G> New Revision: 297225
> G> URL: https://svnweb.freebsd.org/changeset/base/297225
> G> 
> G> Log:
> G>   FreeBSD previously provided route caching for TCP (and UDP). Re-add
> G>   route caching for TCP, with some improvements. In particular, invalidate
> G>   the route cache if a new route is added, which might be a better match.
> G>   The cache is automatically invalidated if the old route is deleted.
> G>   
> G>   Submitted by:Mike Karels
> G>   Reviewed by: gnn
> G>   Differential Revision:   https://reviews.freebsd.org/D4306
>
> I'm quite surprised to see this checked in, taking into account that the
> D4306 has strong disagreement from melifaro@.
>
> So, now we got two aids for poor routing: TCP route caching & flowtable.
>
Given that melifaro@ has not responded to emails from several folks for
several weeks I pushed this in so that we could a) break the tie and b)
have a place to start for improvement.  The status quo was unacceptable.

Best,
George

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


svn commit: r297258 - head/share/dtrace

2016-03-24 Thread George V. Neville-Neil
Author: gnn
Date: Fri Mar 25 00:33:55 2016
New Revision: 297258
URL: https://svnweb.freebsd.org/changeset/base/297258

Log:
  Remove dependency on mbuf provider as mbuf SDTs are now in the SDT space.
  
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  head/share/dtrace/mbuf.d

Modified: head/share/dtrace/mbuf.d
==
--- head/share/dtrace/mbuf.dFri Mar 25 00:32:43 2016(r297257)
+++ head/share/dtrace/mbuf.dFri Mar 25 00:33:55 2016(r297258)
@@ -30,7 +30,6 @@
  */
 
 #pragma D depends_on module kernel
-#pragma D depends_on provider mbuf
 
 /*
  * mbuf flags of global significance and layer crossing.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-03-24 Thread George V. Neville-Neil
Author: gnn
Date: Thu Mar 24 08:26:06 2016
New Revision: 297227
URL: https://svnweb.freebsd.org/changeset/base/297227

Log:
  Move mbuf provider under SDT to indicate that it is FreeBSD specific
  and not a stable interface.
  
  Reviewed by:  markj
  MFC after:2 weeks
  Sponsored by: Rubicon Communications (Netgate)
  Differential Revision:https://reviews.freebsd.org/D5716

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

Modified: head/sys/kern/uipc_mbuf.c
==
--- head/sys/kern/uipc_mbuf.c   Thu Mar 24 08:25:05 2016(r297226)
+++ head/sys/kern/uipc_mbuf.c   Thu Mar 24 08:26:06 2016(r297227)
@@ -49,48 +49,46 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-SDT_PROVIDER_DEFINE(mbuf);
-
-SDT_PROBE_DEFINE5_XLATE(mbuf, , , m__init,
+SDT_PROBE_DEFINE5_XLATE(sdt, , , m__init,
 "struct mbuf *", "mbufinfo_t *",
 "uint32_t", "uint32_t",
 "uint16_t", "uint16_t",
 "uint32_t", "uint32_t",
 "uint32_t", "uint32_t");
 
-SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__gethdr,
+SDT_PROBE_DEFINE3_XLATE(sdt, , , m__gethdr,
 "uint32_t", "uint32_t",
 "uint16_t", "uint16_t",
 "struct mbuf *", "mbufinfo_t *");
 
-SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__get,
+SDT_PROBE_DEFINE3_XLATE(sdt, , , m__get,
 "uint32_t", "uint32_t",
 "uint16_t", "uint16_t",
 "struct mbuf *", "mbufinfo_t *");
 
-SDT_PROBE_DEFINE4_XLATE(mbuf, , , m__getcl,
+SDT_PROBE_DEFINE4_XLATE(sdt, , , m__getcl,
 "uint32_t", "uint32_t",
 "uint16_t", "uint16_t",
 "uint32_t", "uint32_t",
 "struct mbuf *", "mbufinfo_t *");
 
-SDT_PROBE_DEFINE3_XLATE(mbuf, , , m__clget,
+SDT_PROBE_DEFINE3_XLATE(sdt, , , m__clget,
 "struct mbuf *", "mbufinfo_t *",
 "uint32_t", "uint32_t",
 "uint32_t", "uint32_t");
 
-SDT_PROBE_DEFINE4_XLATE(mbuf, , , m__cljget,
+SDT_PROBE_DEFINE4_XLATE(sdt, , , m__cljget,
 "struct mbuf *", "mbufinfo_t *",
 "uint32_t", "uint32_t",
 "uint32_t", "uint32_t",
 "void*", "void*");
 
-SDT_PROBE_DEFINE(mbuf, , , m__cljset);
+SDT_PROBE_DEFINE(sdt, , , m__cljset);
 
-SDT_PROBE_DEFINE1_XLATE(mbuf, , , m__free,
+SDT_PROBE_DEFINE1_XLATE(sdt, , , m__free,
 "struct mbuf *", "mbufinfo_t *");
 
-SDT_PROBE_DEFINE1_XLATE(mbuf, , , m__freem,
+SDT_PROBE_DEFINE1_XLATE(sdt, , , m__freem,
 "struct mbuf *", "mbufinfo_t *");
 
 #include 

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Thu Mar 24 08:25:05 2016(r297226)
+++ head/sys/sys/mbuf.h Thu Mar 24 08:26:06 2016(r297227)
@@ -48,27 +48,25 @@
 #include 
 
 #defineMBUF_PROBE1(probe, arg0)
\
-   SDT_PROBE1(mbuf, , , probe, arg0)
+   SDT_PROBE1(sdt, , , probe, arg0)
 #defineMBUF_PROBE2(probe, arg0, arg1)  
\
-   SDT_PROBE2(mbuf, , , probe, arg0, arg1)
+   SDT_PROBE2(sdt, , , probe, arg0, arg1)
 #defineMBUF_PROBE3(probe, arg0, arg1, arg2)\
-   SDT_PROBE3(mbuf, , , probe, arg0, arg1, arg2)
+   SDT_PROBE3(sdt, , , probe, arg0, arg1, arg2)
 #defineMBUF_PROBE4(probe, arg0, arg1, arg2, arg3)  
\
-   SDT_PROBE4(mbuf, , , probe, arg0, arg1, arg2, arg3)
+   SDT_PROBE4(sdt, , , probe, arg0, arg1, arg2, arg3)
 #defineMBUF_PROBE5(probe, arg0, arg1, arg2, arg3, arg4)
\
-   SDT_PROBE5(mbuf, , , probe, arg0, arg1, arg2, arg3, arg4)
+   SDT_PROBE5(sdt, , , probe, arg0, arg1, arg2, arg3, arg4)
 
-SDT_PROVIDER_DECLARE(mbuf);
-
-SDT_PROBE_DECLARE(mbuf, , , m__init);
-SDT_PROBE_DECLARE(mbuf, , , m__gethdr);
-SDT_PROBE_DECLARE(mbuf, , , m__get);
-SDT_PROBE_DECLARE(mbuf, , , m__getcl);
-SDT_PROBE_DECLARE(mbuf, , , m__clget);
-SDT_PROBE_DECLARE(mbuf, , , m__cljget);
-SDT_PROBE_DECLARE(mbuf, , , m__cljset);
-SDT_PROBE_DECLARE(mbuf, , , m__free);
-SDT_PROBE_DECLARE(mbuf, , , m__freem);
+SDT_PROBE_DECLARE(sdt, , , m__init);
+SDT_PROBE_DECLARE(sdt, , , m__gethdr);
+SDT_PROBE_DECLARE(sdt, , , m__get);
+SDT_PROBE_DECLARE(sdt, , , m__getcl);
+SDT_PROBE_DECLARE(sdt, , , m__clget);
+SDT_PROBE_DECLARE(sdt, , , m__cljget);
+SDT_PROBE_DECLARE(sdt, , , m__cljset);
+SDT_PROBE_DECLARE(sdt, , , m__free);
+SDT_PROBE_DECLARE(sdt, , , m__freem);
 
 #endif /* _KERNEL */
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297225 - in head/sys: net netinet netinet6

2016-03-24 Thread George V. Neville-Neil
Author: gnn
Date: Thu Mar 24 07:54:56 2016
New Revision: 297225
URL: https://svnweb.freebsd.org/changeset/base/297225

Log:
  FreeBSD previously provided route caching for TCP (and UDP). Re-add
  route caching for TCP, with some improvements. In particular, invalidate
  the route cache if a new route is added, which might be a better match.
  The cache is automatically invalidated if the old route is deleted.
  
  Submitted by: Mike Karels
  Reviewed by:  gnn
  Differential Revision:https://reviews.freebsd.org/D4306

Modified:
  head/sys/net/route.c
  head/sys/net/route.h
  head/sys/net/route_var.h
  head/sys/netinet/in_pcb.c
  head/sys/netinet/in_pcb.h
  head/sys/netinet/ip_output.c
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/tcp_timer.c
  head/sys/netinet/udp_usrreq.c
  head/sys/netinet6/in6_pcb.c
  head/sys/netinet6/ip6_output.c
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cThu Mar 24 07:24:33 2016(r297224)
+++ head/sys/net/route.cThu Mar 24 07:54:56 2016(r297225)
@@ -201,6 +201,16 @@ rt_tables_get_rnh(int table, int fam)
return (*rt_tables_get_rnh_ptr(table, fam));
 }
 
+rt_gen_t
+rt_tables_get_gen(int table, int fam)
+{
+   struct rib_head *rnh;
+
+   rnh = *rt_tables_get_rnh_ptr(table, fam);
+   return (rnh->rnh_gen);
+}
+
+
 /*
  * route initialization must occur before ip6_init2(), which happenas at
  * SI_ORDER_MIDDLE.
@@ -1754,6 +1764,7 @@ rtrequest1_fib(int req, struct rt_addrin
*ret_nrt = rt;
RT_ADDREF(rt);
}
+   rnh->rnh_gen++; /* Routing table updated */
RT_UNLOCK(rt);
break;
case RTM_CHANGE:

Modified: head/sys/net/route.h
==
--- head/sys/net/route.hThu Mar 24 07:24:33 2016(r297224)
+++ head/sys/net/route.hThu Mar 24 07:54:56 2016(r297225)
@@ -98,6 +98,14 @@ struct rt_metrics {
 /* lle state is exported in rmx_state rt_metrics field */
 #definermx_state   rmx_weight
 
+/*
+ * Keep a generation count of routing table, incremented on route addition,
+ * so we can invalidate caches.  This is accessed without a lock, as precision
+ * is not required.
+ */
+typedef volatile u_int rt_gen_t;   /* tree generation (for adds) */
+#define RT_GEN(fibnum, af) rt_tables_get_gen(fibnum, af)
+
 #defineRT_DEFAULT_FIB  0   /* Explicitly mark fib=0 restricted 
cases */
 #defineRT_ALL_FIBS -1  /* Announce event for every fib */
 #ifdef _KERNEL
@@ -398,6 +406,20 @@ struct rt_addrinfo {
}   \
 } while (0)
 
+/*
+ * Validate a cached route based on a supplied cookie.  If there is an
+ * out-of-date cache, simply free it.  Update the generation number
+ * for the new allocation
+ */
+#define RT_VALIDATE(ro, cookiep, fibnum) do {  \
+   rt_gen_t cookie = RT_GEN(fibnum, (ro)->ro_dst.sa_family);   \
+   if (*(cookiep) != cookie && (ro)->ro_rt != NULL) {  \
+   RTFREE((ro)->ro_rt);\
+   (ro)->ro_rt = NULL; \
+   *(cookiep) = cookie;\
+   }   \
+} while (0)
+
 struct ifmultiaddr;
 struct rib_head;
 
@@ -415,6 +437,7 @@ int  rt_setgate(struct rtentry *, struct
 voidrt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *);
 struct rib_head *rt_table_init(int);
 void   rt_table_destroy(struct rib_head *);
+rt_gen_t rt_tables_get_gen(int table, int fam);
 
 intrtsock_addrmsg(int, struct ifaddr *, int);
 intrtsock_routemsg(int, struct ifnet *ifp, int, struct rtentry *, int);

Modified: head/sys/net/route_var.h
==
--- head/sys/net/route_var.hThu Mar 24 07:24:33 2016(r297224)
+++ head/sys/net/route_var.hThu Mar 24 07:54:56 2016(r297225)
@@ -41,7 +41,7 @@ struct rib_head {
rn_walktree_t   *rnh_walktree;  /* traverse tree */
rn_walktree_from_t  *rnh_walktree_from; /* traverse tree below a */
rn_close_t  *rnh_close; /*do something when the last 
ref drops*/
-   u_int   rnh_gen;/* generation counter */
+   rt_gen_trnh_gen;/* generation counter */
int rnh_multipath;  /* multipath capable ? */
struct radix_node   rnh_nodes[3];   /* empty tree for common case */
struct rwlock   rib_lock;   /* config/data path lock */

Modified: 

svn commit: r296829 - head/usr.sbin/bhyve

2016-03-14 Thread George V. Neville-Neil
Author: gnn
Date: Mon Mar 14 08:48:16 2016
New Revision: 296829
URL: https://svnweb.freebsd.org/changeset/base/296829

Log:
  Fix typo: nmd->cur_tx_ring should be used in pci_vtnet_netmap_writev()
  The buffer length should be checked to avoid overflow, but there
  is no API to get the slot length, so the hardcoded value is used.
  Return the currently-first request chain back to the available
  queue if there are no more packets.
  Report the link as up if we managed to open vale port.
  Use consistent coding style.
  
  Submitted by: btw
  MFC after: 1 week
  Differential Revision:https://reviews.freebsd.org/D5595

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

Modified: head/usr.sbin/bhyve/pci_virtio_net.c
==
--- head/usr.sbin/bhyve/pci_virtio_net.cMon Mar 14 07:26:38 2016
(r296828)
+++ head/usr.sbin/bhyve/pci_virtio_net.cMon Mar 14 08:48:16 2016
(r296829)
@@ -381,7 +381,7 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc 
vq_endchains(vq, 1);
 }
 
-static int
+static __inline int
 pci_vtnet_netmap_writev(struct nm_desc *nmd, struct iovec *iov, int iovcnt)
 {
int r, i;
@@ -396,7 +396,7 @@ pci_vtnet_netmap_writev(struct nm_desc *
r++;
if (r > nmd->last_tx_ring)
r = nmd->first_tx_ring;
-   if (r == nmd->cur_rx_ring)
+   if (r == nmd->cur_tx_ring)
break;
continue;
}
@@ -405,6 +405,8 @@ pci_vtnet_netmap_writev(struct nm_desc *
buf = NETMAP_BUF(ring, idx);
 
for (i = 0; i < iovcnt; i++) {
+   if (len + iov[i].iov_len > 2048)
+   break;
memcpy([len], iov[i].iov_base, iov[i].iov_len);
len += iov[i].iov_len;
}
@@ -418,7 +420,7 @@ pci_vtnet_netmap_writev(struct nm_desc *
return (len);
 }
 
-static inline int
+static __inline int
 pci_vtnet_netmap_readv(struct nm_desc *nmd, struct iovec *iov, int iovcnt)
 {
int len = 0;
@@ -548,6 +550,7 @@ pci_vtnet_netmap_rx(struct pci_vtnet_sof
 * No more packets, but still some avail ring
 * entries.  Interrupt if needed/appropriate.
 */
+   vq_retchain(vq);
vq_endchains(vq, 0);
return;
}
@@ -884,8 +887,9 @@ pci_vtnet_init(struct vmctx *ctx, struct
pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_NET);
pci_set_cfgdata16(pi, PCIR_SUBVEND_0, VIRTIO_VENDOR);
 
-   /* Link is up if we managed to open tap device. */
-   sc->vsc_config.status = (opts == NULL || sc->vsc_tapfd >= 0);
+   /* Link is up if we managed to open tap device or vale port. */
+   sc->vsc_config.status = (opts == NULL || sc->vsc_tapfd >= 0 ||
+   sc->vsc_nmd != NULL);

/* use BAR 1 to map MSI-X table and PBA, if we're using MSI-X */
if (vi_intr_init(>vsc_vs, 1, fbsdrun_virtio_msix()))
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r296370 - stable/10/sbin/pfctl

2016-03-03 Thread George V. Neville-Neil
Author: gnn
Date: Thu Mar  3 23:25:31 2016
New Revision: 296370
URL: https://svnweb.freebsd.org/changeset/base/296370

Log:
  MFC 285730
  Only report the lack of ALTQ support if pfctl is using verbose (-v) mode.
  
  PR:   194935
  Submitted by: Jim Thompson
  Approved by: re (gjb)

Modified:
  stable/10/sbin/pfctl/pfctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/pfctl/pfctl.c
==
--- stable/10/sbin/pfctl/pfctl.cThu Mar  3 23:15:46 2016
(r296369)
+++ stable/10/sbin/pfctl/pfctl.cThu Mar  3 23:25:31 2016
(r296370)
@@ -1930,7 +1930,7 @@ pfctl_test_altqsupport(int dev, int opts
 
if (ioctl(dev, DIOCGETALTQS, )) {
if (errno == ENODEV) {
-   if (!(opts & PF_OPT_QUIET))
+   if (opts & PF_OPT_VERBOSE)
fprintf(stderr, "No ALTQ support in kernel\n"
"ALTQ related functions disabled\n");
return (0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r296352 - in head/sys/netinet: . tcp_stacks

2016-03-03 Thread George V. Neville-Neil
Author: gnn
Date: Thu Mar  3 17:46:38 2016
New Revision: 296352
URL: https://svnweb.freebsd.org/changeset/base/296352

Log:
  Fix dtrace probes (introduced in 287759): debug__input was used
  for output and drop; connect didn't always fire a user probe
  some probes were missing in fastpath
  
  Submitted by: Hannes Mehnert
  Sponsored by: REMS, EPSRC
  Differential Revision:https://reviews.freebsd.org/D5525

Modified:
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_stacks/fastpath.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/tcp_usrreq.c

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Thu Mar  3 15:36:00 2016
(r296351)
+++ head/sys/netinet/tcp_output.c   Thu Mar  3 17:46:38 2016
(r296352)
@@ -1317,7 +1317,7 @@ send:
ipov->ih_len = save;
}
 #endif /* TCPDEBUG */
-   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__output, tp, th, mtod(m, const char *));
 
/*
 * Fill in IP length and desired time to live and

Modified: head/sys/netinet/tcp_stacks/fastpath.c
==
--- head/sys/netinet/tcp_stacks/fastpath.c  Thu Mar  3 15:36:00 2016
(r296351)
+++ head/sys/netinet/tcp_stacks/fastpath.c  Thu Mar  3 17:46:38 2016
(r296352)
@@ -291,7 +291,6 @@ tcp_do_fastack(struct mbuf *m, struct tc
 */
tp->snd_wl2 = th->th_ack;
tp->t_dupacks = 0;
-   m_freem(m);
 
/*
 * If all outstanding data are acked, stop
@@ -308,6 +307,8 @@ tcp_do_fastack(struct mbuf *m, struct tc
  (void *)tcp_saveipgen,
  _savetcp, 0);
 #endif
+   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   m_freem(m);
if (tp->snd_una == tp->snd_max)
tcp_timer_activate(tp, TT_REXMT, 0);
else if (!tcp_timer_active(tp, TT_PERSIST))
@@ -398,6 +399,7 @@ tcp_do_fastnewdata(struct mbuf *m, struc
tcp_trace(TA_INPUT, ostate, tp,
  (void *)tcp_saveipgen, _savetcp, 0);
 #endif
+   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
/*
 * Automatic sizing of receive socket buffer.  Often the send
 * buffer size is not optimally adjusted to the actual network
@@ -1695,7 +1697,7 @@ dropafterack:
tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen,
  _savetcp, 0);
 #endif
-   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__drop, tp, th, mtod(m, const char *));
if (ti_locked == TI_RLOCKED) {
INP_INFO_RUNLOCK(_tcbinfo);
}
@@ -1738,7 +1740,7 @@ drop:
tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen,
  _savetcp, 0);
 #endif
-   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__drop, tp, th, mtod(m, const char *));
if (tp != NULL)
INP_WUNLOCK(tp->t_inpcb);
m_freem(m);
@@ -2134,7 +2136,6 @@ tcp_fastack(struct mbuf *m, struct tcphd
 
tp->snd_una = th->th_ack;
tp->t_dupacks = 0;
-   m_freem(m);
 
/*
 * If all outstanding data are acked, stop
@@ -2151,6 +2152,8 @@ tcp_fastack(struct mbuf *m, struct tcphd
  (void *)tcp_saveipgen,
  _savetcp, 0);
 #endif
+   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   m_freem(m);
if (tp->snd_una == tp->snd_max)
tcp_timer_activate(tp, TT_REXMT, 0);
else if (!tcp_timer_active(tp, TT_PERSIST))

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Thu Mar  3 15:36:00 2016(r296351)
+++ head/sys/netinet/tcp_subr.c Thu Mar  3 17:46:38 2016(r296352)
@@ -1026,7 +1026,7 @@ tcp_respond(struct tcpcb *tp, void *ipge
if (tp == NULL || (inp->inp_socket->so_options & SO_DEBUG))
tcp_trace(TA_OUTPUT, 0, tp, mtod(m, void *), th, 0);
 #endif
-   TCP_PROBE3(debug__input, tp, th, mtod(m, const char *));
+   TCP_PROBE3(debug__output, tp, th, mtod(m, const char *));
if (flags & TH_RST)
TCP_PROBE5(accept__refused, NULL, NULL, mtod(m, const char *),
tp, nth);

Modified: head/sys/netinet/tcp_usrreq.c
==
--- head/sys/netinet/tcp_usrreq.c   Thu Mar  3 15:36:00 2016
(r296351)
+++ head/sys/netinet/tcp_usrreq.c   Thu Mar  3 

svn commit: r296335 - in head: cddl/lib/libdtrace share/dtrace

2016-03-02 Thread George V. Neville-Neil
Author: gnn
Date: Thu Mar  3 02:46:12 2016
New Revision: 296335
URL: https://svnweb.freebsd.org/changeset/base/296335

Log:
  fix tcpdebug: - assign to "flags" in each probe, not only debug-input
  compute "len" in the same way in each probe
  
  Submitted by: Hannes Mehnert
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D5524

Modified:
  head/cddl/lib/libdtrace/tcp.d
  head/share/dtrace/Makefile
  head/share/dtrace/tcpdebug

Modified: head/cddl/lib/libdtrace/tcp.d
==
--- head/cddl/lib/libdtrace/tcp.d   Thu Mar  3 01:43:36 2016
(r296334)
+++ head/cddl/lib/libdtrace/tcp.d   Thu Mar  3 02:46:12 2016
(r296335)
@@ -102,6 +102,7 @@ typedef struct tcpsinfo {
string tcps_raddr;  /* remote address, as a string */
int32_t tcps_state; /* TCP state */
uint32_t tcps_iss;  /* Initial sequence # sent */
+   uint32_t tcps_irs;  /* Initial sequence # received */
uint32_t tcps_suna; /* sequence # sent but unacked */
uint32_t tcps_smax; /* highest sequence number sent */
uint32_t tcps_snxt; /* next sequence # to send */
@@ -112,10 +113,12 @@ typedef struct tcpsinfo {
uint32_t tcps_swl1; /* window update seg seq number */
uint32_t tcps_swl2; /* window update seg ack number */
uint32_t tcps_rup;  /* receive urgent pointer */
+   uint32_t tcps_radv; /* advertised window */
uint32_t tcps_rwnd; /* receive window size */
int32_t tcps_rcv_ws;/* receive window scaling */
uint32_t tcps_cwnd; /* congestion window */
uint32_t tcps_cwnd_ssthresh;/* threshold for congestion avoidance */
+   uint32_t tcps_srecover; /* for use in NewReno Fast Recovery */
uint32_t tcps_sack_fack;/* SACK sequence # we have acked */
uint32_t tcps_sack_snxt;/* next SACK seq # for retransmission */
uint32_t tcps_rto;  /* round-trip timeout, msec */
@@ -123,6 +126,10 @@ typedef struct tcpsinfo {
int tcps_retransmit;/* retransmit send event, boolean */
int tcps_srtt;  /* smoothed RTT in units of 
(TCP_RTT_SCALE*hz) */
int tcps_debug; /* socket has SO_DEBUG set */
+   int32_t tcps_dupacks;   /* consecutive dup acks received */
+   uint32_t tcps_rtttime;  /* RTT measurement start time */
+   uint32_t tcps_rtseq;/* sequence # being timed */
+   uint32_t tcps_ts_recent;/* timestamp echo data */
 } tcpsinfo_t;
 
 /*
@@ -192,6 +199,7 @@ translator tcpsinfo_t < struct tcpcb *p 
inet_ntoa6(>t_inpcb->inp_inc.inc_ie.ie_dependfaddr.ie6_foreign);
tcps_state =p == NULL ? -1 : p->t_state;
tcps_iss =  p == NULL ? 0  : p->iss;
+   tcps_irs =  p == NULL ? 0  : p->irs;
tcps_suna = p == NULL ? 0  : p->snd_una;
tcps_smax = p == NULL ? 0  : p->snd_max;
tcps_snxt = p == NULL ? 0  : p->snd_nxt;
@@ -201,11 +209,13 @@ translator tcpsinfo_t < struct tcpcb *p 
tcps_snd_ws =   p == NULL ? -1  : p->snd_scale;
tcps_swl1 = p == NULL ? -1  : p->snd_wl1;
tcps_swl2 = p == NULL ? -1  : p->snd_wl2;
+   tcps_radv = p == NULL ? -1  : p->rcv_adv;
tcps_rwnd = p == NULL ? -1  : p->rcv_wnd;
tcps_rup =  p == NULL ? -1  : p->rcv_up;
tcps_rcv_ws =   p == NULL ? -1  : p->rcv_scale;
tcps_cwnd = p == NULL ? -1  : p->snd_cwnd;
tcps_cwnd_ssthresh =p == NULL ? -1  : p->snd_ssthresh;
+   tcps_srecover = p == NULL ? -1  : p->snd_recover;
tcps_sack_fack =p == NULL ? 0  : p->snd_fack;
tcps_sack_snxt =p == NULL ? 0  : p->sack_newdata;
tcps_rto =  p == NULL ? -1 : (p->t_rxtcur * 1000) / `hz;
@@ -214,6 +224,10 @@ translator tcpsinfo_t < struct tcpcb *p 
tcps_srtt = p == NULL ? -1  : p->t_srtt;   /* smoothed RTT 
in units of (TCP_RTT_SCALE*hz) */
tcps_debug =p == NULL ? 0 :
p->t_inpcb->inp_socket->so_options & 1;
+   tcps_dupacks =  p == NULL ? -1  : p->t_dupacks;
+   tcps_rtttime =  p == NULL ? -1  : p->t_rtttime;
+   tcps_rtseq =p == NULL ? -1  : p->t_rtseq;
+   tcps_ts_recent =p == NULL ? -1  : p->ts_recent;
 };
 
 #pragma D binding "1.6.3" translator

Modified: head/share/dtrace/Makefile
==
--- head/share/dtrace/Makefile  Thu Mar  3 01:43:36 2016(r296334)
+++ head/share/dtrace/Makefile  Thu Mar  3 02:46:12 2016(r296335)
@@ 

svn commit: r295896 - in stable/10: share/man/man4 sys/net sys/netinet

2016-02-22 Thread George V. Neville-Neil
Author: gnn
Date: Mon Feb 22 19:17:59 2016
New Revision: 295896
URL: https://svnweb.freebsd.org/changeset/base/295896

Log:
  Revert 295285 which was an MFC of the tryforward work (r290383,295282,295283)
  
  In the IPFW+NAT+divergent MTU case there is a bug in sening ICMP MTU updates.
  
  Approved by:  re (marius, gjb)
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  stable/10/share/man/man4/inet.4
  stable/10/sys/net/if_arcsubr.c
  stable/10/sys/net/if_ef.c
  stable/10/sys/net/if_ethersubr.c
  stable/10/sys/net/if_fddisubr.c
  stable/10/sys/net/if_fwsubr.c
  stable/10/sys/net/if_iso88025subr.c
  stable/10/sys/netinet/in_var.h
  stable/10/sys/netinet/ip_fastfwd.c
  stable/10/sys/netinet/ip_input.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/inet.4
==
--- stable/10/share/man/man4/inet.4 Mon Feb 22 18:53:55 2016
(r295895)
+++ stable/10/share/man/man4/inet.4 Mon Feb 22 19:17:59 2016
(r295896)
@@ -32,7 +32,7 @@
 .\" From: @(#)inet.4   8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd Feb 4, 2016
+.Dd January 26, 2012
 .Dt INET 4
 .Os
 .Sh NAME
@@ -169,11 +169,33 @@ MIB.
 In addition to the variables supported by the transport protocols
 (for which the respective manual pages may be consulted),
 the following general variables are defined:
-.Bl -tag -width IPCTL_ACCEPTSOURCEROUTE
+.Bl -tag -width IPCTL_FASTFORWARDING
 .It Dv IPCTL_FORWARDING
 .Pq ip.forwarding
 Boolean: enable/disable forwarding of IP packets.
 Defaults to off.
+.It Dv IPCTL_FASTFORWARDING
+.Pq ip.fastforwarding
+Boolean: enable/disable the use of
+.Tn fast IP forwarding
+code.
+Defaults to off.
+When
+.Tn fast IP forwarding
+is enabled, IP packets are forwarded directly to the appropriate network
+interface with direct processing to completion, which greatly improves
+the throughput.
+All packets for local IP addresses, non-unicast, or with IP options are
+handled by the normal IP input processing path.
+All features of the normal (slow) IP forwarding path are supported
+including firewall (through
+.Xr pfil 9
+hooks) checking, except
+.Xr ipsec 4
+tunnel brokering.
+The
+.Tn IP fastforwarding
+path does not generate ICMP redirect or source quench messages.
 .It Dv IPCTL_SENDREDIRECTS
 .Pq ip.redirect
 Boolean: enable/disable sending of ICMP redirects in response to

Modified: stable/10/sys/net/if_arcsubr.c
==
--- stable/10/sys/net/if_arcsubr.c  Mon Feb 22 18:53:55 2016
(r295895)
+++ stable/10/sys/net/if_arcsubr.c  Mon Feb 22 19:17:59 2016
(r295896)
@@ -557,11 +557,15 @@ arc_input(struct ifnet *ifp, struct mbuf
 #ifdef INET
case ARCTYPE_IP:
m_adj(m, ARC_HDRNEWLEN);
+   if ((m = ip_fastforward(m)) == NULL)
+   return;
isr = NETISR_IP;
break;
 
case ARCTYPE_IP_OLD:
m_adj(m, ARC_HDRLEN);
+   if ((m = ip_fastforward(m)) == NULL)
+   return;
isr = NETISR_IP;
break;
 

Modified: stable/10/sys/net/if_ef.c
==
--- stable/10/sys/net/if_ef.c   Mon Feb 22 18:53:55 2016(r295895)
+++ stable/10/sys/net/if_ef.c   Mon Feb 22 19:17:59 2016(r295896)
@@ -240,6 +240,8 @@ ef_inputEII(struct mbuf *m, struct ether
 #endif
 #ifdef INET
case ETHERTYPE_IP:
+   if ((m = ip_fastforward(m)) == NULL)
+   return (0);
isr = NETISR_IP;
break;
 

Modified: stable/10/sys/net/if_ethersubr.c
==
--- stable/10/sys/net/if_ethersubr.cMon Feb 22 18:53:55 2016
(r295895)
+++ stable/10/sys/net/if_ethersubr.cMon Feb 22 19:17:59 2016
(r295896)
@@ -784,6 +784,8 @@ ether_demux(struct ifnet *ifp, struct mb
switch (ether_type) {
 #ifdef INET
case ETHERTYPE_IP:
+   if ((m = ip_fastforward(m)) == NULL)
+   return;
isr = NETISR_IP;
break;
 

Modified: stable/10/sys/net/if_fddisubr.c
==
--- stable/10/sys/net/if_fddisubr.c Mon Feb 22 18:53:55 2016
(r295895)
+++ stable/10/sys/net/if_fddisubr.c Mon Feb 22 19:17:59 2016
(r295896)
@@ -501,6 +501,8 @@ fddi_input(ifp, m)
switch (type) {
 #ifdef INET
case ETHERTYPE_IP:
+   if ((m = ip_fastforward(m)) == NULL)
+   return;
isr = NETISR_IP;
break;
 

Modified: stable/10/sys/net/if_fwsubr.c

svn commit: r295763 - svnadmin/conf

2016-02-18 Thread George V. Neville-Neil
Author: gnn
Date: Thu Feb 18 17:09:55 2016
New Revision: 295763
URL: https://svnweb.freebsd.org/changeset/base/295763

Log:
  Free Eric Joyner from mentorship.

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Thu Feb 18 15:44:45 2016(r295762)
+++ svnadmin/conf/mentors   Thu Feb 18 17:09:55 2016(r295763)
@@ -19,7 +19,6 @@ benl  philip  Co-mentor: simon
 carl   jimharris
 cherry gibbs
 erignn Co-mentor: thompsa
-erjgnn Co-mentor: jfv
 jceel  trasz
 jkhrwatson
 jonathan   rwatson
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-02-04 Thread George V. Neville-Neil
Author: gnn
Date: Thu Feb  4 21:46:37 2016
New Revision: 295283
URL: https://svnweb.freebsd.org/changeset/base/295283

Log:
  Summary: Update the date

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

Modified: head/share/man/man4/inet.4
==
--- head/share/man/man4/inet.4  Thu Feb  4 21:39:58 2016(r295282)
+++ head/share/man/man4/inet.4  Thu Feb  4 21:46:37 2016(r295283)
@@ -28,7 +28,7 @@
 .\" From: @(#)inet.4   8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd April 7, 2015
+.Dd Feb 4, 2016
 .Dt INET 4
 .Os
 .Sh NAME
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-02-04 Thread George V. Neville-Neil
Author: gnn
Date: Thu Feb  4 21:39:58 2016
New Revision: 295282
URL: https://svnweb.freebsd.org/changeset/base/295282

Log:
  Summary: Remove discussion of fastforwarding.

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

Modified: head/share/man/man4/inet.4
==
--- head/share/man/man4/inet.4  Thu Feb  4 21:27:03 2016(r295281)
+++ head/share/man/man4/inet.4  Thu Feb  4 21:39:58 2016(r295282)
@@ -164,33 +164,11 @@ MIB.
 In addition to the variables supported by the transport protocols
 (for which the respective manual pages may be consulted),
 the following general variables are defined:
-.Bl -tag -width IPCTL_FASTFORWARDING
+.Bl -tag -width IPCTL_ACCEPTSOURCEROUTE
 .It Dv IPCTL_FORWARDING
 .Pq ip.forwarding
 Boolean: enable/disable forwarding of IP packets.
 Defaults to off.
-.It Dv IPCTL_FASTFORWARDING
-.Pq ip.fastforwarding
-Boolean: enable/disable the use of
-.Tn fast IP forwarding
-code.
-Defaults to off.
-When
-.Tn fast IP forwarding
-is enabled, IP packets are forwarded directly to the appropriate network
-interface with direct processing to completion, which greatly improves
-the throughput.
-All packets for local IP addresses, non-unicast, or with IP options are
-handled by the normal IP input processing path.
-All features of the normal (slow) IP forwarding path are supported
-including firewall (through
-.Xr pfil 9
-hooks) checking, except
-.Xr ipsec 4
-tunnel brokering.
-The
-.Tn IP fastforwarding
-path does not generate ICMP redirect or source quench messages.
 .It Dv IPCTL_SENDREDIRECTS
 .Pq ip.redirect
 Boolean: enable/disable sending of ICMP redirects in response to
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r295285 - in stable/10: share/man/man4 sys/net sys/netinet

2016-02-04 Thread George V. Neville-Neil
Author: gnn
Date: Thu Feb  4 22:53:12 2016
New Revision: 295285
URL: https://svnweb.freebsd.org/changeset/base/295285

Log:
  MFC: r290383,295282,295283
  
  Replace the fastforward path with tryforward which does not require a
  sysctl and will always be on. The former split between default and
  fast forwarding is removed by this commit while preserving the ability
  to use all network stack features.
  
  Differential Revision:https://reviews.freebsd.org/D4042
  Reviewed by:  ae, melifaro, olivier, rwatson
  Approved by:  re (glebius)
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  stable/10/share/man/man4/inet.4
  stable/10/sys/net/if_arcsubr.c
  stable/10/sys/net/if_ef.c
  stable/10/sys/net/if_ethersubr.c
  stable/10/sys/net/if_fddisubr.c
  stable/10/sys/net/if_fwsubr.c
  stable/10/sys/net/if_iso88025subr.c
  stable/10/sys/netinet/in_var.h
  stable/10/sys/netinet/ip_fastfwd.c
  stable/10/sys/netinet/ip_input.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/inet.4
==
--- stable/10/share/man/man4/inet.4 Thu Feb  4 22:39:27 2016
(r295284)
+++ stable/10/share/man/man4/inet.4 Thu Feb  4 22:53:12 2016
(r295285)
@@ -32,7 +32,7 @@
 .\" From: @(#)inet.4   8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd January 26, 2012
+.Dd Feb 4, 2016
 .Dt INET 4
 .Os
 .Sh NAME
@@ -169,33 +169,11 @@ MIB.
 In addition to the variables supported by the transport protocols
 (for which the respective manual pages may be consulted),
 the following general variables are defined:
-.Bl -tag -width IPCTL_FASTFORWARDING
+.Bl -tag -width IPCTL_ACCEPTSOURCEROUTE
 .It Dv IPCTL_FORWARDING
 .Pq ip.forwarding
 Boolean: enable/disable forwarding of IP packets.
 Defaults to off.
-.It Dv IPCTL_FASTFORWARDING
-.Pq ip.fastforwarding
-Boolean: enable/disable the use of
-.Tn fast IP forwarding
-code.
-Defaults to off.
-When
-.Tn fast IP forwarding
-is enabled, IP packets are forwarded directly to the appropriate network
-interface with direct processing to completion, which greatly improves
-the throughput.
-All packets for local IP addresses, non-unicast, or with IP options are
-handled by the normal IP input processing path.
-All features of the normal (slow) IP forwarding path are supported
-including firewall (through
-.Xr pfil 9
-hooks) checking, except
-.Xr ipsec 4
-tunnel brokering.
-The
-.Tn IP fastforwarding
-path does not generate ICMP redirect or source quench messages.
 .It Dv IPCTL_SENDREDIRECTS
 .Pq ip.redirect
 Boolean: enable/disable sending of ICMP redirects in response to

Modified: stable/10/sys/net/if_arcsubr.c
==
--- stable/10/sys/net/if_arcsubr.c  Thu Feb  4 22:39:27 2016
(r295284)
+++ stable/10/sys/net/if_arcsubr.c  Thu Feb  4 22:53:12 2016
(r295285)
@@ -557,15 +557,11 @@ arc_input(struct ifnet *ifp, struct mbuf
 #ifdef INET
case ARCTYPE_IP:
m_adj(m, ARC_HDRNEWLEN);
-   if ((m = ip_fastforward(m)) == NULL)
-   return;
isr = NETISR_IP;
break;
 
case ARCTYPE_IP_OLD:
m_adj(m, ARC_HDRLEN);
-   if ((m = ip_fastforward(m)) == NULL)
-   return;
isr = NETISR_IP;
break;
 

Modified: stable/10/sys/net/if_ef.c
==
--- stable/10/sys/net/if_ef.c   Thu Feb  4 22:39:27 2016(r295284)
+++ stable/10/sys/net/if_ef.c   Thu Feb  4 22:53:12 2016(r295285)
@@ -240,8 +240,6 @@ ef_inputEII(struct mbuf *m, struct ether
 #endif
 #ifdef INET
case ETHERTYPE_IP:
-   if ((m = ip_fastforward(m)) == NULL)
-   return (0);
isr = NETISR_IP;
break;
 

Modified: stable/10/sys/net/if_ethersubr.c
==
--- stable/10/sys/net/if_ethersubr.cThu Feb  4 22:39:27 2016
(r295284)
+++ stable/10/sys/net/if_ethersubr.cThu Feb  4 22:53:12 2016
(r295285)
@@ -784,8 +784,6 @@ ether_demux(struct ifnet *ifp, struct mb
switch (ether_type) {
 #ifdef INET
case ETHERTYPE_IP:
-   if ((m = ip_fastforward(m)) == NULL)
-   return;
isr = NETISR_IP;
break;
 

Modified: stable/10/sys/net/if_fddisubr.c
==
--- stable/10/sys/net/if_fddisubr.c Thu Feb  4 22:39:27 2016
(r295284)
+++ stable/10/sys/net/if_fddisubr.c Thu Feb  4 22:53:12 2016
(r295285)
@@ -501,8 +501,6 @@ fddi_input(ifp, m)
switch (type) {
 #ifdef INET
case ETHERTYPE_IP:
-   if ((m = ip_fastforward(m)) == NULL)
-  

svn commit: r294294 - stable/10/usr.sbin/bhyve

2016-01-18 Thread George V. Neville-Neil
Author: gnn
Date: Mon Jan 18 21:24:28 2016
New Revision: 294294
URL: https://svnweb.freebsd.org/changeset/base/294294

Log:
  MFC: 293459,293643
  
  Add netmap support for bhyve

Modified:
  stable/10/usr.sbin/bhyve/pci_virtio_net.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bhyve/pci_virtio_net.c
==
--- stable/10/usr.sbin/bhyve/pci_virtio_net.c   Mon Jan 18 20:47:04 2016
(r294293)
+++ stable/10/usr.sbin/bhyve/pci_virtio_net.c   Mon Jan 18 21:24:28 2016
(r294294)
@@ -36,6 +36,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifndef NETMAP_WITH_LIBS
+#define NETMAP_WITH_LIBS
+#endif
+#include 
 
 #include 
 #include 
@@ -133,6 +137,8 @@ struct pci_vtnet_softc {
struct mevent   *vsc_mevp;
 
int vsc_tapfd;
+   struct nm_desc  *vsc_nmd;
+
int vsc_rx_ready;
volatile intresetting;  /* set and checked outside lock */
 
@@ -149,6 +155,10 @@ struct pci_vtnet_softc {
pthread_mutex_t tx_mtx;
pthread_cond_t  tx_cond;
int tx_in_progress;
+
+   void (*pci_vtnet_rx)(struct pci_vtnet_softc *sc);
+   void (*pci_vtnet_tx)(struct pci_vtnet_softc *sc, struct iovec *iov,
+int iovcnt, int len);
 };
 
 static void pci_vtnet_reset(void *);
@@ -371,14 +381,208 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc 
vq_endchains(vq, 1);
 }
 
+static int
+pci_vtnet_netmap_writev(struct nm_desc *nmd, struct iovec *iov, int iovcnt)
+{
+   int r, i;
+   int len = 0;
+
+   for (r = nmd->cur_tx_ring; ; ) {
+   struct netmap_ring *ring = NETMAP_TXRING(nmd->nifp, r);
+   uint32_t cur, idx;
+   char *buf;
+
+   if (nm_ring_empty(ring)) {
+   r++;
+   if (r > nmd->last_tx_ring)
+   r = nmd->first_tx_ring;
+   if (r == nmd->cur_rx_ring)
+   break;
+   continue;
+   }
+   cur = ring->cur;
+   idx = ring->slot[cur].buf_idx;
+   buf = NETMAP_BUF(ring, idx);
+
+   for (i = 0; i < iovcnt; i++) {
+   memcpy([len], iov[i].iov_base, iov[i].iov_len);
+   len += iov[i].iov_len;
+   }
+   ring->slot[cur].len = len;
+   ring->head = ring->cur = nm_ring_next(ring, cur);
+   nmd->cur_tx_ring = r;
+   ioctl(nmd->fd, NIOCTXSYNC, NULL);
+   break;
+   }
+
+   return (len);
+}
+
+static inline int
+pci_vtnet_netmap_readv(struct nm_desc *nmd, struct iovec *iov, int iovcnt)
+{
+   int len = 0;
+   int i = 0;
+   int r;
+
+   for (r = nmd->cur_rx_ring; ; ) {
+   struct netmap_ring *ring = NETMAP_RXRING(nmd->nifp, r);
+   uint32_t cur, idx;
+   char *buf;
+   size_t left;
+
+   if (nm_ring_empty(ring)) {
+   r++;
+   if (r > nmd->last_rx_ring)
+   r = nmd->first_rx_ring;
+   if (r == nmd->cur_rx_ring)
+   break;
+   continue;
+   }
+   cur = ring->cur;
+   idx = ring->slot[cur].buf_idx;
+   buf = NETMAP_BUF(ring, idx);
+   left = ring->slot[cur].len;
+
+   for (i = 0; i < iovcnt && left > 0; i++) {
+   if (iov[i].iov_len > left)
+   iov[i].iov_len = left;
+   memcpy(iov[i].iov_base, [len], iov[i].iov_len);
+   len += iov[i].iov_len;
+   left -= iov[i].iov_len;
+   }
+   ring->head = ring->cur = nm_ring_next(ring, cur);
+   nmd->cur_rx_ring = r;
+   ioctl(nmd->fd, NIOCRXSYNC, NULL);
+   break;
+   }
+   for (; i < iovcnt; i++)
+   iov[i].iov_len = 0;
+
+   return (len);
+}
+
+/*
+ * Called to send a buffer chain out to the vale port
+ */
+static void
+pci_vtnet_netmap_tx(struct pci_vtnet_softc *sc, struct iovec *iov, int iovcnt,
+   int len)
+{
+   static char pad[60]; /* all zero bytes */
+
+   if (sc->vsc_nmd == NULL)
+   return;
+
+   /*
+* If the length is < 60, pad out to that and add the
+* extra zero'd segment to the iov. It is guaranteed that
+* there is always an extra iov available by the caller.
+*/
+   if (len < 60) {
+   iov[iovcnt].iov_base = pad;
+   iov[iovcnt].iov_len = 60 - len;
+   iovcnt++;
+   }
+   (void) pci_vtnet_netmap_writev(sc->vsc_nmd, iov, iovcnt);
+}
+
+static void
+pci_vtnet_netmap_rx(struct 

svn commit: r293459 - head/usr.sbin/bhyve

2016-01-08 Thread George V. Neville-Neil
Author: gnn
Date: Sat Jan  9 03:08:21 2016
New Revision: 293459
URL: https://svnweb.freebsd.org/changeset/base/293459

Log:
  Add netmap support for bhyve
  
  Submitted by: btw
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D4826

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

Modified: head/usr.sbin/bhyve/pci_virtio_net.c
==
--- head/usr.sbin/bhyve/pci_virtio_net.cSat Jan  9 01:56:46 2016
(r293458)
+++ head/usr.sbin/bhyve/pci_virtio_net.cSat Jan  9 03:08:21 2016
(r293459)
@@ -36,6 +36,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifndef NETMAP_WITH_LIBS
+#define NETMAP_WITH_LIBS
+#endif
+#include 
 
 #include 
 #include 
@@ -133,6 +137,8 @@ struct pci_vtnet_softc {
struct mevent   *vsc_mevp;
 
int vsc_tapfd;
+   struct nm_desc  *vsc_nmd;
+
int vsc_rx_ready;
volatile intresetting;  /* set and checked outside lock */
 
@@ -149,6 +155,10 @@ struct pci_vtnet_softc {
pthread_mutex_t tx_mtx;
pthread_cond_t  tx_cond;
int tx_in_progress;
+
+   void (*pci_vtnet_rx)(struct pci_vtnet_softc *sc);
+   void (*pci_vtnet_tx)(struct pci_vtnet_softc *sc, struct iovec *iov,
+int iovcnt, int len);
 };
 
 static void pci_vtnet_reset(void *);
@@ -371,14 +381,208 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc 
vq_endchains(vq, 1);
 }
 
+static int
+pci_vtnet_netmap_writev(struct nm_desc *nmd, struct iovec *iov, int iovcnt)
+{
+   int r, i;
+   int len = 0;
+
+   for (r = nmd->cur_tx_ring; ; ) {
+   struct netmap_ring *ring = NETMAP_TXRING(nmd->nifp, r);
+   uint32_t cur, idx;
+   char *buf;
+
+   if (nm_ring_empty(ring)) {
+   r++;
+   if (r > nmd->last_tx_ring)
+   r = nmd->first_tx_ring;
+   if (r == nmd->cur_rx_ring)
+   break;
+   continue;
+   }
+   cur = ring->cur;
+   idx = ring->slot[cur].buf_idx;
+   buf = NETMAP_BUF(ring, idx);
+
+   for (i = 0; i < iovcnt; i++) {
+   memcpy([len], iov[i].iov_base, iov[i].iov_len);
+   len += iov[i].iov_len;
+   }
+   ring->slot[cur].len = len;
+   ring->head = ring->cur = nm_ring_next(ring, cur);
+   nmd->cur_tx_ring = r;
+   ioctl(nmd->fd, NIOCTXSYNC, NULL);
+   break;
+   }
+
+   return (len);
+}
+
+static inline int
+pci_vtnet_netmap_readv(struct nm_desc *nmd, struct iovec *iov, int iovcnt)
+{
+   int len = 0;
+   int i = 0;
+   int r;
+
+   for (r = nmd->cur_rx_ring; ; ) {
+   struct netmap_ring *ring = NETMAP_RXRING(nmd->nifp, r);
+   uint32_t cur, idx;
+   char *buf;
+   size_t left;
+
+   if (nm_ring_empty(ring)) {
+   r++;
+   if (r > nmd->last_rx_ring)
+   r = nmd->first_rx_ring;
+   if (r == nmd->cur_rx_ring)
+   break;
+   continue;
+   }
+   cur = ring->cur;
+   idx = ring->slot[cur].buf_idx;
+   buf = NETMAP_BUF(ring, idx);
+   left = ring->slot[cur].len;
+
+   for (i = 0; i < iovcnt && left > 0; i++) {
+   if (iov[i].iov_len > left)
+   iov[i].iov_len = left;
+   memcpy(iov[i].iov_base, [len], iov[i].iov_len);
+   len += iov[i].iov_len;
+   left -= iov[i].iov_len;
+   }
+   ring->head = ring->cur = nm_ring_next(ring, cur);
+   nmd->cur_rx_ring = r;
+   ioctl(nmd->fd, NIOCRXSYNC, NULL);
+   break;
+   }
+   for (; i < iovcnt; i++)
+   iov[i].iov_len = 0;
+
+   return (len);
+}
+
+/*
+ * Called to send a buffer chain out to the vale port
+ */
+static void
+pci_vtnet_netmap_tx(struct pci_vtnet_softc *sc, struct iovec *iov, int iovcnt,
+   int len)
+{
+   static char pad[60]; /* all zero bytes */
+
+   if (sc->vsc_nmd == NULL)
+   return;
+
+   /*
+* If the length is < 60, pad out to that and add the
+* extra zero'd segment to the iov. It is guaranteed that
+* there is always an extra iov available by the caller.
+*/
+   if (len < 60) {
+   iov[iovcnt].iov_base = pad;
+   iov[iovcnt].iov_len = 60 - len;
+   iovcnt++;
+   }
+   (void) pci_vtnet_netmap_writev(sc->vsc_nmd, iov, iovcnt);
+}
+
+static void

svn commit: r293385 - svnadmin/conf

2016-01-07 Thread George V. Neville-Neil
Author: gnn
Date: Thu Jan  7 22:45:50 2016
New Revision: 293385
URL: https://svnweb.freebsd.org/changeset/base/293385

Log:
  Remove myself from the size limit override pool.

Modified:
  svnadmin/conf/sizelimit.conf

Modified: svnadmin/conf/sizelimit.conf
==
--- svnadmin/conf/sizelimit.confThu Jan  7 22:44:58 2016
(r293384)
+++ svnadmin/conf/sizelimit.confThu Jan  7 22:45:50 2016
(r293385)
@@ -20,7 +20,6 @@ brooks
 davidcs
 des
 dim
-gnn
 gonzo
 imp
 jb
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r292394 - head/usr.bin/netstat

2015-12-16 Thread George V. Neville-Neil
Author: gnn
Date: Thu Dec 17 02:02:09 2015
New Revision: 292394
URL: https://svnweb.freebsd.org/changeset/base/292394

Log:
  Switch the IPsec related statistics to using the built in sysctl
  variable set rather than reading from kernel memory.
  This also makes the -z (zero) flag work correctly
  
  MFC after:1 week
  Sponsored by: Rubicon Communications, LLC (Netgate)
  Differential Revision:https://reviews.freebsd.org/D4591

Modified:
  head/usr.bin/netstat/ipsec.c
  head/usr.bin/netstat/main.c

Modified: head/usr.bin/netstat/ipsec.c
==
--- head/usr.bin/netstat/ipsec.cThu Dec 17 01:33:45 2015
(r292393)
+++ head/usr.bin/netstat/ipsec.cThu Dec 17 02:02:09 2015
(r292394)
@@ -216,10 +216,17 @@ ipsec_stats(u_long off, const char *name
 {
struct ipsecstat ipsecstat;
 
-   if (off == 0)
-   return;
+   if (strcmp(name, "ipsec6") == 0) {
+   if (fetch_stats("net.inet6.ipsec6.ipsecstats", off,,
+   sizeof(ipsecstat), kread_counters) != 0)
+   return;
+   } else {
+   if (fetch_stats("net.inet.ipsec.ipsecstats", off, ,
+   sizeof(ipsecstat), kread_counters) != 0)
+   return;
+   }
+
xo_emit("{T:/%s}:\n", name);
-   kread_counters(off, (char *), sizeof(ipsecstat));
 
print_ipsecstats();
 }
@@ -318,10 +325,11 @@ ah_stats(u_long off, const char *name, i
 {
struct ahstat ahstat;
 
-   if (off == 0)
+   if (fetch_stats("net.inet.ah.stats", off, ,
+   sizeof(ahstat), kread_counters) != 0)
return;
+
xo_emit("{T:/%s}:\n", name);
-   kread_counters(off, (char *), sizeof(ahstat));
 
print_ahstats();
 }
@@ -377,10 +385,11 @@ esp_stats(u_long off, const char *name, 
 {
struct espstat espstat;
 
-   if (off == 0)
+   if (fetch_stats("net.inet.esp.stats", off, ,
+   sizeof(espstat), kread_counters) != 0)
return;
+
xo_emit("{T:/%s}:\n", name);
-   kread_counters(off, (char *), sizeof(espstat));
 
print_espstats();
 }
@@ -434,10 +443,11 @@ ipcomp_stats(u_long off, const char *nam
 {
struct ipcompstat ipcompstat;
 
-   if (off == 0)
+   if (fetch_stats("net.inet.ipcomp.stats", off, ,
+   sizeof(ipcompstat), kread_counters) != 0)
return;
+
xo_emit("{T:/%s}:\n", name);
-   kread_counters(off, (char *), sizeof(ipcompstat));
 
print_ipcompstats();
 }

Modified: head/usr.bin/netstat/main.c
==
--- head/usr.bin/netstat/main.c Thu Dec 17 01:33:45 2015(r292393)
+++ head/usr.bin/netstat/main.c Thu Dec 17 02:02:09 2015(r292394)
@@ -108,13 +108,13 @@ static struct protox {
  igmp_stats,   NULL,   "igmp", 1,  IPPROTO_IGMP },
 #ifdef IPSEC
{ -1,   N_IPSEC4STAT,   1,  NULL,   /* keep as compat */
- ipsec_stats,  NULL,   "ipsec", 0, 0},
+ ipsec_stats,  NULL,   "ipsec", 1, 0},
{ -1,   N_AHSTAT,   1,  NULL,
- ah_stats, NULL,   "ah",   0,  0},
+ ah_stats, NULL,   "ah",   1,  0},
{ -1,   N_ESPSTAT,  1,  NULL,
- esp_stats,NULL,   "esp",  0,  0},
+ esp_stats,NULL,   "esp",  1,  0},
{ -1,   N_IPCOMPSTAT,   1,  NULL,
- ipcomp_stats, NULL,   "ipcomp", 0,0},
+ ipcomp_stats, NULL,   "ipcomp", 1,0},
 #endif
{ N_RIPCBINFO,  N_PIMSTAT,  1,  protopr,
  pim_stats,NULL,   "pim",  1,  IPPROTO_PIM },
@@ -146,7 +146,7 @@ static struct protox ip6protox[] = {
 #endif
 #ifdef IPSEC
{ -1,   N_IPSEC6STAT,   1,  NULL,
- ipsec_stats,  NULL,   "ipsec6", 0,0 },
+ ipsec_stats,  NULL,   "ipsec6", 1,0 },
 #endif
 #ifdef notyet
{ -1,   N_PIM6STAT, 1,  NULL,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r291865 - svnadmin/conf

2015-12-05 Thread George V. Neville-Neil
Author: gnn
Date: Sat Dec  5 19:12:16 2015
New Revision: 291865
URL: https://svnweb.freebsd.org/changeset/base/291865

Log:
  Free Jonathan T. Looney (jtl@) from mentorship.

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Sat Dec  5 18:56:21 2015(r291864)
+++ svnadmin/conf/mentors   Sat Dec  5 19:12:16 2015(r291865)
@@ -23,7 +23,6 @@ erj   gnn Co-mentor: jfv
 jceel  wkoszek Co-mentor: cognet
 jkhrwatson
 jonathan   rwatson
-jtlgnn
 jwdrmacklem
 kadesaiken Co-mentor: scottl, ambrisko
 mahrensmckusick
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r291344 - head/share/dtrace

2015-11-25 Thread George V. Neville-Neil
Author: gnn
Date: Thu Nov 26 00:53:39 2015
New Revision: 291344
URL: https://svnweb.freebsd.org/changeset/base/291344

Log:
  Replace the retval.sh shell script with a native DTrace script.
  
  Suggested by: markj

Added:
  head/share/dtrace/retval   (contents, props changed)
Deleted:
  head/share/dtrace/retval.sh

Added: head/share/dtrace/retval
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/dtrace/retvalThu Nov 26 00:53:39 2015(r291344)
@@ -0,0 +1,42 @@
+#!/usr/sbin/dtrace -s
+/*-
+ * Copyright (c) 2015 George V. Neville-Neil <g...@neville-neil.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ * retval - show the return value of any probe named by the user
+ *
+ * USAGE:  retval name
+ *
+ * The name can be a full function name or a wild card name.  The
+ * caller is responsible for handling the escaping of wild cards.
+ */
+
+#pragma D option quiet
+
+fbt::$1:return {
+   printf("%s %d\n", probefunc, arg1);
+}
+
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r291341 - head/share/dtrace

2015-11-25 Thread George V. Neville-Neil
Author: gnn
Date: Wed Nov 25 22:59:41 2015
New Revision: 291341
URL: https://svnweb.freebsd.org/changeset/base/291341

Log:
  Summary: A simple script to print the return value of any function,
  with or without wild cards.

Added:
  head/share/dtrace/retval.sh   (contents, props changed)

Added: head/share/dtrace/retval.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/dtrace/retval.sh Wed Nov 25 22:59:41 2015(r291341)
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# Copyright (c) 2015 George V. Neville-Neil <g...@freebsd.org>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+# retval.sh - show the return value of any probe named by the user
+#
+# USAGE:   retval.sh name
+#
+# The name can be a full function name or a wild card name.  The
+# caller is responsible for handling the escaping of wild cards.
+#
+/usr/sbin/dtrace -n '
+
+#pragma D option quiet
+
+:::'$1':return {
+   printf("%s %d\n", probefunc, arg1);
+}
+'
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r291355 - in stable/10/sys: netinet netipsec

2015-11-25 Thread George V. Neville-Neil
Author: gnn
Date: Thu Nov 26 02:24:45 2015
New Revision: 291355
URL: https://svnweb.freebsd.org/changeset/base/291355

Log:
  MFC 290028:
  Turning on IPSEC used to introduce a slight amount of performance
  degradation (7%) for host host TCP connections over 10Gbps links,
  even when there were no secuirty policies in place. There is no
  change in performance on 1Gbps network links. Testing GENERIC vs.
  GENERIC-NOIPSEC vs. GENERIC with this change shows that the new
  code removes any overhead introduced by having IPSEC always in the
  kernel.
  
  Differential Revision:D3993
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  stable/10/sys/netinet/ip_ipsec.c
  stable/10/sys/netinet/tcp_subr.c
  stable/10/sys/netipsec/ipsec.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet/ip_ipsec.c
==
--- stable/10/sys/netinet/ip_ipsec.cThu Nov 26 02:16:25 2015
(r291354)
+++ stable/10/sys/netinet/ip_ipsec.cThu Nov 26 02:24:45 2015
(r291355)
@@ -230,6 +230,10 @@ ip_ipsec_output(struct mbuf **m, struct 
struct secpolicy *sp = NULL;
struct tdb_ident *tdbi;
struct m_tag *mtag;
+
+   if (!key_havesp(IPSEC_DIR_OUTBOUND))
+   return 0;
+
/*
 * Check the security policy (SP) for the packet and, if
 * required, do IPsec-related processing.  There are two

Modified: stable/10/sys/netinet/tcp_subr.c
==
--- stable/10/sys/netinet/tcp_subr.cThu Nov 26 02:16:25 2015
(r291354)
+++ stable/10/sys/netinet/tcp_subr.cThu Nov 26 02:24:45 2015
(r291355)
@@ -1947,7 +1947,8 @@ ipsec_hdrsiz_tcp(struct tcpcb *tp)
 #endif
struct tcphdr *th;
 
-   if ((tp == NULL) || ((inp = tp->t_inpcb) == NULL))
+   if ((tp == NULL) || ((inp = tp->t_inpcb) == NULL) ||
+   (!key_havesp(IPSEC_DIR_OUTBOUND)))
return (0);
m = m_gethdr(M_NOWAIT, MT_DATA);
if (!m)

Modified: stable/10/sys/netipsec/ipsec.c
==
--- stable/10/sys/netipsec/ipsec.c  Thu Nov 26 02:16:25 2015
(r291354)
+++ stable/10/sys/netipsec/ipsec.c  Thu Nov 26 02:24:45 2015
(r291355)
@@ -1273,6 +1273,9 @@ ipsec46_in_reject(struct mbuf *m, struct
int error;
int result;
 
+   if (!key_havesp(IPSEC_DIR_INBOUND))
+   return 0;
+
IPSEC_ASSERT(m != NULL, ("null mbuf"));
 
/*
@@ -1405,6 +1408,9 @@ ipsec_hdrsiz(struct mbuf *m, u_int dir, 
int error;
size_t size;
 
+   if (!key_havesp(dir))
+   return 0;
+
IPSEC_ASSERT(m != NULL, ("null mbuf"));
 
/* Get SP for this packet.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r290383 - in head/sys: net netinet

2015-11-04 Thread George V. Neville-Neil
Author: gnn
Date: Thu Nov  5 07:26:32 2015
New Revision: 290383
URL: https://svnweb.freebsd.org/changeset/base/290383

Log:
  Replace the fastforward path with tryforward which does not require a
  sysctl and will always be on. The former split between default and
  fast forwarding is removed by this commit while preserving the ability
  to use all network stack features.
  
  Differential Revision:https://reviews.freebsd.org/D4042
  Reviewed by:  ae, melifaro, olivier, rwatson
  MFC after:1 month
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  head/sys/net/if_arcsubr.c
  head/sys/net/if_ethersubr.c
  head/sys/net/if_fddisubr.c
  head/sys/net/if_fwsubr.c
  head/sys/net/if_iso88025subr.c
  head/sys/netinet/in_var.h
  head/sys/netinet/ip_fastfwd.c
  head/sys/netinet/ip_input.c

Modified: head/sys/net/if_arcsubr.c
==
--- head/sys/net/if_arcsubr.c   Thu Nov  5 04:16:03 2015(r290382)
+++ head/sys/net/if_arcsubr.c   Thu Nov  5 07:26:32 2015(r290383)
@@ -550,15 +550,11 @@ arc_input(struct ifnet *ifp, struct mbuf
 #ifdef INET
case ARCTYPE_IP:
m_adj(m, ARC_HDRNEWLEN);
-   if ((m = ip_fastforward(m)) == NULL)
-   return;
isr = NETISR_IP;
break;
 
case ARCTYPE_IP_OLD:
m_adj(m, ARC_HDRLEN);
-   if ((m = ip_fastforward(m)) == NULL)
-   return;
isr = NETISR_IP;
break;
 

Modified: head/sys/net/if_ethersubr.c
==
--- head/sys/net/if_ethersubr.c Thu Nov  5 04:16:03 2015(r290382)
+++ head/sys/net/if_ethersubr.c Thu Nov  5 07:26:32 2015(r290383)
@@ -722,8 +722,6 @@ ether_demux(struct ifnet *ifp, struct mb
switch (ether_type) {
 #ifdef INET
case ETHERTYPE_IP:
-   if ((m = ip_fastforward(m)) == NULL)
-   return;
isr = NETISR_IP;
break;
 

Modified: head/sys/net/if_fddisubr.c
==
--- head/sys/net/if_fddisubr.c  Thu Nov  5 04:16:03 2015(r290382)
+++ head/sys/net/if_fddisubr.c  Thu Nov  5 07:26:32 2015(r290383)
@@ -429,8 +429,6 @@ fddi_input(ifp, m)
switch (type) {
 #ifdef INET
case ETHERTYPE_IP:
-   if ((m = ip_fastforward(m)) == NULL)
-   return;
isr = NETISR_IP;
break;
 

Modified: head/sys/net/if_fwsubr.c
==
--- head/sys/net/if_fwsubr.cThu Nov  5 04:16:03 2015(r290382)
+++ head/sys/net/if_fwsubr.cThu Nov  5 07:26:32 2015(r290383)
@@ -605,8 +605,6 @@ firewire_input(struct ifnet *ifp, struct
switch (type) {
 #ifdef INET
case ETHERTYPE_IP:
-   if ((m = ip_fastforward(m)) == NULL)
-   return;
isr = NETISR_IP;
break;
 

Modified: head/sys/net/if_iso88025subr.c
==
--- head/sys/net/if_iso88025subr.c  Thu Nov  5 04:16:03 2015
(r290382)
+++ head/sys/net/if_iso88025subr.c  Thu Nov  5 07:26:32 2015
(r290383)
@@ -519,8 +519,6 @@ iso88025_input(ifp, m)
 #ifdef INET
case ETHERTYPE_IP:
th->iso88025_shost[0] &= ~(TR_RII); 
-   if ((m = ip_fastforward(m)) == NULL)
-   return;
isr = NETISR_IP;
break;
 

Modified: head/sys/netinet/in_var.h
==
--- head/sys/netinet/in_var.h   Thu Nov  5 04:16:03 2015(r290382)
+++ head/sys/netinet/in_var.h   Thu Nov  5 07:26:32 2015(r290383)
@@ -380,7 +380,7 @@ int in_scrubprefix(struct in_ifaddr *, u
 void   ip_input(struct mbuf *);
 void   ip_direct_input(struct mbuf *);
 void   in_ifadown(struct ifaddr *ifa, int);
-struct mbuf*ip_fastforward(struct mbuf *);
+struct mbuf*ip_tryforward(struct mbuf *);
 void   *in_domifattach(struct ifnet *);
 void   in_domifdetach(struct ifnet *, void *);
 

Modified: head/sys/netinet/ip_fastfwd.c
==
--- head/sys/netinet/ip_fastfwd.c   Thu Nov  5 04:16:03 2015
(r290382)
+++ head/sys/netinet/ip_fastfwd.c   Thu Nov  5 07:26:32 2015
(r290383)
@@ -108,12 +108,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-static VNET_DEFINE(int, ipfastforward_active);
-#defineV_ipfastforward_active  VNET(ipfastforward_active)
-
-SYSCTL_INT(_net_inet_ip, OID_AUTO, fastforwarding, CTLFLAG_VNET | CTLFLAG_RW,
-

svn commit: r290165 - head/sys/netinet

2015-10-29 Thread George V. Neville-Neil
Author: gnn
Date: Thu Oct 29 21:26:32 2015
New Revision: 290165
URL: https://svnweb.freebsd.org/changeset/base/290165

Log:
  Set the proper direction to check for policies in this one case.
  
  Pointed out by: eri
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  head/sys/netinet/ip_ipsec.c

Modified: head/sys/netinet/ip_ipsec.c
==
--- head/sys/netinet/ip_ipsec.c Thu Oct 29 21:25:46 2015(r290164)
+++ head/sys/netinet/ip_ipsec.c Thu Oct 29 21:26:32 2015(r290165)
@@ -159,7 +159,7 @@ ip_ipsec_output(struct mbuf **m, struct 
 {
struct secpolicy *sp;
 
-   if (!key_havesp(IPSEC_DIR_INBOUND))
+   if (!key_havesp(IPSEC_DIR_OUTBOUND))
return 0;
 
/*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r290088 - head/tools/test

2015-10-27 Thread George V. Neville-Neil
Author: gnn
Date: Wed Oct 28 03:39:18 2015
New Revision: 290088
URL: https://svnweb.freebsd.org/changeset/base/290088

Log:
  Update the README to describe all the current tests in this directory.

Modified:
  head/tools/test/README

Modified: head/tools/test/README
==
--- head/tools/test/README  Wed Oct 28 02:37:24 2015(r290087)
+++ head/tools/test/README  Wed Oct 28 03:39:18 2015(r290088)
@@ -1,14 +1,24 @@
 $FreeBSD$
 
-This directory is for test programs.
+This directory is for standalone test programs, for the FreeBSD
+Test Suite, which uses Kyua, please see /usr/src/tests/
 
-A test program is one that will exercise a particular bit of the system
-and try to break it and/or measuring performance on it.
+A test program is one that exercises a particular bit of the system
+and either tries to break it or measures its performance.
 
 Please make a subdir per program, and add a brief description to this file.
 
+auxinfoReturn information on page sizes, CPUs, and OS release 
date.
 devrandom  Programs to test /dev/*random.
+hwpmc  Automatically trigger every event in hwpmc(4).
+iconv  Character set conversion tests.
 malloc A program to test and benchmark malloc().
+netA set of generic test programs for networking.
 netfibsPrograms to test multi-FIB network stacks.
 posixshm   A program to test POSIX shared memory.
+ppsapi Test 1 Pulse Per Second (1PPS) input for time control.
+pthread_vfork  Chack that vfork and pthreads work together.
+ptrace Verify that ptrace works with syscalls, vfork etc.
+sort   Tests for the sort command, including a full regression.
 testfloat  Programs to test floating-point implementations
+upsdl  Test of mmap funcationality.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r290089 - head/tools/test/net

2015-10-27 Thread George V. Neville-Neil
Author: gnn
Date: Wed Oct 28 03:43:24 2015
New Revision: 290089
URL: https://svnweb.freebsd.org/changeset/base/290089

Log:
  Add a test for the listen queue using two test programs,
  listen, and connect.  The listen program is a simple server that
  accepts and closes sockets, until a fixed limit, then sets the listen
  queue to 0 and counts how many remaining connections it processes.
  
  The connect program repeatedly opens connections and closes them
  serving as the driver for the listen program.
  
  Sponsored by: Limelight Networks

Added:
  head/tools/test/net/
  head/tools/test/net/Makefile   (contents, props changed)
  head/tools/test/net/connect.c   (contents, props changed)
  head/tools/test/net/listen.c   (contents, props changed)

Added: head/tools/test/net/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/test/net/MakefileWed Oct 28 03:43:24 2015
(r290089)
@@ -0,0 +1,9 @@
+# $FreeBSD$ 
+
+PROGS= listen connect
+MAN=
+WARNS?=6
+
+test:  ${PROGS}
+
+.include 

Added: head/tools/test/net/connect.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/test/net/connect.c   Wed Oct 28 03:43:24 2015
(r290089)
@@ -0,0 +1,86 @@
+/*-
+ * Copyright (c) 2015 George V. Neville-Neil
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define PORT 6969 /* Default port */
+#define RECV_LIMIT 64 /* When do we move listen to 0? */
+
+void usage(void);
+
+void usage()
+{
+   err(EX_USAGE, "connect [-p port]\n");
+}
+
+int main(int argc, char **argv)
+{
+
+   int ch, cli_sock, count = 0;
+   int port = PORT;
+   struct sockaddr_in remoteaddr;
+
+   while ((ch = getopt(argc, argv, "p:")) != -1) {
+   switch (ch) {
+   case 'p':
+   port = atoi(optarg);
+   break;
+   case 'h':
+   default:
+   usage();
+   }
+   }
+
+   bzero(, sizeof(remoteaddr));
+   remoteaddr.sin_len = sizeof(remoteaddr);
+   remoteaddr.sin_family = AF_INET;
+   remoteaddr.sin_port = htons(port);
+   remoteaddr.sin_addr.s_addr = INADDR_ANY;
+
+   cli_sock = socket(AF_INET, SOCK_STREAM, 0);
+
+   while ((cli_sock = connect(cli_sock, (struct sockaddr *),
+  sizeof(remoteaddr))) >= 0) {
+   count++;
+   close(cli_sock);
+   cli_sock = socket(AF_INET, SOCK_STREAM, 0);
+   }
+
+   printf("Exiting at %d with errno %d\n", count, errno);
+
+}

Added: head/tools/test/net/listen.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/test/net/listen.cWed Oct 28 03:43:24 2015
(r290089)
@@ -0,0 +1,106 @@
+/*-
+ * Copyright (c) 2015 George V. Neville-Neil
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of condit

svn commit: r290032 - svnadmin/conf

2015-10-26 Thread George V. Neville-Neil
Author: gnn
Date: Tue Oct 27 01:28:07 2015
New Revision: 290032
URL: https://svnweb.freebsd.org/changeset/base/290032

Log:
  Welcome Jonathan Looney to the project.
  
  Approved by:  core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessTue Oct 27 01:26:50 2015(r290031)
+++ svnadmin/conf/accessTue Oct 27 01:28:07 2015(r290032)
@@ -131,6 +131,7 @@ jmmv
 joerg  freebsd-de...@uriah.heep.sax.de
 jonathan
 jpaetzel
+jtl
 julian
 jwd
 kadesai

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Tue Oct 27 01:26:50 2015(r290031)
+++ svnadmin/conf/mentors   Tue Oct 27 01:28:07 2015(r290032)
@@ -23,6 +23,7 @@ erj   gnn Co-mentor: jfv
 jceel  wkoszek Co-mentor: cognet
 jkhrwatson
 jonathan   rwatson
+jtlgnn
 jwdrmacklem
 kadesaiken Co-mentor: scottl, ambrisko
 mahrensmckusick
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r290028 - in head/sys: netinet netipsec

2015-10-26 Thread George V. Neville-Neil
Author: gnn
Date: Tue Oct 27 00:42:15 2015
New Revision: 290028
URL: https://svnweb.freebsd.org/changeset/base/290028

Log:
  Turning on IPSEC used to introduce a slight amount of performance
  degradation (7%) for host host TCP connections over 10Gbps links,
  even when there were no secuirty policies in place. There is no
  change in performance on 1Gbps network links. Testing GENERIC vs.
  GENERIC-NOIPSEC vs. GENERIC with this change shows that the new
  code removes any overhead introduced by having IPSEC always in the
  kernel.
  
  Differential Revision:D3993
  MFC after:1 month
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  head/sys/netinet/ip_ipsec.c
  head/sys/netinet/tcp_subr.c
  head/sys/netipsec/ipsec.c

Modified: head/sys/netinet/ip_ipsec.c
==
--- head/sys/netinet/ip_ipsec.c Tue Oct 27 00:37:19 2015(r290027)
+++ head/sys/netinet/ip_ipsec.c Tue Oct 27 00:42:15 2015(r290028)
@@ -158,6 +158,10 @@ int
 ip_ipsec_output(struct mbuf **m, struct inpcb *inp, int *error)
 {
struct secpolicy *sp;
+
+   if (!key_havesp(IPSEC_DIR_INBOUND))
+   return 0;
+
/*
 * Check the security policy (SP) for the packet and, if
 * required, do IPsec-related processing.  There are two

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Tue Oct 27 00:37:19 2015(r290027)
+++ head/sys/netinet/tcp_subr.c Tue Oct 27 00:42:15 2015(r290028)
@@ -1972,7 +1972,8 @@ ipsec_hdrsiz_tcp(struct tcpcb *tp)
 #endif
struct tcphdr *th;
 
-   if ((tp == NULL) || ((inp = tp->t_inpcb) == NULL))
+   if ((tp == NULL) || ((inp = tp->t_inpcb) == NULL) ||
+   (!key_havesp(IPSEC_DIR_OUTBOUND)))
return (0);
m = m_gethdr(M_NOWAIT, MT_DATA);
if (!m)

Modified: head/sys/netipsec/ipsec.c
==
--- head/sys/netipsec/ipsec.c   Tue Oct 27 00:37:19 2015(r290027)
+++ head/sys/netipsec/ipsec.c   Tue Oct 27 00:42:15 2015(r290028)
@@ -1276,6 +1276,9 @@ ipsec46_in_reject(struct mbuf *m, struct
int error;
int result;
 
+   if (!key_havesp(IPSEC_DIR_INBOUND))
+   return 0;
+
IPSEC_ASSERT(m != NULL, ("null mbuf"));
 
/* Get SP for this packet. */
@@ -1403,6 +1406,9 @@ ipsec_hdrsiz(struct mbuf *m, u_int dir, 
int error;
size_t size;
 
+   if (!key_havesp(dir))
+   return 0;
+
IPSEC_ASSERT(m != NULL, ("null mbuf"));
 
/* Get SP for this packet. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r287759 - in head: cddl/lib/libdtrace share/dtrace sys/netinet

2015-09-13 Thread George V. Neville-Neil
:
+   direction == TA_USER ? "user" :
+   direction == TA_RESPOND ? "respond" :
+   direction == TA_OUTPUT ? "drop" :
+   "unknown" ;
+
+#pragma D binding "1.12.1" tcpflag_string
+inline string tcpflag_string[uint8_t flags] =
+   flags & TH_FIN ?"FIN" :
+   flags & TH_SYN ?"SYN" :
+   flags & TH_RST ?"RST" :
+   flags & TH_PUSH ?   "PUSH" :
+   flags & TH_ACK ?"ACK" :
+   flags & TH_URG ?"URG" :
+   flags & TH_ECE ?"ECE" :
+   flags & TH_CWR ?"CWR" :
+   "unknown" ;
+
+#pragma D binding "1.12.1" PRU_ATTACH
+inline int PRU_ATTACH  = 0;
+#pragma D binding "1.12.1" PRU_DETACH
+inline int PRU_DETACH  = 1;
+#pragma D binding "1.12.1" PRU_BIND
+inline int PRU_BIND= 2;
+#pragma D binding "1.12.1" PRU_LISTEN
+inline int PRU_LISTEN  = 3;
+#pragma D binding "1.12.1" PRU_CONNECT
+inline int PRU_CONNECT = 4;
+#pragma D binding "1.12.1" PRU_ACCEPT
+inline int PRU_ACCEPT   = 5 ;
+#pragma D binding "1.12.1" PRU_DISCONNECT
+inline int PRU_DISCONNECT=  6;
+#pragma D binding "1.12.1" PRU_SHUTDOWN
+inline int PRU_SHUTDOWN =  7;
+#pragma D binding "1.12.1" PRU_RCVD
+inline int PRU_RCVD =  8;
+#pragma D binding "1.12.1" PRU_SEND
+inline int PRU_SEND =  9;
+#pragma D binding "1.12.1" PRU_ABORT
+inline int PRU_ABORT = 10;
+#pragma D binding "1.12.1" PRU_CONTROL
+inline int PRU_CONTROL   = 11;
+#pragma D binding "1.12.1" PRU_SENSE
+inline int PRU_SENSE = 12;
+#pragma D binding "1.12.1" PRU_RCVOOB
+inline int PRU_RCVOOB= 13;
+#pragma D binding "1.12.1" PRU_SENDOOB
+inline int PRU_SENDOOB   = 14;
+#pragma D binding "1.12.1" PRU_SOCKADDR
+inline int PRU_SOCKADDR  = 15;
+#pragma D binding "1.12.1" PRU_PEERADDR
+inline int PRU_PEERADDR  = 16;
+#pragma D binding "1.12.1" PRU_CONNECT2
+inline int PRU_CONNECT2  = 17;
+#pragma D binding "1.12.1" PRU_FASTTIMO
+inline int PRU_FASTTIMO  = 18;
+#pragma D binding "1.12.1" PRU_SLOWTIMO
+inline int PRU_SLOWTIMO  = 19;
+#pragma D binding "1.12.1" PRU_PROTORCV
+inline int PRU_PROTORCV  = 20;
+#pragma D binding "1.12.1" PRU_PROTOSEND
+inline int PRU_PROTOSEND  = 21;
+#pragma D binding "1.12.1" PRU_SEND_EOF
+inline int PRU_SEND_EOF  = 22;
+#pragma D binding "1.12.1" PRU_SOSETLABEL
+inline int PRU_SOSETLABEL = 23;
+#pragma D binding "1.12.1" PRU_CLOSE
+inline int PRU_CLOSE = 24;
+#pragma D binding "1.12.1" PRU_FLUSH
+inline int PRU_FLUSH = 25;
+
+#pragma D binding "1.12.1" prureq_string
+inline string prureq_string[uint8_t req] =
+   req == PRU_ATTACH ? "ATTACH" :
+   req == PRU_DETACH ? "DETACH" :
+   req == PRU_BIND ? "BIND" :
+   req == PRU_LISTEN ? "LISTEN" :
+   req == PRU_CONNECT ? "CONNECT" :
+   req == PRU_ACCEPT ? "ACCEPT" :
+   req == PRU_DISCONNECT ? "DISCONNECT" :
+   req == PRU_SHUTDOWN ? "SHUTDOWN" :
+   req == PRU_RCVD ? "RCVD" :
+   req == PRU_SEND ? "SEND" :
+   req == PRU_ABORT ? "ABORT" :
+   req == PRU_CONTROL ? "CONTROL" :
+   req == PRU_SENSE ? "SENSE" :
+   req == PRU_RCVOOB ? "RCVOOB" :
+   req == PRU_SENDOOB ? "SENDOOB" :
+   req == PRU_SOCKADDR ? "SOCKADDR" :
+   req == PRU_PEERADDR ? "PEERADDR" :
+   req == PRU_CONNECT2 ? "CONNECT2" :
+   req == PRU_FASTTIMO ? "FASTTIMO" :
+   req == PRU_SLOWTIMO ? "SLOWTIMO" :
+   req == PRU_PROTORCV ? "PROTORCV" :
+   req == PRU_PROTOSEND ? "PROTOSEND" :
+   req == PRU_SEND ? "SEND_EOF" :
+   req == PRU_SOSETLABEL ? "SOSETLABEL" :
+   req == PRU_CLOSE ? "CLOSE" :
+   req == PRU_FLUSH ? "FLUSE" :
+   "unknown" ;

Added: head/share/dtrace/tcpdebug
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/dtrace/tcpdebug  Sun Sep 13 15:50:55 2015(r287759)
@@ -0,0 +1,165 @@
+#!/usr/sbin/dtrace -s
+/*
+ * Copyright (c) 2015 George V. Neville-Neil
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above

  1   2   3   4   >