svn commit: r271420 - in head/sys: dev/cxgbe/common sys

2014-09-11 Thread Robert Watson
Author: rwatson
Date: Thu Sep 11 07:16:15 2014
New Revision: 271420
URL: http://svnweb.freebsd.org/changeset/base/271420

Log:
  Add new a M_START() mbuf macro that returns a pointer to the start of
  an mbuf's storage (internal or external).
  
  Add a new M_SIZE() mbuf macro that returns the size of an mbuf's
  storage (internal or external).
  
  These contrast with m_data and m_len, which are with respect to data
  in the buffer, rather than the buffer itself.
  
  Rewrite M_LEADINGSPACE() and M_TRAILINGSPACE() in terms of M_START()
  and M_SIZE().
  
  This is done as we currently have many instances of using mbuf flags
  to generate pointers or lengths for internal storage in header and
  regular mbufs, as well as to external storage. Rather than replicate
  this logic throughout the network stack, centralising the
  implementation will make it easier for us to refine mbuf storage.
  This should also help reduce bugs by limiting the amount of
  mbuf-type-specific pointer arithmetic.  Followup changes will
  propagate use of the macros throughout the stack.
  
  M_SIZE() conflicts with one macro in the Chelsio driver; rename that
  macro in a slightly unsatisfying way to eliminate the collision.
  
  MFC after:3 days
  Obtained from:jeff (with enhancements)
  Sponsored by: EMC / Isilon Storage Division
  Reviewed by:  bz, glebius, np
  Differential Revision:https://reviews.freebsd.org/D753

Modified:
  head/sys/dev/cxgbe/common/t4_regs.h
  head/sys/sys/mbuf.h

Modified: head/sys/dev/cxgbe/common/t4_regs.h
==
--- head/sys/dev/cxgbe/common/t4_regs.h Thu Sep 11 06:17:56 2014
(r271419)
+++ head/sys/dev/cxgbe/common/t4_regs.h Thu Sep 11 07:16:15 2014
(r271420)
@@ -1073,9 +1073,9 @@
 #define A_SGE_FL_BUFFER_SIZE0 0x1044
 
 #define S_SIZE4
-#define M_SIZE0xfffU
+#define CXGBE_M_SIZE0xfffU
 #define V_SIZE(x) ((x)  S_SIZE)
-#define G_SIZE(x) (((x)  S_SIZE)  M_SIZE)
+#define G_SIZE(x) (((x)  S_SIZE)  CXGBE_M_SIZE)
 
 #define A_SGE_FL_BUFFER_SIZE1 0x1048
 #define A_SGE_FL_BUFFER_SIZE2 0x104c

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Thu Sep 11 06:17:56 2014(r271419)
+++ head/sys/sys/mbuf.h Thu Sep 11 07:16:15 2014(r271420)
@@ -843,29 +843,50 @@ m_last(struct mbuf *m)
 } while (0)
 
 /*
+ * Return the address of the start of the buffer associated with an mbuf,
+ * handling external storage, packet-header mbufs, and regular data mbufs.
+ */
+#defineM_START(m)  
\
+   (((m)-m_flags  M_EXT) ? (m)-m_ext.ext_buf :  \
+((m)-m_flags  M_PKTHDR) ? (m)-m_pktdat[0] :\
+(m)-m_dat[0])
+
+/*
+ * Return the size of the buffer associated with an mbuf, handling external
+ * storage, packet-header mbufs, and regular data mbufs.
+ */
+#defineM_SIZE(m)   
\
+   (((m)-m_flags  M_EXT) ? (m)-m_ext.ext_size : \
+((m)-m_flags  M_PKTHDR) ? MHLEN :\
+MLEN)
+
+/*
  * Compute the amount of space available before the current start of data in
  * an mbuf.
  *
  * The M_WRITABLE() is a temporary, conservative safety measure: the burden
  * of checking writability of the mbuf data area rests solely with the caller.
+ *
+ * NB: In previous versions, M_LEADINGSPACE() would only check M_WRITABLE()
+ * for mbufs with external storage.  We now allow mbuf-embedded data to be
+ * read-only as well.
  */
 #defineM_LEADINGSPACE(m)   
\
-   ((m)-m_flags  M_EXT ? \
-   (M_WRITABLE(m) ? (m)-m_data - (m)-m_ext.ext_buf : 0): \
-   (m)-m_flags  M_PKTHDR ? (m)-m_data - (m)-m_pktdat : \
-   (m)-m_data - (m)-m_dat)
+   (M_WRITABLE(m) ? ((m)-m_data - M_START(m)) : 0)
 
 /*
  * Compute the amount of space available after the end of data in an mbuf.
  *
  * The M_WRITABLE() is a temporary, conservative safety measure: the burden
  * of checking writability of the mbuf data area rests solely with the caller.
+ *
+ * NB: In previous versions, M_TRAILINGSPACE() would only check M_WRITABLE()
+ * for mbufs with external storage.  We now allow mbuf-embedded data to be
+ * read-only as well.
  */
 #defineM_TRAILINGSPACE(m)  
\
-   ((m)-m_flags  M_EXT ? \
-   (M_WRITABLE(m) ? (m)-m_ext.ext_buf + (m)-m_ext.ext_size   \
-   - ((m)-m_data + (m)-m_len) : 0) : \
-   (m)-m_dat[MLEN] - ((m)-m_data + (m)-m_len))
+   (M_WRITABLE(m) ?\
+   ((M_START(m) + M_SIZE(m)) - ((m)-m_data + 

Re: svn commit: r271418 - head/sbin/dhclient

2014-09-11 Thread Robert Watson
A bit behind on commits, but: does this mean that an older userspace dhclient 
will no longer work with a newer kernel?


Robert

On Thu, 11 Sep 2014, Gleb Smirnoff wrote:


Author: glebius
Date: Thu Sep 11 05:48:39 2014
New Revision: 271418
URL: http://svnweb.freebsd.org/changeset/base/271418

Log:
 Since r270929 raw sockets expect network byte order.

 Submitted by:  avg

Modified:
 head/sbin/dhclient/packet.c

Modified: head/sbin/dhclient/packet.c
==
--- head/sbin/dhclient/packet.c Thu Sep 11 03:16:57 2014(r271417)
+++ head/sbin/dhclient/packet.c Thu Sep 11 05:48:39 2014(r271418)
@@ -127,17 +127,6 @@ assemble_udp_ip_header(unsigned char *bu
ip.ip_dst.s_addr = to;

ip.ip_sum = wrapsum(checksum((unsigned char *)ip, sizeof(ip), 0));
-
-   /*
-* While the BPF -- used for broadcasts -- expects a true IP header
-* with all the bytes in network byte order, the raw socket interface
-* which is used for unicasts expects the ip_len field to be in host
-* byte order.  In both cases, the checksum has to be correct, so this
-* is as good a place as any to turn the bytes around again.
-*/
-   if (to != INADDR_BROADCAST)
-   ip.ip_len = ntohs(ip.ip_len);
-
memcpy(buf[*bufix], ip, sizeof(ip));
*bufix += sizeof(ip);




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


Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica

2014-09-11 Thread Konstantin Belousov
On Wed, Sep 10, 2014 at 10:41:00AM -0400, John Baldwin wrote:
 On Tuesday, September 09, 2014 11:58:13 AM Konstantin Belousov wrote:
  On Sat, Sep 06, 2014 at 04:04:49PM -0400, John Baldwin wrote:
  Move of the code to initialize CPU from identcpu() to initializecpu()
  seems to be a fix on its own.  Since you are moving the fragments
  around, would you mind start using CPUID_MODEL/STEPPING etc constants ?
  The code was ancient, probably predating the defines.
 
 I will probably split this up into a couple of commits one of which will be
 to move register setting from identcpu.c to initcpu.c.  I can look at using
 the constants, but in particular when using CPUID_TO_*() the logic is slightly
 different (e.g. you have to check for model and family values for '6' instead
 of '60' or '600'), so I would prefer to do those changes as a separate commit
 to help with debugging in the future if I get one wrong.
 
I only asked about CPUID_MODEL etc constants (masks), which does not
require the logic change.  I think that CPUID_TO_*() is simply not
suitable there.


pgpVzwnEgntQp.pgp
Description: PGP signature


Re: svn commit: r271418 - head/sbin/dhclient

2014-09-11 Thread Andriy Gapon
On 11/09/2014 11:11, Robert Watson wrote:
 A bit behind on commits, but: does this mean that an older userspace dhclient
 will no longer work with a newer kernel?

At least in my case it appeared to work.  I guess this is because the broadcast
queries were not affected by the change.

 On Thu, 11 Sep 2014, Gleb Smirnoff wrote:
 
 Author: glebius
 Date: Thu Sep 11 05:48:39 2014
 New Revision: 271418
 URL: http://svnweb.freebsd.org/changeset/base/271418

 Log:
  Since r270929 raw sockets expect network byte order.

  Submitted by:avg

 Modified:
  head/sbin/dhclient/packet.c

 Modified: head/sbin/dhclient/packet.c
 ==
 --- head/sbin/dhclient/packet.cThu Sep 11 03:16:57 2014(r271417)
 +++ head/sbin/dhclient/packet.cThu Sep 11 05:48:39 2014(r271418)
 @@ -127,17 +127,6 @@ assemble_udp_ip_header(unsigned char *bu
 ip.ip_dst.s_addr = to;

 ip.ip_sum = wrapsum(checksum((unsigned char *)ip, sizeof(ip), 0));
 -
 -/*
 - * While the BPF -- used for broadcasts -- expects a true IP header
 - * with all the bytes in network byte order, the raw socket interface
 - * which is used for unicasts expects the ip_len field to be in host
 - * byte order.  In both cases, the checksum has to be correct, so this
 - * is as good a place as any to turn the bytes around again.
 - */
 -if (to != INADDR_BROADCAST)
 -ip.ip_len = ntohs(ip.ip_len);
 -
 memcpy(buf[*bufix], ip, sizeof(ip));
 *bufix += sizeof(ip);



 


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


Re: svn commit: r271418 - head/sbin/dhclient

2014-09-11 Thread Hiroki Sato
Andriy Gapon a...@freebsd.org wrote
  in 541163c0.2080...@freebsd.org:

av On 11/09/2014 11:11, Robert Watson wrote:
av  A bit behind on commits, but: does this mean that an older userspace 
dhclient
av  will no longer work with a newer kernel?
av
av At least in my case it appeared to work.  I guess this is because the 
broadcast
av queries were not affected by the change.

 Only a unicast DHCPREQUEST sent from a DHCP client to renew the lease
 does not work.  dhclient[N]: send_packet: Invalid argument log
 appears at certain interval due to it.  A lease will expire, and it
 will repeatedly restart from the broadcast discovery phase.

-- Hiroki


pgpqcW06W6LJ2.pgp
Description: PGP signature


svn commit: r271421 - head/sys/netinet6

2014-09-11 Thread Andrey V. Elsukov
Author: ae
Date: Thu Sep 11 10:27:59 2014
New Revision: 271421
URL: http://svnweb.freebsd.org/changeset/base/271421

Log:
  * constify argument of in6_addrscope();
  * use IN6_IS_ADDR_XXX() macro instead of hardcoded values;
  * for multicast addresses just return scope value, the only exception
is addresses with 0x0F scope value (RFC 4291 p2.7.0);
  
  Obtained from:Yandex LLC
  Sponsored by: Yandex LLC

Modified:
  head/sys/netinet6/in6.h
  head/sys/netinet6/scope6.c

Modified: head/sys/netinet6/in6.h
==
--- head/sys/netinet6/in6.h Thu Sep 11 07:16:15 2014(r271420)
+++ head/sys/netinet6/in6.h Thu Sep 11 10:27:59 2014(r271421)
@@ -649,7 +649,7 @@ int in6_cksum_pseudo(struct ip6_hdr *, u
 intin6_cksum(struct mbuf *, u_int8_t, u_int32_t, u_int32_t);
 intin6_localaddr(struct in6_addr *);
 intin6_localip(struct in6_addr *);
-intin6_addrscope(struct in6_addr *);
+intin6_addrscope(const struct in6_addr *);
 struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *);
 extern void in6_if_up(struct ifnet *);
 struct sockaddr;

Modified: head/sys/netinet6/scope6.c
==
--- head/sys/netinet6/scope6.c  Thu Sep 11 07:16:15 2014(r271420)
+++ head/sys/netinet6/scope6.c  Thu Sep 11 10:27:59 2014(r271421)
@@ -235,62 +235,24 @@ scope6_get(struct ifnet *ifp, struct sco
  * Get a scope of the address. Node-local, link-local, site-local or global.
  */
 int
-in6_addrscope(struct in6_addr *addr)
+in6_addrscope(const struct in6_addr *addr)
 {
-   int scope;
-
-   if (addr-s6_addr[0] == 0xfe) {
-   scope = addr-s6_addr[1]  0xc0;
-
-   switch (scope) {
-   case 0x80:
-   return IPV6_ADDR_SCOPE_LINKLOCAL;
-   break;
-   case 0xc0:
-   return IPV6_ADDR_SCOPE_SITELOCAL;
-   break;
-   default:
-   return IPV6_ADDR_SCOPE_GLOBAL; /* just in case */
-   break;
-   }
-   }
-
-
-   if (addr-s6_addr[0] == 0xff) {
-   scope = addr-s6_addr[1]  0x0f;
 
+   if (IN6_IS_ADDR_MULTICAST(addr)) {
/*
-* due to other scope such as reserved,
-* return scope doesn't work.
+* Addresses with reserved value F must be treated as
+* global multicast addresses.
 */
-   switch (scope) {
-   case IPV6_ADDR_SCOPE_INTFACELOCAL:
-   return IPV6_ADDR_SCOPE_INTFACELOCAL;
-   break;
-   case IPV6_ADDR_SCOPE_LINKLOCAL:
-   return IPV6_ADDR_SCOPE_LINKLOCAL;
-   break;
-   case IPV6_ADDR_SCOPE_SITELOCAL:
-   return IPV6_ADDR_SCOPE_SITELOCAL;
-   break;
-   default:
-   return IPV6_ADDR_SCOPE_GLOBAL;
-   break;
-   }
-   }
-
-   /*
-* Regard loopback and unspecified addresses as global, since
-* they have no ambiguity.
-*/
-   if (bcmp(in6addr_loopback, addr, sizeof(*addr) - 1) == 0) {
-   if (addr-s6_addr[15] == 1) /* loopback */
-   return IPV6_ADDR_SCOPE_LINKLOCAL;
-   if (addr-s6_addr[15] == 0) /* unspecified */
-   return IPV6_ADDR_SCOPE_GLOBAL; /* XXX: correct? */
-   }
-
-   return IPV6_ADDR_SCOPE_GLOBAL;
+   if (IPV6_ADDR_MC_SCOPE(addr) == 0x0f)
+   return (IPV6_ADDR_SCOPE_GLOBAL);
+   return (IPV6_ADDR_MC_SCOPE(addr));
+   }
+   if (IN6_IS_ADDR_LINKLOCAL(addr) ||
+   IN6_IS_ADDR_LOOPBACK(addr))
+   return (IPV6_ADDR_SCOPE_LINKLOCAL);
+   if (IN6_IS_ADDR_SITELOCAL(addr))
+   return (IPV6_ADDR_SCOPE_SITELOCAL);
+   return (IPV6_ADDR_SCOPE_GLOBAL);
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2014-09-11 Thread Andrew Turner
Author: andrew
Date: Thu Sep 11 10:53:57 2014
New Revision: 271422
URL: http://svnweb.freebsd.org/changeset/base/271422

Log:
  Rename pmap_kenter_temp to pmap_kenter_temporary to be consistent with the
  other architectures with this function.
  
  Submitted by: Svatopluk Kraus onwahe at gmail.com
  Submitted by: Michal Meloun meloun at miracle.cz

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

Modified: head/sys/arm/arm/minidump_machdep.c
==
--- head/sys/arm/arm/minidump_machdep.c Thu Sep 11 10:27:59 2014
(r271421)
+++ head/sys/arm/arm/minidump_machdep.c Thu Sep 11 10:53:57 2014
(r271422)
@@ -154,7 +154,7 @@ blk_write(struct dumperinfo *di, char *p
sz -= len;
} else {
for (i = 0; i  len; i += PAGE_SIZE)
-   dump_va = pmap_kenter_temp(pa + i,
+   dump_va = pmap_kenter_temporary(pa + i,
(i + fragsz)  PAGE_SHIFT);
fragsz += len;
pa += len;
@@ -244,7 +244,7 @@ minidumpsys(struct dumperinfo *di)
}
if (pmap_pde_v(pdp)  pmap_pde_page(pdp)) {
/* Set bit for each valid page in this 1MB block */
-   addr = pmap_kenter_temp(*pdp  L1_C_ADDR_MASK, 0);
+   addr = pmap_kenter_temporary(*pdp  L1_C_ADDR_MASK, 0);
pt = (pt_entry_t*)(addr +
(((uint32_t)*pdp   L1_C_ADDR_MASK)  PAGE_MASK));
for (k = 0; k  256; k++) {

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Thu Sep 11 10:27:59 2014(r271421)
+++ head/sys/arm/arm/pmap-v6.c  Thu Sep 11 10:53:57 2014(r271422)
@@ -2369,7 +2369,7 @@ pmap_kenter_section(vm_offset_t va, vm_o
  * to be used for panic dumps.
  */
 void *
-pmap_kenter_temp(vm_paddr_t pa, int i)
+pmap_kenter_temporary(vm_paddr_t pa, int i)
 {
vm_offset_t va;
 

Modified: head/sys/arm/arm/pmap.c
==
--- head/sys/arm/arm/pmap.c Thu Sep 11 10:27:59 2014(r271421)
+++ head/sys/arm/arm/pmap.c Thu Sep 11 10:53:57 2014(r271422)
@@ -2663,7 +2663,7 @@ pmap_kenter_section(vm_offset_t va, vm_o
  * to be used for panic dumps.
  */
 void *
-pmap_kenter_temp(vm_paddr_t pa, int i)
+pmap_kenter_temporary(vm_paddr_t pa, int i)
 {
vm_offset_t va;
 

Modified: head/sys/arm/include/pmap.h
==
--- head/sys/arm/include/pmap.h Thu Sep 11 10:27:59 2014(r271421)
+++ head/sys/arm/include/pmap.h Thu Sep 11 10:53:57 2014(r271422)
@@ -256,7 +256,7 @@ int pmap_change_attr(vm_offset_t, vm_siz
 void   pmap_kenter(vm_offset_t va, vm_paddr_t pa);
 void   pmap_kenter_nocache(vm_offset_t va, vm_paddr_t pa);
 void   pmap_kenter_device(vm_offset_t va, vm_paddr_t pa);
-void   *pmap_kenter_temp(vm_paddr_t pa, int i);
+void   *pmap_kenter_temporary(vm_paddr_t pa, int i);
 void   pmap_kenter_user(vm_offset_t va, vm_paddr_t pa);
 vm_paddr_t pmap_kextract(vm_offset_t va);
 void   pmap_kremove(vm_offset_t);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271424 - in head: etc etc/defaults share/man/man5

2014-09-11 Thread Hiroki Sato
Author: hrs
Date: Thu Sep 11 12:30:29 2014
New Revision: 271424
URL: http://svnweb.freebsd.org/changeset/base/271424

Log:
  - Add $netif_ipexpand_max to specify the upper limit for the number of
addresses generated by an address range specification.  The default
value is 2048.  This can be increased by setting $netif_ipexpand_max
in rc.conf.
  
  - Fix warning messages when an address range spec exceeds the upper limit.
  
  PR:   186841

Modified:
  head/etc/defaults/rc.conf
  head/etc/network.subr
  head/share/man/man5/rc.conf.5

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Thu Sep 11 11:25:10 2014(r271423)
+++ head/etc/defaults/rc.conf   Thu Sep 11 12:30:29 2014(r271424)
@@ -110,6 +110,7 @@ synchronous_dhclient=NO   # Start dhclie
# interfaces during startup.
 defaultroute_delay=30# Time to wait for a default route on a 
DHCP interface.
 defaultroute_carrier_delay=5 # Time to wait for carrier while waiting for a 
default route.
+netif_ipexpand_max=2048  # Maximum number of IP addrs in a range spec.
 wpa_supplicant_program=/usr/sbin/wpa_supplicant
 wpa_supplicant_flags=-s  # Extra flags to pass to wpa_supplicant
 wpa_supplicant_conf_file=/etc/wpa_supplicant.conf

Modified: head/etc/network.subr
==
--- head/etc/network.subr   Thu Sep 11 11:25:10 2014(r271423)
+++ head/etc/network.subr   Thu Sep 11 12:30:29 2014(r271424)
@@ -25,9 +25,7 @@
 # $FreeBSD$
 #
 IFCONFIG_CMD=/sbin/ifconfig
-
-# Maximum number of addresses expanded from a address range specification.
-_IPEXPANDMAX=31
+: ${netif_ipexpand_max:=2048}
 
 #
 # Subroutines commonly used from network startup scripts.
@@ -886,8 +884,8 @@ ifalias_expand_addr_inet()
_ipcount=$_iplow
while [ $_ipcount -le $_iphigh ]; do
_retstr=${_retstr} 
${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail}${_plen:+/}${_plen}
-   if [ $_ipcount -gt $(($_iplow + $_IPEXPANDMAX)) ]; then
-   warn Range specification is too large 
(${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_iphigh}${_iptail:+.}${_iptail}).
  
${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail}
 was processed.
+   if [ $_ipcount -gt $(($_iplow + $netif_ipexpand_max)) 
]; then
+   warn Range specification is too large 
(${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_iphigh}${_iptail:+.}${_iptail}).
  
${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail}
 was processed.  Increase \$netif_ipexpand_max in rc.conf.
break
else
_ipcount=$(($_ipcount + 1))
@@ -976,9 +974,9 @@ ifalias_expand_addr_inet6()
$_ipleft $_ipcount $_ipright \
${_plen:+/}$_plen`
_retstr=$_retstr $_r
-   if [ $_ipcount -gt $(($_iplow + 
$_IPEXPANDMAX)) ]
+   if [ $_ipcount -gt $(($_iplow + 
$netif_ipexpand_max)) ]
then
-   warn Range specification is 
too large $(printf '(%s:%04x%s-%s:%04x%s)' $_ipleft $_iplow $_ipright $_ipleft 
$_iphigh $_ipright). $(printf '%s:%04x%s-%s:%04x%s' $_ipleft $_iplow $_ipright 
$_ipleft $_ipcount $_ipright) was processed.
+   warn Range specification is 
too large $(printf '(%s:%x%s-%s:%x%s)' $_ipleft $_iplow $_ipright 
$_ipleft $_iphigh $_ipright). $(printf '%s:%x%s-%s:%x%s' $_ipleft 
$_iplow $_ipright $_ipleft $_ipcount $_ipright) was processed.  
Increase \$netif_ipexpand_max in rc.conf.
break
else
_ipcount=$(($_ipcount + 1))

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Thu Sep 11 11:25:10 2014
(r271423)
+++ head/share/man/man5/rc.conf.5   Thu Sep 11 12:30:29 2014
(r271424)
@@ -1199,6 +1199,19 @@ or
 .Li inet6 2001:db8:1-f::1/64 .
 This notation allows address and prefix length part only,
 not the other address modifiers.
+Note that the maximum number of the generated addresses from a range
+specification is limited to an integer value specified in
+.Va netif_ipexpand_max
+in
+.Xr rc.conf 5
+because a small 

svn commit: r271425 - head/sys/netinet6

2014-09-11 Thread Andrey V. Elsukov
Author: ae
Date: Thu Sep 11 12:33:37 2014
New Revision: 271425
URL: http://svnweb.freebsd.org/changeset/base/271425

Log:
  Introduce new scope related functions.
  
  * new macro to remove magic number - IPV6_ADDR_SCOPES_COUNT;
  * sa6_checkzone() - this function checks sockaddr_in6 structure
for correctness of sin6_scope_id. It also can fill correct
value sometimes.
  * in6_getscopezone() - this function returns scope zone id for
specified interface and scope.
  * in6_getlinkifnet() - this function returns struct ifnet for
corresponding zone id of link-local scope.
  
  Obtained from:Yandex LLC
  Sponsored by: Yandex LLC

Modified:
  head/sys/netinet6/scope6.c
  head/sys/netinet6/scope6_var.h

Modified: head/sys/netinet6/scope6.c
==
--- head/sys/netinet6/scope6.c  Thu Sep 11 12:30:29 2014(r271424)
+++ head/sys/netinet6/scope6.c  Thu Sep 11 12:33:37 2014(r271425)
@@ -467,3 +467,77 @@ in6_getscope(struct in6_addr *in6)
 
return (0);
 }
+
+/*
+ * Return pointer to ifnet structure, corresponding to the zone id of
+ * link-local scope.
+ */
+struct ifnet*
+in6_getlinkifnet(uint32_t zoneid)
+{
+
+   return (ifnet_byindex((u_short)zoneid));
+}
+
+/*
+ * Return zone id for the specified scope.
+ */
+uint32_t
+in6_getscopezone(const struct ifnet *ifp, int scope)
+{
+
+   if (scope == IPV6_ADDR_SCOPE_INTFACELOCAL ||
+   scope == IPV6_ADDR_SCOPE_LINKLOCAL)
+   return (ifp-if_index);
+   if (scope = 0  scope  IPV6_ADDR_SCOPES_COUNT)
+   return (SID(ifp)-s6id_list[scope]);
+   return (0);
+}
+
+/*
+ * This function is for checking sockaddr_in6 structure passed
+ * from the application level (usually).
+ *
+ * sin6_scope_id should be set for link-local unicast, link-local and
+ * interface-local  multicast addresses.
+ *
+ * If it is zero, then look into default zone ids. If default zone id is
+ * not set or disabled, then return error.
+ */
+int
+sa6_checkzone(struct sockaddr_in6 *sa6)
+{
+   int scope;
+
+   scope = in6_addrscope(sa6-sin6_addr);
+   if (scope == IPV6_ADDR_SCOPE_GLOBAL)
+   return (sa6-sin6_scope_id ? EINVAL: 0);
+   if (IN6_IS_ADDR_MULTICAST(sa6-sin6_addr) 
+   scope != IPV6_ADDR_SCOPE_LINKLOCAL 
+   scope != IPV6_ADDR_SCOPE_INTFACELOCAL) {
+   if (sa6-sin6_scope_id == 0  V_ip6_use_defzone != 0)
+   sa6-sin6_scope_id = V_sid_default.s6id_list[scope];
+   return (0);
+   }
+   /*
+* Since ::1 address always configured on the lo0, we can
+* automatically set its zone id, when it is not specified.
+* Return error, when specified zone id doesn't match with
+* actual value.
+*/
+   if (IN6_IS_ADDR_LOOPBACK(sa6-sin6_addr)) {
+   if (sa6-sin6_scope_id == 0)
+   sa6-sin6_scope_id = in6_getscopezone(V_loif, scope);
+   else if (sa6-sin6_scope_id != in6_getscopezone(V_loif, scope))
+   return (EADDRNOTAVAIL);
+   }
+   /* XXX: we can validate sin6_scope_id here */
+   if (sa6-sin6_scope_id != 0)
+   return (0);
+   if (V_ip6_use_defzone != 0)
+   sa6-sin6_scope_id = V_sid_default.s6id_list[scope];
+   /* Return error if we can't determine zone id */
+   return (sa6-sin6_scope_id ? 0: EADDRNOTAVAIL);
+}
+
+

Modified: head/sys/netinet6/scope6_var.h
==
--- head/sys/netinet6/scope6_var.h  Thu Sep 11 12:30:29 2014
(r271424)
+++ head/sys/netinet6/scope6_var.h  Thu Sep 11 12:33:37 2014
(r271425)
@@ -36,12 +36,13 @@
 #ifdef _KERNEL
 #include net/vnet.h
 
+#defineIPV6_ADDR_SCOPES_COUNT  16
 struct scope6_id {
/*
 * 16 is correspondent to 4bit multicast scope field.
 * i.e. from node-local to global with some reserved/unassigned types.
 */
-   u_int32_t s6id_list[16];
+   uint32_t s6id_list[IPV6_ADDR_SCOPES_COUNT];
 };
 
 VNET_DECLARE(int, deembed_scopeid);
@@ -56,9 +57,12 @@ int  scope6_get_default(struct scope6_id 
 u_int32_t scope6_addr2default(struct in6_addr *);
 intsa6_embedscope(struct sockaddr_in6 *, int);
 intsa6_recoverscope(struct sockaddr_in6 *);
+intsa6_checkzone(struct sockaddr_in6 *);
 intin6_setscope(struct in6_addr *, struct ifnet *, u_int32_t *);
 intin6_clearscope(struct in6_addr *);
 uint16_t in6_getscope(struct in6_addr *);
+uint32_t in6_getscopezone(const struct ifnet *, int);
+struct ifnet* in6_getlinkifnet(uint32_t);
 #endif /* _KERNEL */
 
 #endif /* _NETINET6_SCOPE6_VAR_H_ */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271426 - head/sys/netinet6

2014-09-11 Thread Andrey V. Elsukov
Author: ae
Date: Thu Sep 11 12:54:17 2014
New Revision: 271426
URL: http://svnweb.freebsd.org/changeset/base/271426

Log:
  * use M_ZERO flag with malloc instead of explicit zeroing.
  * remove MULTI_SCOPE ifdef.
  
  Obtained from:Yandex LLC
  Sponsored by: Yandex LLC

Modified:
  head/sys/netinet6/scope6.c

Modified: head/sys/netinet6/scope6.c
==
--- head/sys/netinet6/scope6.c  Thu Sep 11 12:33:37 2014(r271425)
+++ head/sys/netinet6/scope6.c  Thu Sep 11 12:54:17 2014(r271426)
@@ -100,22 +100,14 @@ scope6_ifattach(struct ifnet *ifp)
 {
struct scope6_id *sid;
 
-   sid = (struct scope6_id *)malloc(sizeof(*sid), M_IFADDR, M_WAITOK);
-   bzero(sid, sizeof(*sid));
-
+   sid = malloc(sizeof(*sid), M_IFADDR, M_WAITOK | M_ZERO);
/*
 * XXX: IPV6_ADDR_SCOPE_xxx macros are not standard.
 * Should we rather hardcode here?
 */
sid-s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL] = ifp-if_index;
sid-s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL] = ifp-if_index;
-#ifdef MULTI_SCOPE
-   /* by default, we don't care about scope boundary for these scopes. */
-   sid-s6id_list[IPV6_ADDR_SCOPE_SITELOCAL] = 1;
-   sid-s6id_list[IPV6_ADDR_SCOPE_ORGLOCAL] = 1;
-#endif
-
-   return sid;
+   return (sid);
 }
 
 void
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271427 - head/sys/netinet6

2014-09-11 Thread Andrey V. Elsukov
Author: ae
Date: Thu Sep 11 13:18:41 2014
New Revision: 271427
URL: http://svnweb.freebsd.org/changeset/base/271427

Log:
  Add const qualifier to in6_addrhash() function.
  Add in6ifa_ifwithaddr() function. It is similar to ifa_ifwithaddr,
  but does fast lookup in the hash of inet6 addresses.
  
  Obtained from:Yandex LLC
  Sponsored by: Yandex LLC

Modified:
  head/sys/netinet6/in6.c
  head/sys/netinet6/in6_var.h

Modified: head/sys/netinet6/in6.c
==
--- head/sys/netinet6/in6.c Thu Sep 11 12:54:17 2014(r271426)
+++ head/sys/netinet6/in6.c Thu Sep 11 13:18:41 2014(r271427)
@@ -1715,6 +1715,29 @@ in6ifa_ifpforlinklocal(struct ifnet *ifp
 
 
 /*
+ * find the internet address corresponding to a given address.
+ * ifaddr is returned referenced.
+ */
+struct in6_ifaddr *
+in6ifa_ifwithaddr(const struct in6_addr *addr, uint32_t zoneid)
+{
+   struct in6_ifaddr *ia;
+
+   IN6_IFADDR_RLOCK();
+   LIST_FOREACH(ia, IN6ADDR_HASH(addr), ia6_hash) {
+   if (IN6_ARE_ADDR_EQUAL(IA6_IN6(ia), addr)) {
+   if (zoneid != 0 
+   zoneid != ia-ia_addr.sin6_scope_id)
+   continue;
+   ifa_ref(ia-ia_ifa);
+   break;
+   }
+   }
+   IN6_IFADDR_RUNLOCK();
+   return (ia);
+}
+
+/*
  * find the internet address corresponding to a given interface and address.
  * ifaddr is returned referenced.
  */

Modified: head/sys/netinet6/in6_var.h
==
--- head/sys/netinet6/in6_var.h Thu Sep 11 12:54:17 2014(r271426)
+++ head/sys/netinet6/in6_var.h Thu Sep 11 13:18:41 2014(r271427)
@@ -526,7 +526,7 @@ VNET_DECLARE(u_long, in6_ifaddrhmask);
 (V_in6_ifaddrhashtbl[IN6ADDR_HASHVAL(x)  V_in6_ifaddrhmask])
 
 static __inline uint32_t
-in6_addrhash(struct in6_addr *in6)
+in6_addrhash(const struct in6_addr *in6)
 {
uint32_t x;
 
@@ -812,6 +812,7 @@ voidin6_setmaxmtu(void);
 intin6_if2idlen(struct ifnet *);
 struct in6_ifaddr *in6ifa_ifpforlinklocal(struct ifnet *, int);
 struct in6_ifaddr *in6ifa_ifpwithaddr(struct ifnet *, struct in6_addr *);
+struct in6_ifaddr *in6ifa_ifwithaddr(const struct in6_addr *, uint32_t);
 struct in6_ifaddr *in6ifa_llaonifp(struct ifnet *);
 char   *ip6_sprintf(char *, const struct in6_addr *);
 intin6_addr2zoneid(struct ifnet *, struct in6_addr *, u_int32_t *);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271429 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-09-11 Thread Steven Hartland
Author: smh
Date: Thu Sep 11 16:21:51 2014
New Revision: 271429
URL: http://svnweb.freebsd.org/changeset/base/271429

Log:
  Persist vdev_resilver_txg changes to avoid panic caused by validation
  vs a vdev_resilver_txg value from a previous resilver.
  
  MFC after:1 week

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Thu Sep 11 
15:36:36 2014(r271428)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c  Thu Sep 11 
16:21:51 2014(r271429)
@@ -1951,12 +1951,15 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t
 
/*
 * If the vdev was resilvering and no longer has any
-* DTLs then reset its resilvering flag.
+* DTLs then reset its resilvering flag and dirty
+* the top level so that we persist the change.
 */
if (vd-vdev_resilver_txg != 0 
range_tree_space(vd-vdev_dtl[DTL_MISSING]) == 0 
-   range_tree_space(vd-vdev_dtl[DTL_OUTAGE]) == 0)
+   range_tree_space(vd-vdev_dtl[DTL_OUTAGE]) == 0) {
vd-vdev_resilver_txg = 0;
+   vdev_config_dirty(vd-vdev_top);
+   }
 
mutex_exit(vd-vdev_dtl_lock);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271431 - in head/sys: arm/altera/socfpga boot/fdt/dts/arm

2014-09-11 Thread Ruslan Bukin
Author: br
Date: Thu Sep 11 18:12:28 2014
New Revision: 271431
URL: http://svnweb.freebsd.org/changeset/base/271431

Log:
  Add Reset Manager driver. This driver provides generic way to reset
  and provides sysctl tunables for enable/disable FPGA-HPS bridges.
  
  Sponsored by: DARPA, AFRL

Added:
  head/sys/arm/altera/socfpga/socfpga_l3regs.h   (contents, props changed)
  head/sys/arm/altera/socfpga/socfpga_rstmgr.c   (contents, props changed)
  head/sys/arm/altera/socfpga/socfpga_rstmgr.h   (contents, props changed)
Modified:
  head/sys/arm/altera/socfpga/files.socfpga
  head/sys/arm/altera/socfpga/socfpga_common.c
  head/sys/boot/fdt/dts/arm/socfpga.dtsi

Modified: head/sys/arm/altera/socfpga/files.socfpga
==
--- head/sys/arm/altera/socfpga/files.socfpga   Thu Sep 11 17:19:44 2014
(r271430)
+++ head/sys/arm/altera/socfpga/files.socfpga   Thu Sep 11 18:12:28 2014
(r271431)
@@ -16,3 +16,4 @@ arm/arm/mpcore_timer.cstandard
 arm/altera/socfpga/socfpga_common.cstandard
 arm/altera/socfpga/socfpga_machdep.c   standard
 arm/altera/socfpga/socfpga_manager.c   standard
+arm/altera/socfpga/socfpga_rstmgr.cstandard

Modified: head/sys/arm/altera/socfpga/socfpga_common.c
==
--- head/sys/arm/altera/socfpga/socfpga_common.cThu Sep 11 17:19:44 
2014(r271430)
+++ head/sys/arm/altera/socfpga/socfpga_common.cThu Sep 11 18:12:28 
2014(r271431)
@@ -42,20 +42,31 @@ __FBSDID($FreeBSD$);
 #include machine/bus.h
 #include machine/fdt.h
 
-#defineRESMAN_BASE 0xFFD05000
-#defineRESMAN_CTRL 0x4
-#defineSWWARMRSTREQ(1  1)
+#include arm/altera/socfpga/socfpga_rstmgr.h
 
 void
 cpu_reset(void)
 {
+   uint32_t addr, paddr;
bus_addr_t vaddr;
+   phandle_t node;
 
-   if (bus_space_map(fdtbus_bs_tag, RESMAN_BASE, 0x10, 0, vaddr) == 0) {
-   bus_space_write_4(fdtbus_bs_tag, vaddr,
-   RESMAN_CTRL, SWWARMRSTREQ);
+   if (rstmgr_warmreset() == 0)
+   goto end;
+
+   node = OF_finddevice(rstmgr);
+   if (node == -1)
+   goto end;
+
+   if ((OF_getprop(node, reg, paddr, sizeof(paddr)))  0) {
+   addr = fdt32_to_cpu(paddr);
+   if (bus_space_map(fdtbus_bs_tag, addr, 0x8, 0, vaddr) == 0) {
+   bus_space_write_4(fdtbus_bs_tag, vaddr,
+   RSTMGR_CTRL, CTRL_SWWARMRSTREQ);
+   }
}
 
+end:
while (1);
 }
 

Added: head/sys/arm/altera/socfpga/socfpga_l3regs.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/altera/socfpga/socfpga_l3regs.hThu Sep 11 18:12:28 
2014(r271431)
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 2014 Ruslan Bukin b...@bsdpad.com
+ * All rights reserved.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
+ * (CTSRD), as part of the DARPA CRASH research programme.
+ *
+ * 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$
+ */
+
+#defineL3REGS_REMAP0x0 /* Remap */
+#define REMAP_LWHPS2FPGA   (1  4)
+#define REMAP_HPS2FPGA (1  3)
+#define REMAP_MPUZERO  (1  0)
+#defineL3REGS_L4MAIN   0x8 /* L4 main peripherals security 
*/
+#defineL3REGS_L4SP 0xC /* L4 SP Peripherals 

svn commit: r271432 - head/contrib/llvm/tools/clang/lib/CodeGen

2014-09-11 Thread Ed Maste
Author: emaste
Date: Thu Sep 11 18:19:08 2014
New Revision: 271432
URL: http://svnweb.freebsd.org/changeset/base/271432

Log:
  Merge upstream Clang rev 205331 debuginfo crash fix:
  
  Debug info: fix a crash when emitting IndirectFieldDecls, which were
  previously not handled at all.
  rdar://problem/16348575
  
  MFC after:1 week
  Sponsored by: DARPA, AFRL

Modified:
  head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp

Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
==
--- head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp   Thu Sep 11 
18:12:28 2014(r271431)
+++ head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp   Thu Sep 11 
18:19:08 2014(r271432)
@@ -1241,7 +1241,7 @@ CollectTemplateParams(const TemplatePara
 V = CGM.GetAddrOfFunction(FD);
   // Member data pointers have special handling too to compute the fixed
   // offset within the object.
-  if (isaFieldDecl(D)) {
+  if (isaFieldDecl(D) || isaIndirectFieldDecl(D)) {
 // These five lines ( possibly the above member function pointer
 // handling) might be able to be refactored to use similar code in
 // CodeGenModule::getMemberPointerConstant
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271433 - head/contrib/llvm/patches

2014-09-11 Thread Ed Maste
Author: emaste
Date: Thu Sep 11 18:20:49 2014
New Revision: 271433
URL: http://svnweb.freebsd.org/changeset/base/271433

Log:
  Add clang patch corresponding to r271432

Added:
  head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff

Added: 
head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff 
Thu Sep 11 18:20:49 2014(r271433)
@@ -0,0 +1,46 @@
+commit 96365aef99ec463375dfdaf6eb260823e0477b6a
+Author: Adrian Prantl apra...@apple.com
+Date:   Tue Apr 1 17:52:06 2014 +
+
+Debug info: fix a crash when emitting IndirectFieldDecls, which were
+previously not handled at all.
+rdar://problem/16348575
+
+git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205331 
91177308-0d34-0410-b5e6-96231b3b80d8
+
+diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
+index 82db942..2556cf9 100644
+--- tools/clang/lib/CodeGen/CGDebugInfo.cpp
 tools/clangb/lib/CodeGen/CGDebugInfo.cpp
+@@ -1252,7 +1252,7 @@ CollectTemplateParams(const TemplateParameterList 
*TPList,
+ V = CGM.GetAddrOfFunction(FD);
+   // Member data pointers have special handling too to compute the fixed
+   // offset within the object.
+-  if (isaFieldDecl(D)) {
++  if (isaFieldDecl(D) || isaIndirectFieldDecl(D)) {
+ // These five lines ( possibly the above member function pointer
+ // handling) might be able to be refactored to use similar code in
+ // CodeGenModule::getMemberPointerConstant
+diff --git a/test/CodeGenCXX/debug-info-indirect-field-decl.cpp 
b/test/CodeGenCXX/debug-info-indirect-field-decl.cpp
+new file mode 100644
+index 000..131ceba
+--- /dev/null
 tools/clang/test/CodeGenCXX/debug-info-indirect-field-decl.cpp
+@@ -0,0 +1,17 @@
++// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | 
FileCheck %s
++//
++// Test that indirect field decls are handled gracefully.
++// rdar://problem/16348575
++//
++template class T, int T::*ptr class Foo {  };
++
++struct Bar {
++  int i1;
++  // CHECK: [ DW_TAG_member ] [line [[@LINE+1]], size 32, align 32, offset 
32] [from _ZTSN3BarUt_E]
++  union {
++// CHECK: [ DW_TAG_member ] [i2] [line [[@LINE+1]], size 32, align 32, 
offset 0] [from int]
++int i2;
++  };
++};
++
++FooBar, Bar::i2 the_foo;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271434 - head/etc

2014-09-11 Thread Warren Block
Author: wblock (doc committer)
Date: Thu Sep 11 18:24:16 2014
New Revision: 271434
URL: http://svnweb.freebsd.org/changeset/base/271434

Log:
  Update motd, clarifying the information and adding pointers to other
  resources.
  
  MFC after:3 days

Modified:
  head/etc/motd

Modified: head/etc/motd
==
--- head/etc/motd   Thu Sep 11 18:20:49 2014(r271433)
+++ head/etc/motd   Thu Sep 11 18:24:16 2014(r271434)
@@ -1,25 +1,21 @@
 FreeBSD ?.?.?  (UNKNOWN)
 
-Welcome to FreeBSD!
+Welcome to FreeBSD!  Handy technical support resources:
 
-Before seeking technical support, please use the following resources:
+Security advisories and errata: https://www.FreeBSD.org/releases/
+Handbook: https://www.FreeBSD.org/handbook/
+FAQ:  https://www.FreeBSD.org/faq/
+Mailing list: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
+Forums:   https://forums.FreeBSD.org/
+
+Documents installed with the system are in the /usr/local/share/doc/freebsd/
+directory, or can be installed later with:  pkg install en-freebsd-doc
+For other languages, replace en with a language code like de or fr.
 
-o  Security advisories and updated errata information for all releases are
-   at http://www.FreeBSD.org/releases/ - always consult the ERRATA section
-   for your release first as it's updated frequently.
-
-o  The Handbook and FAQ documents are at http://www.FreeBSD.org/ and,
-   along with the mailing lists, can be searched by going to
-   http://www.FreeBSD.org/search/.  If the doc package has been installed
-   (or fetched via pkg install lang-freebsd-doc, where lang is the
-   2-letter language code, e.g. en), they are also available formatted
-   in /usr/local/share/doc/freebsd.
-
-If you still have a question or problem, please take the output of
-`uname -a', along with any relevant error messages, and email it
-as a question to the questi...@freebsd.org mailing list.  If you are
-unfamiliar with FreeBSD's directory layout, please refer to the hier(7)
-manual page.  If you are not familiar with manual pages, type `man man'.
+Show the version of FreeBSD installed:  uname -a
+Please include that output and any error messages when posting questions.
 
-Edit /etc/motd to change this login announcement.
+Introduction to manual pages:  man man
+FreeBSD directory layout:  man hier
 
+Edit /etc/motd to change this login announcement.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271436 - head/usr.bin/rctl

2014-09-11 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Sep 11 19:54:30 2014
New Revision: 271436
URL: http://svnweb.freebsd.org/changeset/base/271436

Log:
  Fix typo.
  
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/rctl/rctl.8

Modified: head/usr.bin/rctl/rctl.8
==
--- head/usr.bin/rctl/rctl.8Thu Sep 11 18:42:51 2014(r271435)
+++ head/usr.bin/rctl/rctl.8Thu Sep 11 19:54:30 2014(r271436)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd February 16, 2014
+.Dd September 11, 2014
 .Dt RCTL 8
 .Os
 .Sh NAME
@@ -209,7 +209,7 @@ resource would be
 .Bl -column -offset 3n pseudoterminals
 .It Em action
 .It Sy deny Ta deny the allocation; not supported for
-.Sy cpu
+.Sy cputime
 and
 .Sy wallclock
 .It Sy log Ta log a warning to the console
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271437 - head/usr.sbin/iscsid

2014-09-11 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Sep 11 20:01:57 2014
New Revision: 271437
URL: http://svnweb.freebsd.org/changeset/base/271437

Log:
  Don't blindly assume the target agreed to transition to Full Feature Phase;
  if we got a Login Response PDU without the T bit set, try again with
  an empty request.  This fixes interoperability with COMSTAR.
  
  Reviewed by:  mav@
  Tested by:mav@
  MFC after:1 week

Modified:
  head/usr.sbin/iscsid/login.c

Modified: head/usr.sbin/iscsid/login.c
==
--- head/usr.sbin/iscsid/login.cThu Sep 11 19:54:30 2014
(r271436)
+++ head/usr.sbin/iscsid/login.cThu Sep 11 20:01:57 2014
(r271437)
@@ -575,7 +575,7 @@ login_negotiate(struct connection *conn)
struct pdu *request, *response;
struct keys *request_keys, *response_keys;
struct iscsi_bhs_login_response *bhslr;
-   int i;
+   int i, nrequests = 0;
 
log_debugx(beginning operational parameter negotiation);
request = login_new_request(conn, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
@@ -629,19 +629,41 @@ login_negotiate(struct connection *conn)
response_keys-keys_names[i], 
response_keys-keys_values[i]);
}
 
-   bhslr = (struct iscsi_bhs_login_response *)response-pdu_bhs;
-   if ((bhslr-bhslr_flags  BHSLR_FLAGS_TRANSIT) == 0)
-   log_warnx(received final login response 
-   without the \T\ flag);
-   else if (login_nsg(response) != BHSLR_STAGE_FULL_FEATURE_PHASE)
+   keys_delete(response_keys);
+   response_keys = NULL;
+
+   for (;;) {
+   bhslr = (struct iscsi_bhs_login_response *)response-pdu_bhs;
+   if ((bhslr-bhslr_flags  BHSLR_FLAGS_TRANSIT) != 0)
+   break;
+
+   nrequests++;
+   if (nrequests  5) {
+   log_warnx(received login response 
+   without the \T\ flag too many times; giving up);
+   break;
+   }
+
+   log_debugx(received login response 
+   without the \T\ flag; sending another request);
+
+   pdu_delete(response);
+
+   request = login_new_request(conn,
+   BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
+   pdu_send(request);
+   pdu_delete(request);
+
+   response = login_receive(conn);
+   }
+
+   if (login_nsg(response) != BHSLR_STAGE_FULL_FEATURE_PHASE)
log_warnx(received final login response with wrong NSG 0x%x,
login_nsg(response));
+   pdu_delete(response);
 
log_debugx(operational parameter negotiation done; 
transitioning to Full Feature phase);
-
-   keys_delete(response_keys);
-   pdu_delete(response);
 }
 
 static void
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271438 - in head: share/man/man9 sys/net sys/netinet sys/netinet6 sys/sys

2014-09-11 Thread Alan Somers
Author: asomers
Date: Thu Sep 11 20:21:03 2014
New Revision: 271438
URL: http://svnweb.freebsd.org/changeset/base/271438

Log:
  Revisions 264905 and 266860 added a int fib argument to ifa_ifwithnet and
  ifa_ifwithdstaddr. For the sake of backwards compatibility, the new
  arguments were added to new functions named ifa_ifwithnet_fib and
  ifa_ifwithdstaddr_fib, while the old functions became wrappers around the
  new ones that passed RT_ALL_FIBS for the fib argument. However, the
  backwards compatibility is not desired for FreeBSD 11, because there are
  numerous other incompatible changes to the ifnet(9) API. We therefore
  decided to remove it from head but leave it in place for stable/9 and
  stable/10. In addition, this commit adds the fib argument to
  ifa_ifwithbroadaddr for consistency's sake.
  
  sys/sys/param.h
Increment __FreeBSD_version
  
  sys/net/if.c
  sys/net/if_var.h
  sys/net/route.c
Add fibnum argument to ifa_ifwithbroadaddr, and remove the _fib
versions of ifa_ifwithdstaddr, ifa_ifwithnet, and ifa_ifwithroute.
  
  sys/net/route.c
  sys/net/rtsock.c
  sys/netinet/in_pcb.c
  sys/netinet/ip_options.c
  sys/netinet/ip_output.c
  sys/netinet6/nd6.c
Fixup calls of modified functions.
  
  share/man/man9/ifnet.9
Document changed API.
  
  CR:   https://reviews.freebsd.org/D458
  MFC after:Never
  Sponsored by: Spectra Logic

Modified:
  head/share/man/man9/ifnet.9
  head/sys/net/if.c
  head/sys/net/if_var.h
  head/sys/net/route.c
  head/sys/net/rtsock.c
  head/sys/netinet/in_pcb.c
  head/sys/netinet/ip_options.c
  head/sys/netinet/ip_output.c
  head/sys/netinet6/nd6.c
  head/sys/sys/param.h

Modified: head/share/man/man9/ifnet.9
==
--- head/share/man/man9/ifnet.9 Thu Sep 11 20:01:57 2014(r271437)
+++ head/share/man/man9/ifnet.9 Thu Sep 11 20:21:03 2014(r271438)
@@ -77,9 +77,9 @@
 .Ft struct ifaddr *
 .Fn ifa_ifwithaddr struct sockaddr *addr
 .Ft struct ifaddr *
-.Fn ifa_ifwithdstaddr struct sockaddr *addr
+.Fn ifa_ifwithdstaddr struct sockaddr *addr int fib
 .Ft struct ifaddr *
-.Fn ifa_ifwithnet struct sockaddr *addr int ignore_ptp
+.Fn ifa_ifwithnet struct sockaddr *addr int ignore_ptp int fib
 .Ft struct ifaddr *
 .Fn ifaof_ifpforaddr struct sockaddr *addr struct ifnet *ifp
 .Ft void
@@ -1389,7 +1389,16 @@ returns an interface address for a point
 remote
 .Pq Dq destination
 address is
-.Fa addr .
+.Fa addr
+and a fib is
+.Fa fib .
+If
+.Fa fib
+is
+.Dv RT_ALL_FIBS ,
+then the first interface address matching
+.Fa addr
+will be returned.
 .Pp
 .Fn ifa_ifwithnet
 returns the most specific interface address which matches the
@@ -1401,7 +1410,10 @@ address whose remote address is
 if one is found.
 If
 .Fa ignore_ptp
-is true, skip point-to-point interface addresses.
+is true, skip point-to-point interface addresses.  The 
+.Fa fib
+parameter is handled the same way as by
+.Fn ifa_ifwithdstaddr .
 .Pp
 .Fn ifaof_ifpforaddr
 returns the most specific address configured on interface

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Thu Sep 11 20:01:57 2014(r271437)
+++ head/sys/net/if.c   Thu Sep 11 20:21:03 2014(r271438)
@@ -1694,13 +1694,15 @@ ifa_ifwithaddr_check(struct sockaddr *ad
  */
 /* ARGSUSED */
 struct ifaddr *
-ifa_ifwithbroadaddr(struct sockaddr *addr)
+ifa_ifwithbroadaddr(struct sockaddr *addr, int fibnum)
 {
struct ifnet *ifp;
struct ifaddr *ifa;
 
IFNET_RLOCK_NOSLEEP();
TAILQ_FOREACH(ifp, V_ifnet, if_link) {
+   if ((fibnum != RT_ALL_FIBS)  (ifp-if_fib != fibnum))
+   continue;
IF_ADDR_RLOCK(ifp);
TAILQ_FOREACH(ifa, ifp-if_addrhead, ifa_link) {
if (ifa-ifa_addr-sa_family != addr-sa_family)
@@ -1727,7 +1729,7 @@ done:
  */
 /*ARGSUSED*/
 struct ifaddr *
-ifa_ifwithdstaddr_fib(struct sockaddr *addr, int fibnum)
+ifa_ifwithdstaddr(struct sockaddr *addr, int fibnum)
 {
struct ifnet *ifp;
struct ifaddr *ifa;
@@ -1757,19 +1759,12 @@ done:
return (ifa);
 }
 
-struct ifaddr *
-ifa_ifwithdstaddr(struct sockaddr *addr)
-{
-
-   return (ifa_ifwithdstaddr_fib(addr, RT_ALL_FIBS));
-}
-
 /*
  * Find an interface on a specific network.  If many, choice
  * is most specific found.
  */
 struct ifaddr *
-ifa_ifwithnet_fib(struct sockaddr *addr, int ignore_ptp, int fibnum)
+ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp, int fibnum)
 {
struct ifnet *ifp;
struct ifaddr *ifa;
@@ -1867,13 +1862,6 @@ done:
return (ifa);
 }
 
-struct ifaddr *
-ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp)
-{
-
-   return (ifa_ifwithnet_fib(addr, ignore_ptp, RT_ALL_FIBS));
-}
-
 /*
  * Find an interface address specific to an interface best matching
  * a given address.

Modified: 

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

2014-09-11 Thread Neel Natu
Author: neel
Date: Thu Sep 11 21:15:20 2014
New Revision: 271439
URL: http://svnweb.freebsd.org/changeset/base/271439

Log:
  Initialize 'bc_rdonly' to the right value.
  
  Note that independent of this change a readonly disk file would still be
  opened O_RDONLY and protected from writes by the guest.
  
  Reviewed by:  grehan

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

Modified: head/usr.sbin/bhyve/block_if.c
==
--- head/usr.sbin/bhyve/block_if.c  Thu Sep 11 20:21:03 2014
(r271438)
+++ head/usr.sbin/bhyve/block_if.c  Thu Sep 11 21:15:20 2014
(r271439)
@@ -278,6 +278,7 @@ blockif_open(const char *optstr, const c
 
bc-bc_magic = BLOCKIF_SIG;
bc-bc_fd = fd;
+   bc-bc_rdonly = ro;
bc-bc_size = size;
bc-bc_sectsz = sectsz;
pthread_mutex_init(bc-bc_mtx, NULL);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271442 - head/sys/geom

2014-09-11 Thread Sean Bruno
Author: sbruno
Date: Thu Sep 11 22:39:27 2014
New Revision: 271442
URL: http://svnweb.freebsd.org/changeset/base/271442

Log:
  Add device name used in geom_map verbose output.  This helps when using
  geom_map with multiple flash/spi devices.
  
  Phabric:  https://reviews.freebsd.org/D766
  Reviewed by:  adrian
  MFC after:2 weeks

Modified:
  head/sys/geom/geom_map.c

Modified: head/sys/geom/geom_map.c
==
--- head/sys/geom/geom_map.cThu Sep 11 21:40:32 2014(r271441)
+++ head/sys/geom/geom_map.cThu Sep 11 22:39:27 2014(r271442)
@@ -153,8 +153,8 @@ find_marker(struct g_consumer *cp, const
return (1);
 
if (bootverbose) {
-   printf(MAP: search key \%s\ from 0x%jx, step 0x%jx\n,
-   search_key, (intmax_t)search_start, (intmax_t)search_step);
+   printf(MAP: search %s for key \%s\ from 0x%jx, step 0x%jx\n,
+   cp-geom-name, search_key, (intmax_t)search_start, 
(intmax_t)search_step);
}
 
/* error if search_key is empty */
@@ -321,9 +321,9 @@ g_map_parse_part(struct g_class *mp, str
}
 
if (bootverbose) {
-   printf(MAP: %jxx%jx, data=%jxx%jx 
+   printf(MAP: %s: %jxx%jx, data=%jxx%jx 
\/dev/map/%s\\n,
-   (intmax_t)start, (intmax_t)size, (intmax_t)offset,
+   cp-geom-name, (intmax_t)start, (intmax_t)size, 
(intmax_t)offset,
(intmax_t)dsize, name);
}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271443 - in head/sys/cam: ctl scsi

2014-09-11 Thread Alexander Motin
Author: mav
Date: Thu Sep 11 22:40:11 2014
New Revision: 271443
URL: http://svnweb.freebsd.org/changeset/base/271443

Log:
  Add support for Extended INQUIRY Data (0x86) VPD page.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Thu Sep 11 22:39:27 2014(r271442)
+++ head/sys/cam/ctl/ctl.c  Thu Sep 11 22:40:11 2014(r271443)
@@ -320,11 +320,11 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verb
 
 /*
  * Supported pages (0x00), Serial number (0x80), Device ID (0x83),
- * Mode Page Policy (0x87),
+ * Extended INQUIRY Data (0x86), Mode Page Policy (0x87),
  * SCSI Ports (0x88), Third-party Copy (0x8F), Block limits (0xB0),
  * Block Device Characteristics (0xB1) and Logical Block Provisioning (0xB2)
  */
-#define SCSI_EVPD_NUM_SUPPORTED_PAGES  9
+#define SCSI_EVPD_NUM_SUPPORTED_PAGES  10
 
 static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event,
  int param);
@@ -380,6 +380,7 @@ static void ctl_hndl_per_res_out_on_othe
 static int ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len);
 static int ctl_inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len);
 static int ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len);
+static int ctl_inquiry_evpd_eid(struct ctl_scsiio *ctsio, int alloc_len);
 static int ctl_inquiry_evpd_mpp(struct ctl_scsiio *ctsio, int alloc_len);
 static int ctl_inquiry_evpd_scsi_ports(struct ctl_scsiio *ctsio,
 int alloc_len);
@@ -9838,18 +9839,20 @@ ctl_inquiry_evpd_supported(struct ctl_sc
pages-page_list[1] = SVPD_UNIT_SERIAL_NUMBER;
/* Device Identification */
pages-page_list[2] = SVPD_DEVICE_ID;
+   /* Extended INQUIRY Data */
+   pages-page_list[3] = SVPD_EXTENDED_INQUIRY_DATA;
/* Mode Page Policy */
-   pages-page_list[3] = SVPD_MODE_PAGE_POLICY;
+   pages-page_list[4] = SVPD_MODE_PAGE_POLICY;
/* SCSI Ports */
-   pages-page_list[4] = SVPD_SCSI_PORTS;
+   pages-page_list[5] = SVPD_SCSI_PORTS;
/* Third-party Copy */
-   pages-page_list[5] = SVPD_SCSI_TPC;
+   pages-page_list[6] = SVPD_SCSI_TPC;
/* Block limits */
-   pages-page_list[6] = SVPD_BLOCK_LIMITS;
+   pages-page_list[7] = SVPD_BLOCK_LIMITS;
/* Block Device Characteristics */
-   pages-page_list[7] = SVPD_BDC;
+   pages-page_list[8] = SVPD_BDC;
/* Logical Block Provisioning */
-   pages-page_list[8] = SVPD_LBP;
+   pages-page_list[9] = SVPD_LBP;
 
ctsio-scsi_status = SCSI_STATUS_OK;
 
@@ -9918,6 +9921,57 @@ ctl_inquiry_evpd_serial(struct ctl_scsii
 
 
 static int
+ctl_inquiry_evpd_eid(struct ctl_scsiio *ctsio, int alloc_len)
+{
+   struct scsi_vpd_extended_inquiry_data *eid_ptr;
+   struct ctl_lun *lun;
+   int data_len;
+
+   lun = (struct ctl_lun *)ctsio-io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
+
+   data_len = sizeof(struct scsi_vpd_mode_page_policy) +
+   sizeof(struct scsi_vpd_mode_page_policy_descr);
+
+   ctsio-kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
+   eid_ptr = (struct scsi_vpd_extended_inquiry_data *)ctsio-kern_data_ptr;
+   ctsio-kern_sg_entries = 0;
+
+   if (data_len  alloc_len) {
+   ctsio-residual = alloc_len - data_len;
+   ctsio-kern_data_len = data_len;
+   ctsio-kern_total_len = data_len;
+   } else {
+   ctsio-residual = 0;
+   ctsio-kern_data_len = alloc_len;
+   ctsio-kern_total_len = alloc_len;
+   }
+   ctsio-kern_data_resid = 0;
+   ctsio-kern_rel_offset = 0;
+   ctsio-kern_sg_entries = 0;
+
+   /*
+* The control device is always connected.  The disk device, on the
+* other hand, may not be online all the time.
+*/
+   if (lun != NULL)
+   eid_ptr-device = (SID_QUAL_LU_CONNECTED  5) |
+lun-be_lun-lun_type;
+   else
+   eid_ptr-device = (SID_QUAL_LU_OFFLINE  5) | T_DIRECT;
+   eid_ptr-page_code = SVPD_EXTENDED_INQUIRY_DATA;
+   eid_ptr-page_length = data_len - 4;
+   eid_ptr-flags2 = SVPD_EID_HEADSUP | SVPD_EID_ORDSUP | SVPD_EID_SIMPSUP;
+   eid_ptr-flags3 = SVPD_EID_V_SUP;
+
+   ctsio-scsi_status = SCSI_STATUS_OK;
+   ctsio-io_hdr.flags |= CTL_FLAG_ALLOCATED;
+   ctsio-be_move_done = ctl_config_move_done;
+   ctl_datamove((union ctl_io *)ctsio);
+
+   return (CTL_RETVAL_COMPLETE);
+}
+
+static int
 ctl_inquiry_evpd_mpp(struct ctl_scsiio *ctsio, int alloc_len)
 {
struct scsi_vpd_mode_page_policy *mpp_ptr;
@@ -10399,6 +10453,9 @@ ctl_inquiry_evpd(struct ctl_scsiio *ctsi
case SVPD_DEVICE_ID:
retval = ctl_inquiry_evpd_devid(ctsio, alloc_len);
break;

svn commit: r271445 - head/usr.sbin/ctld

2014-09-11 Thread Allan Jude
Author: allanjude (doc committer)
Date: Fri Sep 12 00:08:19 2014
New Revision: 271445
URL: http://svnweb.freebsd.org/changeset/base/271445

Log:
  Improve markup and language throughout the ctl.conf man page
  
  Reviewed by:  trasz
  Approved by:  bcr (mentor)
  Sponsored by: ScaleEngine Inc.

Modified:
  head/usr.sbin/ctld/ctl.conf.5

Modified: head/usr.sbin/ctld/ctl.conf.5
==
--- head/usr.sbin/ctld/ctl.conf.5   Fri Sep 12 00:05:15 2014
(r271444)
+++ head/usr.sbin/ctld/ctl.conf.5   Fri Sep 12 00:08:19 2014
(r271445)
@@ -27,7 +27,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd September 5, 2014
+.Dd September 11, 2014
 .Dt CTL.CONF 5
 .Os
 .Sh NAME
@@ -46,181 +46,248 @@ The general syntax of the
 .Nm
 file is:
 .Bd -literal -offset indent
-pidfile path
+.No pidfile Ar path
 
-auth-group name {
-   chap user secret
-   ...
+.No auth-group Ar name No {
+.Dl chap Ar user Ar secret
+.Dl ...
 }
 
-portal-group name {
-   listen address
-   listen-iser address
-   discovery-auth-group name
-   ...
+.No portal-group Ar name No {
+.Dl listen Ar address
+.Dl listen-iser Ar address
+.Dl discovery-auth-group Ar name
+.Dl ...
 }
 
-target name {
-   auth-group name
-   portal-group name
-   lun number {
-   path path
-   }
-   ...
+.No target Ar name {
+.Dl auth-group Ar name
+.Dl portal-group Ar name
+.Dl lun Ar number No {
+.Dlpath Ar path
+.Dl }
+.Dl ...
 }
 .Ed
-.Ss global level
-The following statements are available at the global level:
+.Ss Global Context
 .Bl -tag -width indent
-.It Ic auth-group Aq Ar name
-Opens an auth-group section, defining an authentication group,
+.It Ic auth-group Ar name
+Create an
+.Sy auth-group
+configuration context,
 which can then be assigned to any number of targets.
-.It Ic debug Aq Ar level
-Specifies debug level.
+.It Ic debug Ar level
+The debug verbosity level.
 The default is 0.
-.It Ic maxproc Aq Ar number
-Specifies limit for concurrently running child processes handling
+.It Ic maxproc Ar number
+The limit for concurrently running child processes handling
 incoming connections.
 The default is 30.
-Setting it to 0 disables the limit.
-.It Ic pidfile Aq Ar path
-Specifies path to pidfile.
+A setting of 0 disables the limit.
+.It Ic pidfile Ar path
+The path to the pidfile.
 The default is
 .Pa /var/run/ctld.pid .
-.It Ic portal-group Aq Ar name
-Opens a portal-group section, defining a portal group,
+.It Ic portal-group Ar name
+Create a
+.Sy portal-group
+configuration context,
 which can then be assigned to any number of targets.
-.It Ic target Aq Ar name
-Opens a target configuration section.
-.It Ic timeout Aq Ar seconds
-Specifies timeout for login session, after which the connection
+.It Ic target Ar name
+Create a
+.Sy target
+configuration context, which can contain one or more
+.Sy lun
+contexts.
+.It Ic timeout Ar seconds
+The timeout for login sessions, after which the connection
 will be forcibly terminated.
 The default is 60.
-Setting it to 0 disables the timeout.
+A setting of 0 disables the timeout.
 .El
-.Ss auth-group level
-The following statements are available at the auth-group level:
+.Ss auth-group Context
 .Bl -tag -width indent
-.It Ic auth-type Ao Ar type Ac
-Specifies authentication type.
-Type can be either none, deny, chap, or chap-mutual.
+
+.It Ic auth-type Ar type
+Sets the authentication type.
+Type can be either
+.Qq Ar none ,
+.Qq Ar deny ,
+.Qq Ar chap ,
+or
+.Qq Ar chap-mutual .
 In most cases it is not necessary to set the type using this clause;
-it is usually used to disable authentication for a given auth-group.
-.It Ic chap Ao Ar user Ac Aq Ar secret
-Specifies CHAP authentication credentials.
-.It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar 
mutualsecret
-Specifies mutual CHAP authentication credentials.
-Note that for any auth-group, configuration may contain either chap,
-or chap-mutual entries; it is an error to mix them.
-.It Ic initiator-name Ao Ar initiator-name Ac
-Specifies iSCSI initiator name.
+it is usually used to disable authentication for a given
+.Sy auth-group .
+.It Ic chap Ar user Ar secret
+A set of CHAP authentication credentials.
+Note that for any
+.Sy auth-group ,
+the configuration may only contain either
+.Sy chap
+or
+.Sy chap-mutual
+entries; it is an error to mix them.
+.It Ic chap-mutual Ar user Ar secret Ar mutualuser Ar mutualsecret
+A set of mutual CHAP authentication credentials.
+Note that for any
+.Sy auth-group ,
+the configuration may only contain either
+.Sy chap
+or
+.Sy chap-mutual
+entries; it is an error to mix them.
+.It Ic initiator-name Ar initiator-name
+An iSCSI initiator name.
+Only initiators with a name matching one of the defined
+names will be allowed to connect.
 If not defined, there will be no restrictions based on initiator
 name.
-Otherwise, only initiators with names matching one of defined
-ones will 

Re: svn commit: r271424 - in head: etc etc/defaults share/man/man5

2014-09-11 Thread Bryan Drewery
On 9/11/2014 7:30 AM, Hiroki Sato wrote:
 Author: hrs
 Date: Thu Sep 11 12:30:29 2014
 New Revision: 271424
 URL: http://svnweb.freebsd.org/changeset/base/271424
 
 Log:
   - Add $netif_ipexpand_max to specify the upper limit for the number of
 addresses generated by an address range specification.  The default
 value is 2048.  This can be increased by setting $netif_ipexpand_max
 in rc.conf.
   
   - Fix warning messages when an address range spec exceeds the upper limit.
   
   PR: 186841
 
 Modified:
   head/etc/defaults/rc.conf
   head/etc/network.subr
   head/share/man/man5/rc.conf.5

Thanks!


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r271446 - head/usr.sbin/ctld

2014-09-11 Thread Allan Jude
Author: allanjude (doc committer)
Date: Fri Sep 12 00:55:42 2014
New Revision: 271446
URL: http://svnweb.freebsd.org/changeset/base/271446

Log:
  Fix minor syntax error
  
  Submitted by: bjk
  Approved by:  bcr (mentor)
  Sponsored by: ScaleEngine Inc.

Modified:
  head/usr.sbin/ctld/ctl.conf.5

Modified: head/usr.sbin/ctld/ctl.conf.5
==
--- head/usr.sbin/ctld/ctl.conf.5   Fri Sep 12 00:08:19 2014
(r271445)
+++ head/usr.sbin/ctld/ctl.conf.5   Fri Sep 12 00:55:42 2014
(r271446)
@@ -188,7 +188,7 @@ By default, targets that do not specify 
 using clauses such as
 .Sy chap
 or
-. Sy initiator-name ,
+.Sy initiator-name ,
 are assigned
 predefined
 .Sy auth-group
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271447 - head/share/examples/bhyve

2014-09-11 Thread Craig Rodrigues
Author: rodrigc
Date: Fri Sep 12 02:38:10 2014
New Revision: 271447
URL: http://svnweb.freebsd.org/changeset/base/271447

Log:
  Attach the ISO to an ahci-cd emulated device.  The
  ISO will appear to be mounted on a /dev/cd device
  instead of /dev/vtbd.  This is similar to how other
  virtualization environments handle mounting ISO images.
  
  Reviewed by: neel

Modified:
  head/share/examples/bhyve/vmrun.sh

Modified: head/share/examples/bhyve/vmrun.sh
==
--- head/share/examples/bhyve/vmrun.sh  Fri Sep 12 00:55:42 2014
(r271446)
+++ head/share/examples/bhyve/vmrun.sh  Fri Sep 12 02:38:10 2014
(r271447)
@@ -196,7 +196,7 @@ while [ 1 ]; do
exit 1
fi
BOOTDISK=${isofile}
-   installer_opt=-s 31:0,virtio-blk,${BOOTDISK}
+   installer_opt=-s 31:0,ahci-cd,${BOOTDISK}
else
BOOTDISK=${virtio_diskdev}
installer_opt=
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271448 - head/usr.bin/mkimg

2014-09-11 Thread Marcel Moolenaar
Author: marcel
Date: Fri Sep 12 03:54:16 2014
New Revision: 271448
URL: http://svnweb.freebsd.org/changeset/base/271448

Log:
  Fix checksum calculation:
  1.  Iterate over all partitions counted in the label, which can be more
  than the number of partitions given to mkimg(1).
  2.  Start the checksum from the beginning of the label; not the beginning
  of the bootarea.
  
  Tested with bsdlabel(8).
  
  MFC after:3 days

Modified:
  head/usr.bin/mkimg/bsd.c

Modified: head/usr.bin/mkimg/bsd.c
==
--- head/usr.bin/mkimg/bsd.cFri Sep 12 02:38:10 2014(r271447)
+++ head/usr.bin/mkimg/bsd.cFri Sep 12 03:54:16 2014(r271448)
@@ -68,7 +68,7 @@ bsd_write(lba_t imgsz, void *bootcode)
struct disklabel *d;
struct partition *dp;
struct part *part;
-   int error, n;
+   int bsdparts, error, n;
uint16_t checksum;
 
buf = malloc(BBSIZE);
@@ -80,6 +80,9 @@ bsd_write(lba_t imgsz, void *bootcode)
} else
memset(buf, 0, BBSIZE);
 
+   bsdparts = nparts + 1;  /* Account for c partition */
+   if (bsdparts  MAXPARTITIONS)
+   bsdparts = MAXPARTITIONS;
imgsz = (lba_t)ncyls * nheads * nsecs;
error = image_set_size(imgsz);
if (error) {
@@ -97,7 +100,7 @@ bsd_write(lba_t imgsz, void *bootcode)
le32enc(d-d_secperunit, imgsz);
le16enc(d-d_rpm, 3600);
le32enc(d-d_magic2, DISKMAGIC);
-   le16enc(d-d_npartitions, (8  nparts + 1) ? 8 : nparts + 1);
+   le16enc(d-d_npartitions, bsdparts);
le32enc(d-d_bbsize, BBSIZE);
 
dp = d-d_partitions[RAW_PART];
@@ -110,9 +113,9 @@ bsd_write(lba_t imgsz, void *bootcode)
dp-p_fstype = ALIAS_TYPE2INT(part-type);
}
 
-   dp = d-d_partitions[nparts + 1];
+   dp = d-d_partitions[bsdparts];
checksum = 0;
-   for (p = buf; p  (u_char *)dp; p += 2)
+   for (p = (void *)d; p  (u_char *)dp; p += 2)
checksum ^= le16dec(p);
le16enc(d-d_checksum, checksum);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271449 - head/usr.bin/mkimg

2014-09-11 Thread Marcel Moolenaar
Author: marcel
Date: Fri Sep 12 04:15:35 2014
New Revision: 271449
URL: http://svnweb.freebsd.org/changeset/base/271449

Log:
  Be compatible with boot code that starts right after the disk label in
  the second sector by only clearing the amount of bytes needed for the
  disklabel in the second sector. Previously we were clearing exactly 1
  sector worth of bytes and as such writing over boot code that may have
  been there.
  Since we do support more than 8 partitions, make sure to set all fields
  in d_partitions. For the first 8 partitions this is unneeded, but for
  partitioons 9 and up this compensates for the fact that we don't clear
  an entire sector anymore.
  Obviously, one cannot use more than 8 partitions when using boot code
  that starts right after the disk label.
  
  Relevant GRNs:
  107879 - Employ unused bytes after the disklabel in the second sector.
  189500 - Revert the part of change 107879 that employs the unused bytes
 after the disklabel in the 2nd sector for boot code.
  
  Obtained from:Juniper Networks, Inc.
  MFC after:3 days

Modified:
  head/usr.bin/mkimg/bsd.c

Modified: head/usr.bin/mkimg/bsd.c
==
--- head/usr.bin/mkimg/bsd.cFri Sep 12 03:54:16 2014(r271448)
+++ head/usr.bin/mkimg/bsd.cFri Sep 12 04:15:35 2014(r271449)
@@ -76,7 +76,7 @@ bsd_write(lba_t imgsz, void *bootcode)
return (ENOMEM);
if (bootcode != NULL) {
memcpy(buf, bootcode, BBSIZE);
-   memset(buf + secsz, 0, secsz);
+   memset(buf + secsz, 0, sizeof(struct disklabel));
} else
memset(buf, 0, BBSIZE);
 
@@ -110,7 +110,10 @@ bsd_write(lba_t imgsz, void *bootcode)
dp = d-d_partitions[n];
le32enc(dp-p_size, part-size);
le32enc(dp-p_offset, part-block);
+   le32enc(dp-p_fsize, 0);
dp-p_fstype = ALIAS_TYPE2INT(part-type);
+   dp-p_frag = 0;
+   le16enc(dp-p_cpg, 0);
}
 
dp = d-d_partitions[bsdparts];
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r271450 - in head: share/man/man4 sys/dev/cxgbe

2014-09-11 Thread Navdeep Parhar
Author: np
Date: Fri Sep 12 05:25:56 2014
New Revision: 271450
URL: http://svnweb.freebsd.org/changeset/base/271450

Log:
  cxgbe(4): knobs to enable/disable PAUSE frame based flow control.
  
  MFC after:1 week

Modified:
  head/share/man/man4/cxgbe.4
  head/sys/dev/cxgbe/t4_main.c

Modified: head/share/man/man4/cxgbe.4
==
--- head/share/man/man4/cxgbe.4 Fri Sep 12 04:15:35 2014(r271449)
+++ head/share/man/man4/cxgbe.4 Fri Sep 12 05:25:56 2014(r271450)
@@ -240,8 +240,19 @@ The default is -1 which lets the driver 
 Controls the hardware response to congestion.
 -1 disables congestion feedback and is not recommended.
 0 instructs the hardware to backpressure its pipeline on congestion.
-This usually results in the port emitting pause frames.
+This usually results in the port emitting PAUSE frames.
 1 instructs the hardware to drop frames destined for congested queues.
+.It Va hw.cxgbe.pause_settings
+PAUSE frame settings.
+Bit 0 is rx_pause, bit 1 is tx_pause.
+rx_pause = 1 instructs the hardware to heed incoming PAUSE frames, 0 instructs
+it to ignore them.
+tx_pause = 1 allows the hardware to emit PAUSE frames when its receive FIFO
+reaches a high threshold, 0 prohibits the hardware from emitting PAUSE frames.
+The default is 3 (both rx_pause and tx_pause = 1).
+This tunable establishes the default PAUSE settings for all ports.
+Settings can be displayed and controlled on a per-port basis via the
+dev.cxgbe.X.pause_settings (dev.cxl.X.pause_settings for T5 cards) sysctl.
 .It Va hw.cxgbe.buffer_packing
 Allow the hardware to deliver multiple frames in the same receive buffer
 opportunistically.

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cFri Sep 12 04:15:35 2014
(r271449)
+++ head/sys/dev/cxgbe/t4_main.cFri Sep 12 05:25:56 2014
(r271450)
@@ -281,6 +281,15 @@ static char t4_cfg_file[32] = DEFAULT_CF
 TUNABLE_STR(hw.cxgbe.config_file, t4_cfg_file, sizeof(t4_cfg_file));
 
 /*
+ * PAUSE settings (bit 0, 1 = rx_pause, tx_pause respectively).
+ * rx_pause = 1 to heed incoming PAUSE frames, 0 to ignore them.
+ * tx_pause = 1 to emit PAUSE frames when the rx FIFO reaches its high water
+ *mark or when signalled to do so, 0 to never emit PAUSE.
+ */
+static int t4_pause_settings = PAUSE_TX | PAUSE_RX;
+TUNABLE_INT(hw.cxgbe.pause_settings, t4_pause_settings);
+
+/*
  * Firmware auto-install by driver during attach (0, 1, 2 = prohibited, 
allowed,
  * encouraged respectively).
  */
@@ -393,6 +402,7 @@ static int sysctl_holdoff_tmr_idx(SYSCTL
 static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS);
 static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS);
 static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS);
+static int sysctl_pause_settings(SYSCTL_HANDLER_ARGS);
 static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS);
 static int sysctl_temperature(SYSCTL_HANDLER_ARGS);
 #ifdef SBUF_DRAIN
@@ -697,6 +707,12 @@ t4_attach(device_t dev)
sc-port[i] = NULL;
goto done;
}
+
+   pi-link_cfg.requested_fc = ~(PAUSE_TX | PAUSE_RX);
+   pi-link_cfg.requested_fc |= t4_pause_settings;
+   pi-link_cfg.fc = ~(PAUSE_TX | PAUSE_RX);
+   pi-link_cfg.fc |= t4_pause_settings;
+
rc = -t4_link_start(sc, sc-mbox, pi-tx_chan, pi-link_cfg);
if (rc != 0) {
device_printf(dev, port %d l1cfg failed: %d\n, i, rc);
@@ -4771,6 +4787,10 @@ cxgbe_sysctls(struct port_info *pi)
CTLTYPE_INT | CTLFLAG_RW, pi, 0, sysctl_qsize_txq, I,
tx queue size);
 
+   SYSCTL_ADD_PROC(ctx, children, OID_AUTO, pause_settings,
+   CTLTYPE_STRING | CTLFLAG_RW, pi, PAUSE_TX, sysctl_pause_settings,
+   A, PAUSE settings (bit 0 = rx_pause, bit 1 = tx_pause));
+
/*
 * dev.cxgbe.X.stats.
 */
@@ -5152,6 +5172,65 @@ sysctl_qsize_txq(SYSCTL_HANDLER_ARGS)
 }
 
 static int
+sysctl_pause_settings(SYSCTL_HANDLER_ARGS)
+{
+   struct port_info *pi = arg1;
+   struct adapter *sc = pi-adapter;
+   struct link_config *lc = pi-link_cfg;
+   int rc;
+
+   if (req-newptr == NULL) {
+   struct sbuf *sb;
+   static char *bits = \20\1PAUSE_RX\2PAUSE_TX;
+
+   rc = sysctl_wire_old_buffer(req, 0);
+   if (rc != 0)
+   return(rc);
+
+   sb = sbuf_new_for_sysctl(NULL, NULL, 128, req);
+   if (sb == NULL)
+   return (ENOMEM);
+
+   sbuf_printf(sb, %b, lc-fc  (PAUSE_TX | PAUSE_RX), bits);
+   rc = sbuf_finish(sb);
+   sbuf_delete(sb);
+   } else {
+   char s[2];
+   int n;
+
+   s[0] = '0' + (lc-requested_fc  (PAUSE_TX |