svn commit: r271742 - stable/7/share/mk

2014-09-17 Thread Dimitry Andric
Author: dim
Date: Thu Sep 18 06:47:48 2014
New Revision: 271742
URL: http://svnweb.freebsd.org/changeset/base/271742

Log:
  MFC r257658 (modified to apply to stable/7):
  
  For C++ programs, don't emit any explicit dependency to libstdc++.a or
  libc++.a during the early build stages (bootstrap-tools, build-tools,
  cross-tools), since it is not possible to know in advance which C++
  library is available on the host system.
  
  Instead, just use the bootstrap compiler's built-in default.  This
  should eventually make it possible to build stable/9 on head, or on
  stable/10, which ship without libstdc++ by default.
  
  [Note: this should get the stable/7 tinderbox at least a bit further in
  buildworld.]

Modified:
  stable/7/share/mk/bsd.prog.mk
Directory Properties:
  stable/7/share/mk/   (props changed)

Modified: stable/7/share/mk/bsd.prog.mk
==
--- stable/7/share/mk/bsd.prog.mk   Thu Sep 18 06:45:43 2014
(r271741)
+++ stable/7/share/mk/bsd.prog.mk   Thu Sep 18 06:47:48 2014
(r271742)
@@ -126,7 +126,7 @@ _EXTRADEPEND:
 .endif
 .else
echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE}
-.if defined(PROG_CXX)
+.if defined(PROG_CXX) && !defined(BOOTSTRAPPING)
echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE}
 .endif
 .endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271741 - stable/8/share/mk

2014-09-17 Thread Dimitry Andric
Author: dim
Date: Thu Sep 18 06:45:43 2014
New Revision: 271741
URL: http://svnweb.freebsd.org/changeset/base/271741

Log:
  Fixup mergeinfo after r271740.

Modified:
Directory Properties:
  stable/8/share/mk/   (props changed)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271740 - stable/8/share/mk

2014-09-17 Thread Dimitry Andric
Author: dim
Date: Thu Sep 18 06:40:53 2014
New Revision: 271740
URL: http://svnweb.freebsd.org/changeset/base/271740

Log:
  MFC r257658 (modified to apply to stable/8):
  
  For C++ programs, don't emit any explicit dependency to libstdc++.a or
  libc++.a during the early build stages (bootstrap-tools, build-tools,
  cross-tools), since it is not possible to know in advance which C++
  library is available on the host system.
  
  Instead, just use the bootstrap compiler's built-in default.  This
  should eventually make it possible to build stable/9 on head, or on
  stable/10, which ship without libstdc++ by default.
  
  [Note: this should get the stable/8 tinderbox at least a bit further in
  buildworld.]

Modified:
  stable/8/share/mk/bsd.prog.mk

Modified: stable/8/share/mk/bsd.prog.mk
==
--- stable/8/share/mk/bsd.prog.mk   Thu Sep 18 06:34:27 2014
(r271739)
+++ stable/8/share/mk/bsd.prog.mk   Thu Sep 18 06:40:53 2014
(r271740)
@@ -134,7 +134,7 @@ _EXTRADEPEND:
 .endif
 .else
echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE}
-.if defined(PROG_CXX)
+.if defined(PROG_CXX) && !defined(BOOTSTRAPPING)
echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE}
 .endif
 .endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271739 - stable/10/contrib/llvm/lib/Target/X86

2014-09-17 Thread Dimitry Andric
Author: dim
Date: Thu Sep 18 06:34:27 2014
New Revision: 271739
URL: http://svnweb.freebsd.org/changeset/base/271739

Log:
  MFC r271597:
  
  Pull in r217410 from upstream llvm trunk (by Bob Wilson):
  
Set trunc store action to Expand for all X86 targets.
  
When compiling without SSE2, isTruncStoreLegal(F64, F32) would return
Legal, whereas with SSE2 it would return Expand. And since the Target
doesn't seem to actually handle a truncstore for double -> float, it
would just output a store of a full double in the space for a float
hence overwriting other bits on the stack.
  
Patch by Luqman Aden!
  
  This should fix clang -O0 on i386 assigning garbage to floats, in
  certain scenarios.
  
  PR:   187437
  Submitted by: c...@gmail.com
  Approved by:  re (marius)
  Obtained from:http://llvm.org/viewvc/llvm-project?rev=217410&view=rev

Modified:
  stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
==
--- stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp   Thu Sep 18 
05:43:19 2014(r271738)
+++ stable/10/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp   Thu Sep 18 
06:34:27 2014(r271739)
@@ -300,6 +300,8 @@ void X86TargetLowering::resetOperationAc
   setTruncStoreAction(MVT::i32, MVT::i8 , Expand);
   setTruncStoreAction(MVT::i16, MVT::i8,  Expand);
 
+  setTruncStoreAction(MVT::f64, MVT::f32, Expand);
+
   // SETOEQ and SETUNE require checking two conditions.
   setCondCodeAction(ISD::SETOEQ, MVT::f32, Expand);
   setCondCodeAction(ISD::SETOEQ, MVT::f64, Expand);
@@ -1011,8 +1013,6 @@ void X86TargetLowering::resetOperationAc
   AddPromotedToType (ISD::SELECT, VT, MVT::v2i64);
 }
 
-setTruncStoreAction(MVT::f64, MVT::f32, Expand);
-
 // Custom lower v2i64 and v2f64 selects.
 setOperationAction(ISD::LOAD,   MVT::v2f64, Legal);
 setOperationAction(ISD::LOAD,   MVT::v2i64, Legal);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2014-09-17 Thread Kevin Lo
On Thu, Sep 18, 2014 at 09:18:34AM +0400, Gleb Smirnoff wrote:
> 
> On Thu, Sep 18, 2014 at 03:09:35AM +, Marcelo Araujo wrote:
> M> Author: araujo (ports committer)
> M> Date: Thu Sep 18 03:09:34 2014
> M> New Revision: 271735
> M> URL: http://svnweb.freebsd.org/changeset/base/271735
> M> 
> M> Log:
> M>   Remove old comment, we already do 802.1q tagging.
> 
> But the comment speaks about 802.1p priority tagging, which
> we do not support. So the comment was absolutely correct.
> 
> I'd prefer to see patch reverted.

Sorry, I overlooked that.  Marcelo has a patch with 802.1p tagging support,
I thought the patch was committed.

> M>   Phabric: D797
> M>   Reviewed by: kevlo
> M>   Approved by: kevlo
> M>   Sponsored by:QNAP Systems Inc.
> M> 
> M> Modified:
> M>   head/sys/net/if_vlan.c
> M> 
> M> Modified: head/sys/net/if_vlan.c
> M> 
> ==
> M> --- head/sys/net/if_vlan.c Thu Sep 18 03:02:00 2014(r271734)
> M> +++ head/sys/net/if_vlan.c Thu Sep 18 03:09:34 2014(r271735)
> M> @@ -29,8 +29,7 @@
> M>  
> M>  /*
> M>   * if_vlan.c - pseudo-device driver for IEEE 802.1Q virtual LANs.
> M> - * Might be extended some day to also handle IEEE 802.1p priority
> M> - * tagging.  This is sort of sneaky in the implementation, since
> M> + * This is sort of sneaky in the implementation, since
> M>   * we need to pretend to be enough of an Ethernet implementation
> M>   * to make arp work.  The way we do this is by telling everyone
> M>   * that we are an Ethernet, and then catch the packets that
> M> 
> 
> -- 
> Totus tuus, Glebius.

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


svn commit: r271738 - head/sys/net

2014-09-17 Thread Marcelo Araujo
Author: araujo (ports committer)
Date: Thu Sep 18 05:43:19 2014
New Revision: 271738
URL: http://svnweb.freebsd.org/changeset/base/271738

Log:
  Revert r271735. The comment is absolutely correct, we do not support 802.1p 
priority tagging. I got confused with the packet tagged and packet to be tagged.
  
  Spotted by:   glebius

Modified:
  head/sys/net/if_vlan.c

Modified: head/sys/net/if_vlan.c
==
--- head/sys/net/if_vlan.c  Thu Sep 18 05:40:33 2014(r271737)
+++ head/sys/net/if_vlan.c  Thu Sep 18 05:43:19 2014(r271738)
@@ -29,7 +29,8 @@
 
 /*
  * if_vlan.c - pseudo-device driver for IEEE 802.1Q virtual LANs.
- * This is sort of sneaky in the implementation, since
+ * Might be extended some day to also handle IEEE 802.1p priority
+ * tagging.  This is sort of sneaky in the implementation, since
  * we need to pretend to be enough of an Ethernet implementation
  * to make arp work.  The way we do this is by telling everyone
  * that we are an Ethernet, and then catch the packets that
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271737 - stable/9/contrib/llvm/lib/Target/X86

2014-09-17 Thread Dimitry Andric
Author: dim
Date: Thu Sep 18 05:40:33 2014
New Revision: 271737
URL: http://svnweb.freebsd.org/changeset/base/271737

Log:
  MFC r271597:
  
  Pull in r217410 from upstream llvm trunk (by Bob Wilson):
  
Set trunc store action to Expand for all X86 targets.
  
When compiling without SSE2, isTruncStoreLegal(F64, F32) would return
Legal, whereas with SSE2 it would return Expand. And since the Target
doesn't seem to actually handle a truncstore for double -> float, it
would just output a store of a full double in the space for a float
hence overwriting other bits on the stack.
  
Patch by Luqman Aden!
  
  This should fix clang -O0 on i386 assigning garbage to floats, in
  certain scenarios.
  
  PR:   187437
  Submitted by: c...@gmail.com
  Obtained from:http://llvm.org/viewvc/llvm-project?rev=217410&view=rev

Modified:
  stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
Directory Properties:
  stable/9/contrib/llvm/   (props changed)

Modified: stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
==
--- stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cppThu Sep 18 
03:11:59 2014(r271736)
+++ stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cppThu Sep 18 
05:40:33 2014(r271737)
@@ -300,6 +300,8 @@ void X86TargetLowering::resetOperationAc
   setTruncStoreAction(MVT::i32, MVT::i8 , Expand);
   setTruncStoreAction(MVT::i16, MVT::i8,  Expand);
 
+  setTruncStoreAction(MVT::f64, MVT::f32, Expand);
+
   // SETOEQ and SETUNE require checking two conditions.
   setCondCodeAction(ISD::SETOEQ, MVT::f32, Expand);
   setCondCodeAction(ISD::SETOEQ, MVT::f64, Expand);
@@ -1011,8 +1013,6 @@ void X86TargetLowering::resetOperationAc
   AddPromotedToType (ISD::SELECT, VT, MVT::v2i64);
 }
 
-setTruncStoreAction(MVT::f64, MVT::f32, Expand);
-
 // Custom lower v2i64 and v2f64 selects.
 setOperationAction(ISD::LOAD,   MVT::v2f64, Legal);
 setOperationAction(ISD::LOAD,   MVT::v2i64, Legal);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2014-09-17 Thread Marcelo Araujo
2014-09-18 13:18 GMT+08:00 Gleb Smirnoff :

> On Thu, Sep 18, 2014 at 03:09:35AM +, Marcelo Araujo wrote:
> M> Author: araujo (ports committer)
> M> Date: Thu Sep 18 03:09:34 2014
> M> New Revision: 271735
> M> URL: http://svnweb.freebsd.org/changeset/base/271735
> M>
> M> Log:
> M>   Remove old comment, we already do 802.1q tagging.
>
> But the comment speaks about 802.1p priority tagging, which
> we do not support. So the comment was absolutely correct.
>
> I'd prefer to see patch reverted.
>

Hello Glebs,

I got confused with the packet tagged and packet to be tagged. My mistake,
I'm gonna revert this revision.

My apologies for the wrong explanation to Kevin.

Thanks Glebs.


> --
>
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2014-09-17 Thread Gleb Smirnoff
On Thu, Sep 18, 2014 at 03:09:35AM +, Marcelo Araujo wrote:
M> Author: araujo (ports committer)
M> Date: Thu Sep 18 03:09:34 2014
M> New Revision: 271735
M> URL: http://svnweb.freebsd.org/changeset/base/271735
M> 
M> Log:
M>   Remove old comment, we already do 802.1q tagging.

But the comment speaks about 802.1p priority tagging, which
we do not support. So the comment was absolutely correct.

I'd prefer to see patch reverted.

M>   Phabric:   D797
M>   Reviewed by:   kevlo
M>   Approved by:   kevlo
M>   Sponsored by:  QNAP Systems Inc.
M> 
M> Modified:
M>   head/sys/net/if_vlan.c
M> 
M> Modified: head/sys/net/if_vlan.c
M> 
==
M> --- head/sys/net/if_vlan.c   Thu Sep 18 03:02:00 2014(r271734)
M> +++ head/sys/net/if_vlan.c   Thu Sep 18 03:09:34 2014(r271735)
M> @@ -29,8 +29,7 @@
M>  
M>  /*
M>   * if_vlan.c - pseudo-device driver for IEEE 802.1Q virtual LANs.
M> - * Might be extended some day to also handle IEEE 802.1p priority
M> - * tagging.  This is sort of sneaky in the implementation, since
M> + * This is sort of sneaky in the implementation, since
M>   * we need to pretend to be enough of an Ethernet implementation
M>   * to make arp work.  The way we do this is by telling everyone
M>   * that we are an Ethernet, and then catch the packets that
M> 

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


svn commit: r271736 - head/usr.sbin/makefs

2014-09-17 Thread Davide Italiano
Author: davide
Date: Thu Sep 18 03:11:59 2014
New Revision: 271736
URL: http://svnweb.freebsd.org/changeset/base/271736

Log:
  r258695 introduces a sanity check for makefs in order to verify that
  the minimum image size specified is always less than the maximum
  image size. If makefs(1) is invoked specifying minimum image size,
  but not maximum one, the program exits with an error. Example:
  
  # sudo -E makefs -M 538968064 -B be /home/davide/disk.img $DESTDIR
  makefs: `/home/davide/tftproot/mips' minsize of 538968064 rounded up
  to ffs bsize of 8192 exceeds maxsize 0.  Lower bsize, or round the
  minimum and maximum sizes to bsize.
  
  Assert then that minsize < maxsize iff maxsize is specified.
  This change allows me to build MIPS images using makefs(1) and following
  what specified in the wiki again.
  
  Reviewed by:  jmallett, ngie

Modified:
  head/usr.sbin/makefs/ffs.c

Modified: head/usr.sbin/makefs/ffs.c
==
--- head/usr.sbin/makefs/ffs.c  Thu Sep 18 03:09:34 2014(r271735)
+++ head/usr.sbin/makefs/ffs.c  Thu Sep 18 03:11:59 2014(r271736)
@@ -361,7 +361,8 @@ ffs_validate(const char *dir, fsnode *ro
if (ffs_opts->avgfpdir == -1)
ffs_opts->avgfpdir = AFPDIR;
 
-   if (roundup(fsopts->minsize, ffs_opts->bsize) > fsopts->maxsize)
+   if (fsopts->maxsize > 0 &&
+   roundup(fsopts->minsize, ffs_opts->bsize) > fsopts->maxsize)
errx(1, "`%s' minsize of %lld rounded up to ffs bsize of %d "
"exceeds maxsize %lld.  Lower bsize, or round the minimum "
"and maximum sizes to bsize.", dir,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271735 - head/sys/net

2014-09-17 Thread Marcelo Araujo
Author: araujo (ports committer)
Date: Thu Sep 18 03:09:34 2014
New Revision: 271735
URL: http://svnweb.freebsd.org/changeset/base/271735

Log:
  Remove old comment, we already do 802.1q tagging.
  
  Phabric:  D797
  Reviewed by:  kevlo
  Approved by:  kevlo
  Sponsored by: QNAP Systems Inc.

Modified:
  head/sys/net/if_vlan.c

Modified: head/sys/net/if_vlan.c
==
--- head/sys/net/if_vlan.c  Thu Sep 18 03:02:00 2014(r271734)
+++ head/sys/net/if_vlan.c  Thu Sep 18 03:09:34 2014(r271735)
@@ -29,8 +29,7 @@
 
 /*
  * if_vlan.c - pseudo-device driver for IEEE 802.1Q virtual LANs.
- * Might be extended some day to also handle IEEE 802.1p priority
- * tagging.  This is sort of sneaky in the implementation, since
+ * This is sort of sneaky in the implementation, since
  * we need to pretend to be enough of an Ethernet implementation
  * to make arp work.  The way we do this is by telling everyone
  * that we are an Ethernet, and then catch the packets that
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271734 - in stable/10: share/man/man4 usr.bin/iscsictl usr.sbin/ctld usr.sbin/iscsid

2014-09-17 Thread Allan Jude
Author: allanjude (doc committer)
Date: Thu Sep 18 03:02:00 2014
New Revision: 271734
URL: http://svnweb.freebsd.org/changeset/base/271734

Log:
  MFC r271445,r271446,r271560:
  Improve markup and language throughout the ctl.conf man page
  
  MFC r271543:
  Add the new iscsi(4) man page
  Cross reference it from iscsid(8) and iscsictl(8)
  
  Approved by:  re (gjb), bcr (mentor)

Added:
  stable/10/share/man/man4/iscsi.4
 - copied unchanged from r271543, head/share/man/man4/iscsi.4
Modified:
  stable/10/share/man/man4/Makefile
  stable/10/usr.bin/iscsictl/iscsictl.8
  stable/10/usr.sbin/ctld/ctl.conf.5
  stable/10/usr.sbin/iscsid/iscsid.8
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/Makefile
==
--- stable/10/share/man/man4/Makefile   Thu Sep 18 02:22:02 2014
(r271733)
+++ stable/10/share/man/man4/Makefile   Thu Sep 18 03:02:00 2014
(r271734)
@@ -205,6 +205,7 @@ MAN=aac.4 \
ipw.4 \
ipwfw.4 \
isci.4 \
+   iscsi.4 \
iscsi_initiator.4 \
isp.4 \
ispfw.4 \

Copied: stable/10/share/man/man4/iscsi.4 (from r271543, 
head/share/man/man4/iscsi.4)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/10/share/man/man4/iscsi.4Thu Sep 18 03:02:00 2014
(r271734, copy of r271543, head/share/man/man4/iscsi.4)
@@ -0,0 +1,111 @@
+.\" Copyright (c) 2014 Edward Tomasz Napierala
+.\" 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 September 11, 2014
+.Dt ISCSI 4
+.Os
+.Sh NAME
+.Nm iscsi
+.Nd iSCSI initiator
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following line in the
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device iscsi"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+iscsi_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+subsystem provides the kernel component of an iSCSI initiator.
+The initiator is the iSCSI client, which connects to an iSCSI target,
+providing local access to a remote block device.
+The userland component is provided by
+.Xr iscsid 8
+and both the kernel and userland are configured using
+.Xr iscsictl 8 .
+The
+.Nm
+subsystem is responsible for implementing the
+.Qq Full Feature Phase
+of the iSCSI protocol.
+.Sh SYSCTL VARIABLES
+The following variables are available as both
+.Xr sysctl 8
+variables and
+.Xr loader 8
+tunables:
+.Bl -tag -width indent
+.It Va kern.iscsi.ping_timeout
+The number of seconds to wait for the target to respond to a NOP-Out
+PDU.
+In the event that there is no response within that time the session gets
+forcibly restarted.
+.It Va kern.iscsi.iscsid_timeout
+The number of seconds to wait for
+.Xr ctld 8
+to establish a session.
+After that time
+.Nm
+will abort and retry.
+.It Va kern.iscsi.login_timeout
+The number of seconds to wait for a login attempt to succeed.
+After that time
+.Nm
+will abort and retry.
+.It Va kern.iscsi.maxtags
+The maximum number of outstanding IO requests.
+.It Va kern.iscsi.fail_on_disconnection
+Controls the behavior after an iSCSI connection has been dropped due to
+network problems.
+When set to 1, a dropped connection causes the iSCSI device nodes
+to be destroyed.
+After reconnecting, they will be created again.
+By default, the device nodes are left intact.
+While the connection is down all input/output operations are suspended, to be
+retried after the connection is reestablished.
+.El
+

svn commit: r271733 - in head: sbin/ifconfig share/man/man4

2014-09-17 Thread Marcelo Araujo
Author: araujo (ports committer)
Date: Thu Sep 18 02:22:02 2014
New Revision: 271733
URL: http://svnweb.freebsd.org/changeset/base/271733

Log:
  The lagg(4) interface is based on trunk(4) interface from OpenBSD.
  The FreeBSD is the only system that has the FEC protocol, that is a simple 
alias
  to loadbalance protocol and does not implement the ancient Cisco FEC standard.
  
  From now on, we remove the fec protocol from the documentation and keep the 
FEC
  code only for compatibility.
  
  Phabric:  D539
  Reviewed by:  glebius, thompsa
  Approved by:  glebius
  Sponsored by: QNAP Systems Inc.

Modified:
  head/sbin/ifconfig/ifconfig.8
  head/share/man/man4/lagg.4

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Thu Sep 18 02:12:48 2014
(r271732)
+++ head/sbin/ifconfig/ifconfig.8   Thu Sep 18 02:22:02 2014
(r271733)
@@ -2332,7 +2332,7 @@ from the aggregation interface.
 .It Cm laggproto Ar proto
 Set the aggregation protocol.
 The default is failover.
-The available options are failover, fec, lacp, loadbalance, roundrobin, 
broadcast
+The available options are failover, lacp, loadbalance, roundrobin, broadcast
 and none.
 .It Cm lagghash Ar option Ns Oo , Ns Ar option Oc
 Set the packet layers to hash for aggregation protocols which load balance.

Modified: head/share/man/man4/lagg.4
==
--- head/share/man/man4/lagg.4  Thu Sep 18 02:12:48 2014(r271732)
+++ head/share/man/man4/lagg.4  Thu Sep 18 02:22:02 2014(r271733)
@@ -61,7 +61,6 @@ option.
 The driver currently supports the aggregation protocols
 .Ic failover
 (the default),
-.Ic fec ,
 .Ic lacp ,
 .Ic loadbalance ,
 .Ic roundrobin ,
@@ -87,9 +86,6 @@ This constraint can be relaxed by settin
 .Xr sysctl 8
 variable to a nonzero value,
 which is useful for certain bridged network setups.
-.It Ic fec
-Supports Cisco EtherChannel.
-This is an alias for
 .Ic loadbalance
 mode.
 .It Ic lacp
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271732 - in head: sbin/ifconfig share/man/man4 sys/net

2014-09-17 Thread Marcelo Araujo
Author: araujo (ports committer)
Date: Thu Sep 18 02:12:48 2014
New Revision: 271732
URL: http://svnweb.freebsd.org/changeset/base/271732

Log:
  Add laggproto broadcast, it allows sends frames to all ports of the lagg(4) 
group
  and receives frames on any port of the lagg(4).
  
  Phabric:  D549
  Reviewed by:  glebius, thompsa
  Approved by:  glebius
  Obtained from:OpenBSD
  Sponsored by: QNAP Systems Inc.

Modified:
  head/sbin/ifconfig/ifconfig.8
  head/share/man/man4/lagg.4
  head/sys/net/if_lagg.c
  head/sys/net/if_lagg.h

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Thu Sep 18 02:01:36 2014
(r271731)
+++ head/sbin/ifconfig/ifconfig.8   Thu Sep 18 02:12:48 2014
(r271732)
@@ -2332,8 +2332,8 @@ from the aggregation interface.
 .It Cm laggproto Ar proto
 Set the aggregation protocol.
 The default is failover.
-The available options are failover, fec, lacp, loadbalance, roundrobin and
-none.
+The available options are failover, fec, lacp, loadbalance, roundrobin, 
broadcast
+and none.
 .It Cm lagghash Ar option Ns Oo , Ns Ar option Oc
 Set the packet layers to hash for aggregation protocols which load balance.
 The default is

Modified: head/share/man/man4/lagg.4
==
--- head/share/man/man4/lagg.4  Thu Sep 18 02:01:36 2014(r271731)
+++ head/share/man/man4/lagg.4  Thu Sep 18 02:12:48 2014(r271732)
@@ -65,6 +65,7 @@ The driver currently supports the aggreg
 .Ic lacp ,
 .Ic loadbalance ,
 .Ic roundrobin ,
+.Ic broadcast ,
 and
 .Ic none .
 The protocols determine which ports are used for outgoing traffic
@@ -113,6 +114,9 @@ available, the VLAN tag, and the IP sour
 Distributes outgoing traffic using a round-robin scheduler
 through all active ports and accepts incoming traffic from
 any active port.
+.It Ic broadcast
+Sends frames to all ports of the LAG and receives frames on
+any port of the LAG.
 .It Ic none
 This protocol is intended to do nothing: it disables any traffic without
 disabling the

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Thu Sep 18 02:01:36 2014(r271731)
+++ head/sys/net/if_lagg.c  Thu Sep 18 02:12:48 2014(r271732)
@@ -3,6 +3,7 @@
 /*
  * Copyright (c) 2005, 2006 Reyk Floeter 
  * Copyright (c) 2007 Andrew Thompson 
+ * Copyright (c) 2014 Marcelo Araujo 
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -147,6 +148,13 @@ static struct mbuf *lagg_lb_input(struct
struct mbuf *);
 static int lagg_lb_porttable(struct lagg_softc *, struct lagg_port *);
 
+/* Broadcast */
+static intlagg_bcast_attach(struct lagg_softc *);
+static intlagg_bcast_detach(struct lagg_softc *);
+static intlagg_bcast_start(struct lagg_softc *, struct mbuf *);
+static struct mbuf *lagg_bcast_input(struct lagg_softc *, struct lagg_port *,
+  struct mbuf *);
+
 /* 802.3ad LACP */
 static int lagg_lacp_attach(struct lagg_softc *);
 static int lagg_lacp_detach(struct lagg_softc *);
@@ -163,10 +171,11 @@ static const struct {
int (*ti_attach)(struct lagg_softc *);
 } lagg_protos[] = {
{ LAGG_PROTO_ROUNDROBIN,lagg_rr_attach },
-   { LAGG_PROTO_FAILOVER,  lagg_fail_attach },
+   { LAGG_PROTO_FAILOVER,  lagg_fail_attach },
{ LAGG_PROTO_LOADBALANCE,   lagg_lb_attach },
{ LAGG_PROTO_ETHERCHANNEL,  lagg_lb_attach },
{ LAGG_PROTO_LACP,  lagg_lacp_attach },
+   { LAGG_PROTO_BROADCAST, lagg_bcast_attach },
{ LAGG_PROTO_NONE,  NULL }
 };
 
@@ -918,6 +927,7 @@ lagg_port2req(struct lagg_port *lp, stru
case LAGG_PROTO_ROUNDROBIN:
case LAGG_PROTO_LOADBALANCE:
case LAGG_PROTO_ETHERCHANNEL:
+  case LAGG_PROTO_BROADCAST:
if (LAGG_PORTACTIVE(lp))
rp->rp_flags |= LAGG_PORT_ACTIVE;
break;
@@ -1440,6 +1450,7 @@ lagg_linkstate(struct lagg_softc *sc)
case LAGG_PROTO_ROUNDROBIN:
case LAGG_PROTO_LOADBALANCE:
case LAGG_PROTO_ETHERCHANNEL:
+  case LAGG_PROTO_BROADCAST:
speed = 0;
SLIST_FOREACH(lp, &sc->sc_ports, lp_entries)
speed += lp->lp_ifp->if_baudrate;
@@ -1722,6 +1733,91 @@ lagg_rr_input(struct lagg_softc *sc, str
 }
 
 /*
+ * Broadcast mode
+ */
+
+static int
+lagg_bcast_attach(struct lagg_softc *sc)
+{
+   sc->sc_detach = lagg_bcast_detach;
+   sc->sc_start = lagg_bcast_start;
+   sc->sc_input = lagg_bcast_input;

svn commit: r271731 - head/sys/dev/isp

2014-09-17 Thread Will Andrews
Author: will
Date: Thu Sep 18 02:01:36 2014
New Revision: 271731
URL: http://svnweb.freebsd.org/changeset/base/271731

Log:
  Fix a kernel panic when unloading isp(4).
  
  In the current implementation, the isp_kthread() threads never exit.
  
  The target threads do have an exit mode from isp_attach(), but it is
  not invoked from isp_detach().
  
  Ensure isp_detach() notifies threads started for each channel, such
  that they exit before their parent device softc detaches, and thus
  before the module does.  Otherwise, a page fault panic occurs later in:
  
  sysctl_kern_proc
sysctl_out_proc
  kern_proc_out
fill_kinfo_proc
  fill_kinfo_thread
strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg));
  
  For isp_kthread() (and isp(4) target threads), td->td_wmesg references
  now-unmapped memory after the module has been unloaded.  These threads
  are typically msleep()ing at the time of unload, but they could also
  attempt to execute now-unmapped code segments.
  
  MFC after:1 month
  Sponsored by: Spectra Logic
  MFSpectraBSD: r1070921 on 2014/06/22 13:01:17

Modified:
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/isp/isp_freebsd.h

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Thu Sep 18 01:57:36 2014
(r271730)
+++ head/sys/dev/isp/isp_freebsd.c  Thu Sep 18 02:01:36 2014
(r271731)
@@ -132,6 +132,7 @@ isp_attach_chan(ispsoftc_t *isp, struct 
ISP_SET_PC(isp, chan, proc_active, 0);
isp_prt(isp, ISP_LOGERR, "cannot create test target 
thread");
}
+   ISP_SPI_PC(isp, chan)->num_threads += 1;
 #endif
} else {
fcparam *fcp = FCPARAM(isp, chan);
@@ -167,12 +168,14 @@ isp_attach_chan(ispsoftc_t *isp, struct 
cam_sim_free(fc->sim, FALSE);
return (ENOMEM);
}
+   ISP_FC_PC(isp, chan)->num_threads += 1;
 #ifdef ISP_INTERNAL_TARGET
ISP_SET_PC(isp, chan, proc_active, 1);
if (THREAD_CREATE(isp_target_thread_fc, fc, &fc->target_proc, 
0, 0, "%s: isp_test_tgt%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) {
ISP_SET_PC(isp, chan, proc_active, 0);
isp_prt(isp, ISP_LOGERR, "cannot create test target 
thread");
}
+   ISP_FC_PC(isp, chan)->num_threads += 1;
 #endif
if (chan == 0) {
struct sysctl_ctx_list *ctx = 
device_get_sysctl_ctx(isp->isp_osinfo.dev);
@@ -189,6 +192,47 @@ isp_attach_chan(ispsoftc_t *isp, struct 
return (0);
 }
 
+static void
+isp_detach_internal_target(ispsoftc_t *isp, int chan)
+{
+#ifdef ISP_INTERNAL_TARGET
+   void *wchan;
+
+   ISP_GET_PC(isp, chan, target_proc, wchan);
+   ISP_SET_PC(isp, chan, proc_active, 0);
+   wakeup(wchan);
+#endif
+}
+
+static void
+isp_detach_chan(ispsoftc_t *isp, int chan)
+{
+   struct cam_sim *sim;
+   struct cam_path *path;
+   struct ccb_setasync csa;
+   int *num_threads;
+
+   ISP_GET_PC(isp, chan, sim, sim);
+   ISP_GET_PC(isp, chan, path, path);
+   ISP_GET_PC_ADDR(isp, chan, num_threads, num_threads);
+
+   xpt_setup_ccb(&csa.ccb_h, path, 5);
+   csa.ccb_h.func_code = XPT_SASYNC_CB;
+   csa.event_enable = 0;
+   csa.callback = isp_cam_async;
+   csa.callback_arg = sim;
+   xpt_action((union ccb *)&csa);
+   xpt_free_path(path);
+   xpt_bus_deregister(cam_sim_path(sim));
+   cam_sim_free(sim, FALSE);
+
+   /* Wait for the channel's spawned threads to exit. */
+   wakeup(isp->isp_osinfo.pc.ptr);
+   isp_detach_internal_target(isp, chan);
+   while (*num_threads != 0)
+   mtx_sleep(isp, &isp->isp_osinfo.lock, PRIBIO, "isp_reap", 100);
+}
+
 int
 isp_attach(ispsoftc_t *isp)
 {
@@ -239,13 +283,9 @@ unwind:
while (--chan >= 0) {
struct cam_sim *sim;
struct cam_path *path;
-   if (IS_FC(isp)) {
-   sim = ISP_FC_PC(isp, chan)->sim;
-   path = ISP_FC_PC(isp, chan)->path;
-   } else {
-   sim = ISP_SPI_PC(isp, chan)->sim;
-   path = ISP_SPI_PC(isp, chan)->path;
-   }
+
+   ISP_GET_PC(isp, chan, sim, sim);
+   ISP_GET_PC(isp, chan, path, path);
xpt_free_path(path);
ISP_LOCK(isp);
xpt_bus_deregister(cam_sim_path(sim));
@@ -269,49 +309,26 @@ int
 isp_detach(ispsoftc_t *isp)
 {
struct cam_sim *sim;
-   struct cam_path *path;
-   struct ccb_setasync csa;
int chan;
 
ISP_LOCK(isp);
for (chan = isp->isp_nchan - 1; chan >= 0; chan -= 1) {
-   if (IS_FC(isp)) {
-   sim = IS

svn commit: r271730 - head

2014-09-17 Thread Will Andrews
Author: will
Date: Thu Sep 18 01:57:36 2014
New Revision: 271730
URL: http://svnweb.freebsd.org/changeset/base/271730

Log:
  Root the lib32 object tree under the overall object tree.
  
  This enables a common root directory for all object files for a given tree,
  which eases sharing a common MAKEOBJDIRPREFIX, and cleaning up of object 
trees.
  
  In particular, one can simply (from the source directory) rm -rf 
/usr/obj$(pwd)
  to destroy all object files for it.  Or to copy/sync files, etc.
  
  Reviewed by:  bdrewery
  CR:   https://reviews.freebsd.org/D796
  MFC after:1 month
  Sponsored by: Spectra Logic

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Sep 18 01:24:40 2014(r271729)
+++ head/Makefile.inc1  Thu Sep 18 01:57:36 2014(r271730)
@@ -352,6 +352,7 @@ WMAKE=  ${WMAKEENV} ${MAKE} ${WORLD_FLAG
 
 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
 # 32 bit world
+LIB32_OBJTREE= ${OBJTREE}${.CURDIR}/world32
 LIB32TMP=  ${OBJTREE}${.CURDIR}/lib32
 
 .if ${TARGET_ARCH} == "amd64"
@@ -387,7 +388,7 @@ LIB32FLAGS+=--sysroot=${WORLDTMP}
 .endif
 
 # Yes, the flags are redundant.
-LIB32WMAKEENV+=MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
+LIB32WMAKEENV+=MAKEOBJDIRPREFIX=${LIB32_OBJTREE} \
_SHLIBDIRPREFIX=${LIB32TMP} \
_LDSCRIPTROOT=${LIB32TMP} \
VERSION="${VERSION}" \
@@ -611,7 +612,7 @@ build32:
cd ${.CURDIR}/${_dir}; \
WORLDTMP=${WORLDTMP} \
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
-   MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \
+   MAKEOBJDIRPREFIX=${LIB32_OBJTREE} ${MAKE} SSP_CFLAGS= DESTDIR= \
DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
build-tools
 .endfor
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271729 - in stable/10/contrib/llvm: patches tools/clang/lib/CodeGen

2014-09-17 Thread Ed Maste
Author: emaste
Date: Thu Sep 18 01:24:40 2014
New Revision: 271729
URL: http://svnweb.freebsd.org/changeset/base/271729

Log:
  MFC Clang debuginfo crash fix
  
  r271432: 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
  
  r271433: Add clang patch corresponding to r271432
  
  Approved by:  re
  Sponsored by: DARPA, AFRL

Added:
  
stable/10/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff
 - copied unchanged from r271433, 
head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff
Modified:
  stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
Directory Properties:
  stable/10/   (props changed)

Copied: 
stable/10/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff
 (from r271433, 
head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
stable/10/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff
Thu Sep 18 01:24:40 2014(r271729, copy of r271433, 
head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff)
@@ -0,0 +1,46 @@
+commit 96365aef99ec463375dfdaf6eb260823e0477b6a
+Author: Adrian Prantl 
+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 (isa(D)) {
++  if (isa(D) || isa(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 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;
++  };
++};
++
++Foo the_foo;

Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
==
--- stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp  Wed Sep 
17 22:49:29 2014(r271728)
+++ stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp  Thu Sep 
18 01:24:40 2014(r271729)
@@ -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 (isa(D)) {
+  if (isa(D) || isa(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-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r271711 - head/usr.sbin/bhyve

2014-09-17 Thread John-Mark Gurney
Peter Grehan wrote this message on Wed, Sep 17, 2014 at 15:18 -0700:
> >>   Update the bhyve(8) manual to reflect that it is no
> >>   longer considered 'experimental.'
> >
> >If it's no longer experimental, we should document hardware
> >requirements for it to function in the man page(s)...
> 
>  I'll get a phabric review going for this.

Thanks.

> >Like I tried it on my AMD hardware, but it doesn't work because code 
> >hasn't been
> >committed...
> 
>  I think you mean, not yet merged to CURRENT from the bhyve_svm branch :)

I continue to think that until things are in HEAD/CURRENT, that they
haven't been committed.. :)   Though they happen to be in svn, they
aren't committed to HEAD..

/me can't wait to start testing.

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271728 - head/sys/dev/bxe

2014-09-17 Thread David C Somayajulu
Author: davidcs
Date: Wed Sep 17 22:49:29 2014
New Revision: 271728
URL: http://svnweb.freebsd.org/changeset/base/271728

Log:
  For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag 
before
  printing error message.
  
  MFC after:5 days

Modified:
  head/sys/dev/bxe/ecore_sp.h

Modified: head/sys/dev/bxe/ecore_sp.h
==
--- head/sys/dev/bxe/ecore_sp.h Wed Sep 17 22:26:01 2014(r271727)
+++ head/sys/dev/bxe/ecore_sp.h Wed Sep 17 22:49:29 2014(r271728)
@@ -246,14 +246,23 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m
 
 #else
 
+extern unsigned long bxe_debug;
+
+#define BXE_DEBUG_ECORE_DBG_BREAK_IF   0x01
+#define BXE_DEBUG_ECORE_BUG0x02
+#define BXE_DEBUG_ECORE_BUG_ON 0x04
+
 #define ECORE_DBG_BREAK_IF(exp) \
-printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+if (bxe_debug & BXE_DEBUG_ECORE_DBG_BREAK_IF) \
+printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
 
 #define ECORE_BUG(exp) \
-printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+if (bxe_debug & BXE_DEBUG_ECORE_BUG) \
+printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
 
 #define ECORE_BUG_ON(exp) \
-printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+if (bxe_debug & BXE_DEBUG_ECORE_BUG_ON) \
+printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
 
 
 #endif /* #ifdef ECORE_STOP_ON_ERROR */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271727 - head/sys/modules/bce

2014-09-17 Thread David C Somayajulu
Author: davidcs
Date: Wed Sep 17 22:26:01 2014
New Revision: 271727
URL: http://svnweb.freebsd.org/changeset/base/271727

Log:
  Remove clean option
  
  MFC after:5 days

Modified:
  head/sys/modules/bce/Makefile

Modified: head/sys/modules/bce/Makefile
==
--- head/sys/modules/bce/Makefile   Wed Sep 17 22:24:51 2014
(r271726)
+++ head/sys/modules/bce/Makefile   Wed Sep 17 22:26:01 2014
(r271727)
@@ -5,9 +5,4 @@ SRCS=   opt_bce.h if_bce.c miibus_if.h mii
 
 #CFLAGS += -DBCE_DEBUG=0
 
-clean:
-   rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms
-   rm -f *.o *.kld *.ko
-   rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h
-
 .include 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271726 - head/sys/modules/bxe

2014-09-17 Thread David C Somayajulu
Author: davidcs
Date: Wed Sep 17 22:24:51 2014
New Revision: 271726
URL: http://svnweb.freebsd.org/changeset/base/271726

Log:
  Remove clean option
  
  MFC after:5 days

Modified:
  head/sys/modules/bxe/Makefile

Modified: head/sys/modules/bxe/Makefile
==
--- head/sys/modules/bxe/Makefile   Wed Sep 17 22:11:20 2014
(r271725)
+++ head/sys/modules/bxe/Makefile   Wed Sep 17 22:24:51 2014
(r271726)
@@ -18,9 +18,4 @@ SRCS  += bxe.c   \
 
 CFLAGS += -I${BXE}
 
-clean:
-   rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms
-   rm -f *.o *.kld *.ko
-   rm -f @ machine x86
-
 .include 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r271711 - head/usr.sbin/bhyve

2014-09-17 Thread Peter Grehan

   Update the bhyve(8) manual to reflect that it is no
   longer considered 'experimental.'


If it's no longer experimental, we should document hardware
requirements for it to function in the man page(s)...


 I'll get a phabric review going for this.


Like I tried it on my AMD hardware, but it doesn't work because code hasn't been
committed...


 I think you mean, not yet merged to CURRENT from the bhyve_svm branch :)

later,

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


svn commit: r271725 - stable/10/sys/dev/bxe

2014-09-17 Thread David C Somayajulu
Author: davidcs
Date: Wed Sep 17 22:11:20 2014
New Revision: 271725
URL: http://svnweb.freebsd.org/changeset/base/271725

Log:
  MFC r268854
  Initiate error recovery stats fail to update after 3 retries.
  Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to
  panic only if ECORE_STOP_ON_ERROR is defined.
  
  Approved by: re(gjb)

Modified:
  stable/10/sys/dev/bxe/bxe.c
  stable/10/sys/dev/bxe/bxe.h
  stable/10/sys/dev/bxe/bxe_stats.c
  stable/10/sys/dev/bxe/ecore_reg.h
  stable/10/sys/dev/bxe/ecore_sp.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/bxe/bxe.c
==
--- stable/10/sys/dev/bxe/bxe.c Wed Sep 17 21:04:50 2014(r271724)
+++ stable/10/sys/dev/bxe/bxe.c Wed Sep 17 22:11:20 2014(r271725)
@@ -11478,6 +11478,10 @@ bxe_process_kill(struct bxe_softc *sc,
 bxe_process_kill_chip_reset(sc, global);
 mb();
 
+/* clear errors in PGB */
+if (!CHIP_IS_E1(sc))
+REG_WR(sc, PGLUE_B_REG_LATCHED_ERRORS_CLR, 0x7f);
+
 /* Recover after reset: */
 /* MCP */
 if (global && bxe_reset_mcp_comp(sc, val)) {

Modified: stable/10/sys/dev/bxe/bxe.h
==
--- stable/10/sys/dev/bxe/bxe.h Wed Sep 17 21:04:50 2014(r271724)
+++ stable/10/sys/dev/bxe/bxe.h Wed Sep 17 22:11:20 2014(r271725)
@@ -2301,11 +2301,20 @@ void ecore_storm_memset_struct(struct bx
 } \
 } while(0)
 
+#ifdef ECORE_STOP_ON_ERROR
+
 #define bxe_panic(sc, msg) \
 do {   \
 panic msg; \
 } while (0)
 
+#else
+
+#define bxe_panic(sc, msg) \
+device_printf((sc)->dev, "%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+
+#endif
+
 #define CATC_TRIGGER(sc, data) REG_WR((sc), 0x2000, (data));
 #define CATC_TRIGGER_START(sc) CATC_TRIGGER((sc), 0xcafecafe)
 

Modified: stable/10/sys/dev/bxe/bxe_stats.c
==
--- stable/10/sys/dev/bxe/bxe_stats.c   Wed Sep 17 21:04:50 2014
(r271724)
+++ stable/10/sys/dev/bxe/bxe_stats.c   Wed Sep 17 22:11:20 2014
(r271725)
@@ -1306,7 +1306,10 @@ bxe_stats_update(struct bxe_softc *sc)
 
 if (bxe_storm_stats_update(sc)) {
 if (sc->stats_pending++ == 3) {
-bxe_panic(sc, ("storm stats not updated for 3 times\n"));
+   if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) {
+   atomic_store_rel_long(&sc->chip_tq_flags, 
CHIP_TQ_REINIT);
+   taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task);
+   }
 }
 return;
 }

Modified: stable/10/sys/dev/bxe/ecore_reg.h
==
--- stable/10/sys/dev/bxe/ecore_reg.h   Wed Sep 17 21:04:50 2014
(r271724)
+++ stable/10/sys/dev/bxe/ecore_reg.h   Wed Sep 17 22:11:20 2014
(r271725)
@@ -1039,6 +1039,8 @@ __FBSDID("$FreeBSD$");
0x942cUL
 #define PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ \
0x9430UL
+#define PGLUE_B_REG_LATCHED_ERRORS_CLR \
+   0x943CUL
 #define PGLUE_B_REG_PGLUE_B_INT_STS \
0x9298UL
 #define PGLUE_B_REG_PGLUE_B_INT_STS_CLR \

Modified: stable/10/sys/dev/bxe/ecore_sp.h
==
--- stable/10/sys/dev/bxe/ecore_sp.hWed Sep 17 21:04:50 2014
(r271724)
+++ stable/10/sys/dev/bxe/ecore_sp.hWed Sep 17 22:11:20 2014
(r271725)
@@ -223,6 +223,8 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m
 #define ecore_sp_post(_sc, _a, _b, _c, _d) \
 bxe_sp_post(_sc, _a, _b, U64_HI(_c), U64_LO(_c), _d)
 
+#ifdef ECORE_STOP_ON_ERROR
+
 #define ECORE_DBG_BREAK_IF(exp) \
 do {\
 if (__predict_false(exp)) { \
@@ -242,6 +244,20 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m
 }\
 } while (0)
 
+#else
+
+#define ECORE_DBG_BREAK_IF(exp) \
+printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+
+#define ECORE_BUG(exp) \
+printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+
+#define ECORE_BUG_ON(exp) \
+printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+
+
+#endif /* #ifdef ECORE_STOP_ON_ERROR */
+
 #define ECORE_ERR(str, ...) \
 BLOGE(sc, "ECORE: " str, ##__VA_ARGS__)
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271724 - in head/sys: sys vm

2014-09-17 Thread Konstantin Belousov
Author: kib
Date: Wed Sep 17 21:04:50 2014
New Revision: 271724
URL: http://svnweb.freebsd.org/changeset/base/271724

Log:
  The vm_mmap_cdev() explicitely converts absence of both MAP_SHARED and
  MAP_PRIVATE flags to MAP_SHARED.  Apparently, some code in tree, in
  particular, libgeom, relied on this behaviour, see r271721.  For
  regular file types, the absence of the flags is interpreted as
  MAP_PRIVATE, and libc nlist used this (fixed in r271723).
  
  Allow the implicit flags for legacy binaries.  Bump __FreeBSD_version
  to get the ABI note on new binaries to check for in mmap code.
  
  Remove the test for presence of one of the MAP_ANON, MAP_SHARED or
  MAP_PRIVATE flags before fget_mmap().  For MAP_ANON, we already verify
  that passed fd == -1.  For fd != -1, test after fget_mmap() (for newer
  binaries) covers the case.
  
  Reported by:  bdrewery, pho
  Reviewed by:  jhb
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/sys/param.h
  head/sys/vm/vm_mmap.c

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hWed Sep 17 20:26:27 2014(r271723)
+++ head/sys/sys/param.hWed Sep 17 21:04:50 2014(r271724)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100035  /* Master, propagated to newvers */
+#define __FreeBSD_version 1100036  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
@@ -80,6 +80,7 @@
 #defineP_OSREL_SIGWAIT 70
 #defineP_OSREL_SIGSEGV 74
 #defineP_OSREL_MAP_ANON800104
+#defineP_OSREL_MAP_FSTRICT 1100036
 
 #defineP_OSREL_MAJOR(x)((x) / 10)
 #endif

Modified: head/sys/vm/vm_mmap.c
==
--- head/sys/vm/vm_mmap.c   Wed Sep 17 20:26:27 2014(r271723)
+++ head/sys/vm/vm_mmap.c   Wed Sep 17 21:04:50 2014(r271724)
@@ -254,8 +254,7 @@ sys_mmap(td, uap)
return (EINVAL);
if ((flags & (MAP_EXCL | MAP_FIXED)) == MAP_EXCL)
return (EINVAL);
-   if ((flags & (MAP_ANON | MAP_SHARED | MAP_PRIVATE)) == 0 ||
-   (flags & (MAP_SHARED | MAP_PRIVATE)) == (MAP_SHARED | MAP_PRIVATE))
+   if ((flags & (MAP_SHARED | MAP_PRIVATE)) == (MAP_SHARED | MAP_PRIVATE))
return (EINVAL);
if (prot != PROT_NONE &&
(prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0)
@@ -356,6 +355,11 @@ sys_mmap(td, uap)
error = fget_mmap(td, uap->fd, &rights, &cap_maxprot, &fp);
if (error != 0)
goto done;
+   if ((flags & (MAP_SHARED | MAP_PRIVATE)) == 0 &&
+   td->td_proc->p_osrel >= P_OSREL_MAP_FSTRICT) {
+   error = EINVAL;
+   goto done;
+   }
if (fp->f_type == DTYPE_SHM) {
handle = fp->f_data;
handle_type = OBJT_SWAP;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r271723 - head/lib/libc/gen

2014-09-17 Thread John Baldwin
On Wednesday, September 17, 2014 08:26:27 PM Bryan Drewery wrote:
> Author: bdrewery
> Date: Wed Sep 17 20:26:27 2014
> New Revision: 271723
> URL: http://svnweb.freebsd.org/changeset/base/271723
> 
> Log:
>   Explicitly set MAP_PRIVATE to avoid [EINVAL] after r271635.
> 
>   X-MFC-With: r271635

At this point, I will probably only merge a selective part.  In particular, I 
will merge all the manpage updates so people who check the manpage will have a 
heads up, but I will probably not merge the one check that requires this since 
we are only going to enforce that for 11.0 on.  (I will merge at least the 
failure for setting both SHARED and PRIVATE.)  That said, you can merge this 
fix at any time as it will work fine with older kernels.

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


svn commit: r271723 - head/lib/libc/gen

2014-09-17 Thread Bryan Drewery
Author: bdrewery
Date: Wed Sep 17 20:26:27 2014
New Revision: 271723
URL: http://svnweb.freebsd.org/changeset/base/271723

Log:
  Explicitly set MAP_PRIVATE to avoid [EINVAL] after r271635.
  
  X-MFC-With:   r271635
  Reviewed by:  jhb

Modified:
  head/lib/libc/gen/nlist.c

Modified: head/lib/libc/gen/nlist.c
==
--- head/lib/libc/gen/nlist.c   Wed Sep 17 19:45:34 2014(r271722)
+++ head/lib/libc/gen/nlist.c   Wed Sep 17 20:26:27 2014(r271723)
@@ -268,7 +268,7 @@ __elf_fdnlist(fd, list)
}
 
/* mmap section header table */
-   base = mmap(NULL, (size_t)shdr_size, PROT_READ, 0, fd,
+   base = mmap(NULL, (size_t)shdr_size, PROT_READ, MAP_PRIVATE, fd,
(off_t)ehdr.e_shoff);
if (base == MAP_FAILED)
return (-1);
@@ -301,7 +301,7 @@ __elf_fdnlist(fd, list)
 * making the memory allocation permanent as with malloc/free
 * (i.e., munmap will return it to the system).
 */
-   base = mmap(NULL, (size_t)symstrsize, PROT_READ, 0, fd,
+   base = mmap(NULL, (size_t)symstrsize, PROT_READ, MAP_PRIVATE, fd,
(off_t)symstroff);
if (base == MAP_FAILED)
goto done;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r271635 - in head: lib/libc/sys sys/vm

2014-09-17 Thread John Baldwin
On Tuesday, September 16, 2014 12:00:09 PM Peter Holm wrote:
> On Mon, Sep 15, 2014 at 05:20:13PM +, John Baldwin wrote:
> > Author: jhb
> > Date: Mon Sep 15 17:20:13 2014
> > New Revision: 271635
> > URL: http://svnweb.freebsd.org/changeset/base/271635
> > 
> > Log:
> >   Add stricter checking of some mmap() arguments:
> >   - Fail with EINVAL if an invalid protection mask is passed to mmap().
> >   - Fail with EINVAL if an unknown flag is passed to mmap().
> >   - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to
> >   mmap().
> >   - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous
> >   
> > mappings.
> >   
> >   Reviewed by:  alc, kib
> >   MFC after:2 weeks
> >   Differential Revision:https://reviews.freebsd.org/D698
> > 
> > Modified:
> >   head/lib/libc/sys/mmap.2
> >   head/sys/vm/vm_mmap.c
> 
> I'm seem to have mdconfig(8) issues with this commit.
> /dev/md* appear to linger.

I've just committed a fix to libgeom that fixes both mdconfig -l and gstat.  
Konstantin has a a fix to allow older binaries to still work that he will 
commit shortly.

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


Re: svn commit: r271635 - in head: lib/libc/sys sys/vm

2014-09-17 Thread John Baldwin
On Wednesday, September 17, 2014 10:20:09 PM Konstantin Belousov wrote:
> On Wed, Sep 17, 2014 at 11:03:29AM -0400, John Baldwin wrote:
> > On Tuesday, September 16, 2014 04:38:21 PM Andriy Gapon wrote:
> > > On 15/09/2014 20:20, John Baldwin wrote:
> > > > Author: jhb
> > > > Date: Mon Sep 15 17:20:13 2014
> > > > New Revision: 271635
> > > > URL: http://svnweb.freebsd.org/changeset/base/271635
> > > > 
> > > > Log:
> > > >   Add stricter checking of some mmap() arguments:
> > > >   - Fail with EINVAL if an invalid protection mask is passed to
> > > >   mmap().
> > > >   - Fail with EINVAL if an unknown flag is passed to mmap().
> > > >   - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to
> > > >   mmap().
> > > >   - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous
> > > >   
> > > > mappings.
> > > 
> > > This broke Java, at least java/openjdk7, for me:
> > >  25323 java CALL
> > > 
> > > mmap(0,0x300,0x3,0x1042 > > RVE| MAP_ANON>,0x,0) 25323 java RET   mmap -1 errno 22
> > > Invalid argument
> > > 
> > >  25323 java CALL  write(0x1,0x7fbfd450,0x2b)
> > >  25323 java GIO   fd 1 wrote 43 bytes
> > >  
> > >"Error occurred during initialization of VM
> > >"
> > >  
> > >  25323 java RET   write 43/0x2b
> > >  25323 java CALL  write(0x1,0x80209a1e2,0x2d)
> > >  25323 java GIO   fd 1 wrote 45 bytes
> > >  
> > >"Could not reserve enough space for code cache"
> > > 
> > > It seems that MAP_NORESERVE presence could be detected in sys/mman.h and
> > > then it is used for some reason.
> > > I guess that the port can be easily fixed, but this commit breaks
> > > compatibility with older binaries.  Perhaps MAP_NORESERVE should be
> > > removed
> > > as well given that we do not actually implement it.
> > 
> > I've allowed it for now, but I do intend on removing it in 11.
> 
> I think that the removal procedure should be as follows, in the single
> commit:
> 1. remove the defines from public headers, and move them to vm_mmap.c
> 2. bump __FreeBSD_version
> 3. allow the bits for older binaries by p_osrel.
> 
> Might be, a comment in mman.h should be kept for the binary value
> of MAP_NORESERVE so that person who decide to reuse the bit for
> a useful flag would be not surprised.

Yes, I had used MAP_UNUSED0020 similar to what was done for MAP_INHERIT and 
exactly this (P_OSREL_MAP_RENAME, etc.).  Once the other fixes settle in I 
will publish this for review and also request an exp-run from ports so we can 
patch things to remove MAP_NORESERVE before this is committed.

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


Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce

2014-09-17 Thread Mark Johnston
On Wed, Sep 17, 2014 at 11:02:00AM -0400, John Baldwin wrote:
> On Monday, September 15, 2014 04:31:13 PM David Somayajulu wrote:
> > Hi Andrey,
> > When I didn't have the clean override,  "make clean" was not cleaning
> > properly when I built a standalone loadable driver. Perhaps we can change
> > "clean" in bxe/Makefile and bce/Makefile to "dclean".
> 
> Try using 'make cleandir' instead of 'make clean'.  'make clean' does not 
> clean files created by 'make depend' such as the 'machine' and 'x86' 
> symlinks.  

That seems to have changed with r269039.

> There is a 'make cleandepend' that will clean up such files, but I tend to 
> use 
> 'make cleandir' which does both.

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


svn commit: r271722 - head/lib/libc/sys

2014-09-17 Thread John Baldwin
Author: jhb
Date: Wed Sep 17 19:45:34 2014
New Revision: 271722
URL: http://svnweb.freebsd.org/changeset/base/271722

Log:
  - Remove mention of MAP_INHERIT.  It hasn't been implemented for thirteen
years.
  - Remove mention of unimplemented MAP_SWAP.  There are no future plans to
implement it.
  
  Submitted by: alc (2)

Modified:
  head/lib/libc/sys/mmap.2

Modified: head/lib/libc/sys/mmap.2
==
--- head/lib/libc/sys/mmap.2Wed Sep 17 19:37:58 2014(r271721)
+++ head/lib/libc/sys/mmap.2Wed Sep 17 19:45:34 2014(r271722)
@@ -28,7 +28,7 @@
 .\"@(#)mmap.2  8.4 (Berkeley) 5/11/95
 .\" $FreeBSD$
 .\"
-.Dd September 15, 2014
+.Dd September 17, 2014
 .Dt MMAP 2
 .Os
 .Sh NAME
@@ -176,11 +176,6 @@ already exists within the range.
 .It Dv MAP_HASSEMAPHORE
 Notify the kernel that the region may contain semaphores and that special
 handling may be necessary.
-.It Dv MAP_INHERIT
-This flag never operated as advertised and is no longer supported.
-Please refer to
-.Xr minherit 2
-for further information.
 .It Dv MAP_NOCORE
 Region is not included in a core file.
 .It Dv MAP_NOSYNC
@@ -300,14 +295,6 @@ The
 system call does not unmap pages, see
 .Xr munmap 2
 for further information.
-.Pp
-The current design does not allow a process to specify the location of
-swap space.
-In the future we may define an additional mapping type,
-.Dv MAP_SWAP ,
-in which
-the file descriptor argument specifies a file or device to which swapping
-should be done.
 .Sh NOTES
 Although this implementation does not impose any alignment restrictions on
 the
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271721 - head/lib/libgeom

2014-09-17 Thread John Baldwin
Author: jhb
Date: Wed Sep 17 19:37:58 2014
New Revision: 271721
URL: http://svnweb.freebsd.org/changeset/base/271721

Log:
  Explicitly specify MAP_SHARED when mapping the stats file descriptor.
  
  Reviewed by:  kib
  MFC after:1 week

Modified:
  head/lib/libgeom/geom_stats.c

Modified: head/lib/libgeom/geom_stats.c
==
--- head/lib/libgeom/geom_stats.c   Wed Sep 17 19:09:58 2014
(r271720)
+++ head/lib/libgeom/geom_stats.c   Wed Sep 17 19:37:58 2014
(r271721)
@@ -68,7 +68,7 @@ geom_stats_resync(void)
return;
for (;;) {
p = mmap(statp, (npages + 1) * pagesize, 
-   PROT_READ, 0, statsfd, 0);
+   PROT_READ, MAP_SHARED, statsfd, 0);
if (p == MAP_FAILED)
break;
else
@@ -90,7 +90,7 @@ geom_stats_open(void)
return (errno);
pagesize = getpagesize();
spp = pagesize / sizeof(struct devstat);
-   p = mmap(NULL, pagesize, PROT_READ, 0, statsfd, 0);
+   p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, statsfd, 0);
if (p == MAP_FAILED) {
error = errno;
close(statsfd);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r271711 - head/usr.sbin/bhyve

2014-09-17 Thread John-Mark Gurney
Glen Barber wrote this message on Wed, Sep 17, 2014 at 16:45 +:
> Author: gjb
> Date: Wed Sep 17 16:45:20 2014
> New Revision: 271711
> URL: http://svnweb.freebsd.org/changeset/base/271711
> 
> Log:
>   Update the bhyve(8) manual to reflect that it is no
>   longer considered 'experimental.'

If it's no longer experimental, we should document hardware
requirements for it to function in the man page(s)...  Like I tried
it on my AMD hardware, but it doesn't work because code hasn't been
committed...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r271635 - in head: lib/libc/sys sys/vm

2014-09-17 Thread Konstantin Belousov
On Wed, Sep 17, 2014 at 11:03:29AM -0400, John Baldwin wrote:
> On Tuesday, September 16, 2014 04:38:21 PM Andriy Gapon wrote:
> > On 15/09/2014 20:20, John Baldwin wrote:
> > > Author: jhb
> > > Date: Mon Sep 15 17:20:13 2014
> > > New Revision: 271635
> > > URL: http://svnweb.freebsd.org/changeset/base/271635
> > > 
> > > Log:
> > >   Add stricter checking of some mmap() arguments:
> > >   - Fail with EINVAL if an invalid protection mask is passed to mmap().
> > >   - Fail with EINVAL if an unknown flag is passed to mmap().
> > >   - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to
> > >   mmap().
> > >   - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous
> > >   
> > > mappings.
> > 
> > This broke Java, at least java/openjdk7, for me:
> > 
> >  25323 java CALL
> > mmap(0,0x300,0x3,0x1042 > MAP_ANON>,0x,0) 25323 java RET   mmap -1 errno 22 Invalid
> > argument
> >  25323 java CALL  write(0x1,0x7fbfd450,0x2b)
> >  25323 java GIO   fd 1 wrote 43 bytes
> >"Error occurred during initialization of VM
> >"
> >  25323 java RET   write 43/0x2b
> >  25323 java CALL  write(0x1,0x80209a1e2,0x2d)
> >  25323 java GIO   fd 1 wrote 45 bytes
> >"Could not reserve enough space for code cache"
> > 
> > It seems that MAP_NORESERVE presence could be detected in sys/mman.h and
> > then it is used for some reason.
> > I guess that the port can be easily fixed, but this commit breaks
> > compatibility with older binaries.  Perhaps MAP_NORESERVE should be removed
> > as well given that we do not actually implement it.
> 
> I've allowed it for now, but I do intend on removing it in 11.

I think that the removal procedure should be as follows, in the single
commit:
1. remove the defines from public headers, and move them to vm_mmap.c
2. bump __FreeBSD_version
3. allow the bits for older binaries by p_osrel.

Might be, a comment in mman.h should be kept for the binary value
of MAP_NORESERVE so that person who decide to reuse the bit for
a useful flag would be not surprised.


pgpSnMLOwQrkw.pgp
Description: PGP signature


RE: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce

2014-09-17 Thread David Somayajulu
HI John,
Thanks for the info. I will go ahead and get rid of  "clean" in the Makefile.
Thanks
David S.

-Original Message-
From: John Baldwin [mailto:j...@freebsd.org]
Sent: Wednesday, September 17, 2014 8:02 AM
To: David Somayajulu
Cc: Andrey V. Elsukov; David C Somayajulu; src-committ...@freebsd.org; 
svn-src-all@freebsd.org; svn-src-h...@freebsd.org
Subject: Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce 
sys/dev/bxe sys/modules/bce

On Monday, September 15, 2014 04:31:13 PM David Somayajulu wrote:
> Hi Andrey,
> When I didn't have the clean override,  "make clean" was not cleaning
> properly when I built a standalone loadable driver. Perhaps we can
> change "clean" in bxe/Makefile and bce/Makefile to "dclean".

Try using 'make cleandir' instead of 'make clean'.  'make clean' does not clean 
files created by 'make depend' such as the 'machine' and 'x86' symlinks.
There is a 'make cleandepend' that will clean up such files, but I tend to use 
'make cleandir' which does both.

--
John Baldwin



This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271720 - head/sbin/savecore

2014-09-17 Thread Bryan Drewery
Author: bdrewery
Date: Wed Sep 17 19:09:58 2014
New Revision: 271720
URL: http://svnweb.freebsd.org/changeset/base/271720

Log:
  If fgets(3) fails in getbounds(), show strerror(3) if not an EOF. Also fix
  a FILE* leak in getbounds().
  
  Submitted by: Conrad Meyer 
  PR:   192032
  Sponsored by: EMC / Isilon Storage Division
  MFC after:1 week

Modified:
  head/sbin/savecore/savecore.c

Modified: head/sbin/savecore/savecore.c
==
--- head/sbin/savecore/savecore.c   Wed Sep 17 19:01:22 2014
(r271719)
+++ head/sbin/savecore/savecore.c   Wed Sep 17 19:09:58 2014
(r271720)
@@ -151,7 +151,10 @@ getbounds(void) {
}
 
if (fgets(buf, sizeof buf, fp) == NULL) {
-   syslog(LOG_WARNING, "unable to read from bounds, using 0");
+   if (feof(fp))
+   syslog(LOG_WARNING, "bounds file is empty, using 0");
+   else
+   syslog(LOG_WARNING, "bounds file: %s", strerror(errno));
fclose(fp);
return (ret);
}
@@ -160,6 +163,7 @@ getbounds(void) {
ret = (int)strtol(buf, NULL, 10);
if (ret == 0 && (errno == EINVAL || errno == ERANGE))
syslog(LOG_WARNING, "invalid value found in bounds, using 0");
+   fclose(fp);
return (ret);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271719 - in head/lib/msun: ld128 ld80 src

2014-09-17 Thread Steve Kargl
Author: kargl
Date: Wed Sep 17 19:01:22 2014
New Revision: 271719
URL: http://svnweb.freebsd.org/changeset/base/271719

Log:
  For targets that have a signed zero, lgamma_r(-0, &signgamp) should
  set signgamp = -1.
  
  Submitted by: enh at google dot com (e_lgamma[f]_r.c)

Modified:
  head/lib/msun/ld128/e_lgammal_r.c
  head/lib/msun/ld80/e_lgammal_r.c
  head/lib/msun/src/e_lgamma_r.c
  head/lib/msun/src/e_lgammaf_r.c

Modified: head/lib/msun/ld128/e_lgammal_r.c
==
--- head/lib/msun/ld128/e_lgammal_r.c   Wed Sep 17 18:59:25 2014
(r271718)
+++ head/lib/msun/ld128/e_lgammal_r.c   Wed Sep 17 19:01:22 2014
(r271719)
@@ -241,7 +241,11 @@ lgammal_r(long double x, int *signgamp)
*signgamp = 1;
if((hx & 0x7fff) == 0x7fff) /* x is +-Inf or NaN */
return x*x;
-   if((hx==0||hx==0x8000)&&lx==0) return one/vzero;
+   if((hx==0||hx==0x8000)&&lx==0) {
+   if (hx&0x8000)
+   *signgamp = -1;
+   return one/vzero;
+   }
 
/* purge off tiny and negative arguments */
if(fabsl(x)<0x1p-119L) {

Modified: head/lib/msun/ld80/e_lgammal_r.c
==
--- head/lib/msun/ld80/e_lgammal_r.cWed Sep 17 18:59:25 2014
(r271718)
+++ head/lib/msun/ld80/e_lgammal_r.cWed Sep 17 19:01:22 2014
(r271719)
@@ -261,7 +261,11 @@ lgammal_r(long double x, int *signgamp)
*signgamp = 1;
if((hx & 0x7fff) == 0x7fff) /* x is +-Inf or NaN */
return x*x;
-   if((hx==0||hx==0x8000)&&lx==0) return one/vzero;
+   if((hx==0||hx==0x8000)&&lx==0) {
+   if (hx&0x8000)
+   *signgamp = -1;
+   return one/vzero;
+   }
 
ENTERI();
 

Modified: head/lib/msun/src/e_lgamma_r.c
==
--- head/lib/msun/src/e_lgamma_r.c  Wed Sep 17 18:59:25 2014
(r271718)
+++ head/lib/msun/src/e_lgamma_r.c  Wed Sep 17 19:01:22 2014
(r271719)
@@ -214,7 +214,11 @@ __ieee754_lgamma_r(double x, int *signga
*signgamp = 1;
ix = hx&0x7fff;
if(ix>=0x7ff0) return x*x;
-   if((ix|lx)==0) return one/vzero;
+   if((ix|lx)==0) {
+  if(hx<0)
+   *signgamp = -1;
+   return one/vzero;
+   }
if(ix<0x3b90) { /* |x|<2**-70, return -log(|x|) */
if(hx<0) {
*signgamp = -1;

Modified: head/lib/msun/src/e_lgammaf_r.c
==
--- head/lib/msun/src/e_lgammaf_r.c Wed Sep 17 18:59:25 2014
(r271718)
+++ head/lib/msun/src/e_lgammaf_r.c Wed Sep 17 19:01:22 2014
(r271719)
@@ -132,7 +132,11 @@ __ieee754_lgammaf_r(float x, int *signga
*signgamp = 1;
ix = hx&0x7fff;
if(ix>=0x7f80) return x*x;
-   if(ix==0) return one/vzero;
+   if(ix==0) {
+   if(hx<0)
+   *signgamp = -1;
+   return one/vzero;
+   }
if(ix<0x3500) { /* |x|<2**-21, return -log(|x|) */
if(hx<0) {
*signgamp = -1;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271718 - head/sys/cam

2014-09-17 Thread Bryan Drewery
Author: bdrewery
Date: Wed Sep 17 18:59:25 2014
New Revision: 271718
URL: http://svnweb.freebsd.org/changeset/base/271718

Log:
  Correct a comment

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Wed Sep 17 18:55:39 2014(r271717)
+++ head/sys/cam/cam_xpt.c  Wed Sep 17 18:59:25 2014(r271718)
@@ -3052,7 +3052,7 @@ xpt_polled_action(union ccb *start_ccb)
 }
 
 /*
- * Schedule a peripheral driver to receive a ccb when it's
+ * Schedule a peripheral driver to receive a ccb when its
  * target device has space for more transactions.
  */
 void
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271717 - in head/sys: dev/acpica sparc64/pci

2014-09-17 Thread John Baldwin
Author: jhb
Date: Wed Sep 17 18:55:39 2014
New Revision: 271717
URL: http://svnweb.freebsd.org/changeset/base/271717

Log:
  Revert unrelated changes accidentally committed in r271192.

Modified:
  head/sys/dev/acpica/acpi.c
  head/sys/sparc64/pci/psycho.c

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Wed Sep 17 18:49:57 2014(r271716)
+++ head/sys/dev/acpica/acpi.c  Wed Sep 17 18:55:39 2014(r271717)
@@ -1211,11 +1211,6 @@ acpi_set_resource(device_t dev, device_t
if (!(type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT))
 #endif
{
-   if (bootverbose)
-   device_printf(dev,
-   "Ignoring %s range %#lx-%#lx for %s\n",
-   type == SYS_RES_MEMORY ? "memory" : "I/O",
-   start, start + count - 1, acpi_name(ad->ad_handle));
AcpiOsFree(devinfo);
return (0);
}

Modified: head/sys/sparc64/pci/psycho.c
==
--- head/sys/sparc64/pci/psycho.c   Wed Sep 17 18:49:57 2014
(r271716)
+++ head/sys/sparc64/pci/psycho.c   Wed Sep 17 18:55:39 2014
(r271717)
@@ -448,30 +448,24 @@ psycho_attach(device_t dev)
 
i = OF_getprop_alloc(node, "ranges", sizeof(*range), (void **)&range);
/*
+* Make sure that the expected ranges are present.  The
+* OFW_PCI_CS_MEM64 one is not currently used though.
+*/
+   if (i != PSYCHO_NRANGE)
+   panic("%s: unsupported number of ranges", __func__);
+   /*
 * Find the addresses of the various bus spaces.
 * There should not be multiple ones of one kind.
 * The physical start addresses of the ranges are the configuration,
 * memory and I/O handles.
 */
-   for (; i >= 0; i--) {
+   for (i = 0; i < PSYCHO_NRANGE; i++) {
j = OFW_PCI_RANGE_CS(&range[i]);
if (sc->sc_pci_bh[j] != 0)
panic("%s: duplicate range for space %d",
__func__, j);
sc->sc_pci_bh[j] = OFW_PCI_RANGE_PHYS(&range[i]);
}
-
-   /*
-* Make sure that the expected ranges are present.  The
-* OFW_PCI_CS_MEM64 one is not currently used.
-*/
-   if (sc->sc_pci_bh[OFW_PCI_CS_CONFIG] == 0)
-   panic("%s: missing CONFIG range", __func__);
-   if (sc->sc_pci_bh[OFW_PCI_CS_IO] == 0)
-   panic("%s: missing IO range", __func__);
-   if (sc->sc_pci_bh[OFW_PCI_CS_MEM32] == 0)
-   panic("%s: missing MEM32 range", __func__);
-   
free(range, M_OFWPROP);
 
/* Register the softc, this is needed for paired Psychos. */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271716 - in head/sys: amd64/amd64 i386/i386

2014-09-17 Thread Konstantin Belousov
Author: kib
Date: Wed Sep 17 18:49:57 2014
New Revision: 271716
URL: http://svnweb.freebsd.org/changeset/base/271716

Log:
  Presence of any VM_PROT bits in the permission argument on x86 implies
  that the entry is readable and valid.
  
  Reported by:  markj
  Submitted by: alc
  Tested by:pho (previous version), markj
  MFC after:3 days

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Wed Sep 17 18:46:51 2014(r271715)
+++ head/sys/amd64/amd64/pmap.c Wed Sep 17 18:49:57 2014(r271716)
@@ -3845,7 +3845,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
pt_entry_t *pte, PG_G, PG_M, PG_RW, PG_V;
boolean_t anychanged, pv_lists_locked;
 
-   if ((prot & VM_PROT_READ) == VM_PROT_NONE) {
+   KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot));
+   if (prot == VM_PROT_NONE) {
pmap_remove(pmap, sva, eva);
return;
}

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Wed Sep 17 18:46:51 2014(r271715)
+++ head/sys/i386/i386/pmap.c   Wed Sep 17 18:49:57 2014(r271716)
@@ -3161,7 +3161,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
pt_entry_t *pte;
boolean_t anychanged, pv_lists_locked;
 
-   if ((prot & VM_PROT_READ) == VM_PROT_NONE) {
+   KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot));
+   if (prot == VM_PROT_NONE) {
pmap_remove(pmap, sva, eva);
return;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271714 - in stable: 10/sys/dev/if_ndis 9/sys/dev/if_ndis

2014-09-17 Thread John Baldwin
Author: jhb
Date: Wed Sep 17 18:17:18 2014
New Revision: 271714
URL: http://svnweb.freebsd.org/changeset/base/271714

Log:
  MFC 270830:
  When anouncing link state changes on an 802.11 interface with a vap,
  announce the change on the vap's ifnet instead of the main ifnet.  This
  matches the behavior of other wireless drivers in the tree and allows the
  default devd configuration to correctly start dhclient automatically after
  an ndis wireless device associates.
  
  Approved by:  re (marius for 10)

Modified:
  stable/10/sys/dev/if_ndis/if_ndis.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/9/sys/dev/if_ndis/if_ndis.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/10/sys/dev/if_ndis/if_ndis.c
==
--- stable/10/sys/dev/if_ndis/if_ndis.c Wed Sep 17 17:43:32 2014
(r271713)
+++ stable/10/sys/dev/if_ndis/if_ndis.c Wed Sep 17 18:17:18 2014
(r271714)
@@ -1709,23 +1709,26 @@ ndis_ticktask(d, xsc)
if (sc->ndis_link == 0 &&
sc->ndis_sts == NDIS_STATUS_MEDIA_CONNECT) {
sc->ndis_link = 1;
-   NDIS_UNLOCK(sc);
if ((sc->ndis_80211 != 0) && (vap != NULL)) {
+   NDIS_UNLOCK(sc);
ndis_getstate_80211(sc);
ieee80211_new_state(vap, IEEE80211_S_RUN, -1);
-   }
-   NDIS_LOCK(sc);
-   if_link_state_change(sc->ifp, LINK_STATE_UP);
+   NDIS_LOCK(sc);
+   if_link_state_change(vap->iv_ifp, LINK_STATE_UP);
+   } else
+   if_link_state_change(sc->ifp, LINK_STATE_UP);
}
 
if (sc->ndis_link == 1 &&
sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) {
sc->ndis_link = 0;
-   NDIS_UNLOCK(sc);
-   if ((sc->ndis_80211 != 0) && (vap != NULL))
+   if ((sc->ndis_80211 != 0) && (vap != NULL)) {
+   NDIS_UNLOCK(sc);
ieee80211_new_state(vap, IEEE80211_S_SCAN, 0);
-   NDIS_LOCK(sc);
-   if_link_state_change(sc->ifp, LINK_STATE_DOWN);
+   NDIS_LOCK(sc);
+   if_link_state_change(vap->iv_ifp, LINK_STATE_DOWN);
+   } else
+   if_link_state_change(sc->ifp, LINK_STATE_DOWN);
}
 
NDIS_UNLOCK(sc);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271714 - in stable: 10/sys/dev/if_ndis 9/sys/dev/if_ndis

2014-09-17 Thread John Baldwin
Author: jhb
Date: Wed Sep 17 18:17:18 2014
New Revision: 271714
URL: http://svnweb.freebsd.org/changeset/base/271714

Log:
  MFC 270830:
  When anouncing link state changes on an 802.11 interface with a vap,
  announce the change on the vap's ifnet instead of the main ifnet.  This
  matches the behavior of other wireless drivers in the tree and allows the
  default devd configuration to correctly start dhclient automatically after
  an ndis wireless device associates.
  
  Approved by:  re (marius for 10)

Modified:
  stable/9/sys/dev/if_ndis/if_ndis.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/dev/if_ndis/if_ndis.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/9/sys/dev/if_ndis/if_ndis.c
==
--- stable/9/sys/dev/if_ndis/if_ndis.c  Wed Sep 17 17:43:32 2014
(r271713)
+++ stable/9/sys/dev/if_ndis/if_ndis.c  Wed Sep 17 18:17:18 2014
(r271714)
@@ -1710,23 +1710,26 @@ ndis_ticktask(d, xsc)
if (sc->ndis_link == 0 &&
sc->ndis_sts == NDIS_STATUS_MEDIA_CONNECT) {
sc->ndis_link = 1;
-   NDIS_UNLOCK(sc);
if ((sc->ndis_80211 != 0) && (vap != NULL)) {
+   NDIS_UNLOCK(sc);
ndis_getstate_80211(sc);
ieee80211_new_state(vap, IEEE80211_S_RUN, -1);
-   }
-   NDIS_LOCK(sc);
-   if_link_state_change(sc->ifp, LINK_STATE_UP);
+   NDIS_LOCK(sc);
+   if_link_state_change(vap->iv_ifp, LINK_STATE_UP);
+   } else
+   if_link_state_change(sc->ifp, LINK_STATE_UP);
}
 
if (sc->ndis_link == 1 &&
sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) {
sc->ndis_link = 0;
-   NDIS_UNLOCK(sc);
-   if ((sc->ndis_80211 != 0) && (vap != NULL))
+   if ((sc->ndis_80211 != 0) && (vap != NULL)) {
+   NDIS_UNLOCK(sc);
ieee80211_new_state(vap, IEEE80211_S_SCAN, 0);
-   NDIS_LOCK(sc);
-   if_link_state_change(sc->ifp, LINK_STATE_DOWN);
+   NDIS_LOCK(sc);
+   if_link_state_change(vap->iv_ifp, LINK_STATE_DOWN);
+   } else
+   if_link_state_change(sc->ifp, LINK_STATE_DOWN);
}
 
NDIS_UNLOCK(sc);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce

2014-09-17 Thread John Baldwin
On Monday, September 15, 2014 04:31:13 PM David Somayajulu wrote:
> Hi Andrey,
> When I didn't have the clean override,  "make clean" was not cleaning
> properly when I built a standalone loadable driver. Perhaps we can change
> "clean" in bxe/Makefile and bce/Makefile to "dclean".

Try using 'make cleandir' instead of 'make clean'.  'make clean' does not 
clean files created by 'make depend' such as the 'machine' and 'x86' symlinks.  
There is a 'make cleandepend' that will clean up such files, but I tend to use 
'make cleandir' which does both.

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


Re: svn commit: r271635 - in head: lib/libc/sys sys/vm

2014-09-17 Thread John Baldwin
On Tuesday, September 16, 2014 04:38:21 PM Andriy Gapon wrote:
> On 15/09/2014 20:20, John Baldwin wrote:
> > Author: jhb
> > Date: Mon Sep 15 17:20:13 2014
> > New Revision: 271635
> > URL: http://svnweb.freebsd.org/changeset/base/271635
> > 
> > Log:
> >   Add stricter checking of some mmap() arguments:
> >   - Fail with EINVAL if an invalid protection mask is passed to mmap().
> >   - Fail with EINVAL if an unknown flag is passed to mmap().
> >   - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to
> >   mmap().
> >   - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous
> >   
> > mappings.
> 
> This broke Java, at least java/openjdk7, for me:
> 
>  25323 java CALL
> mmap(0,0x300,0x3,0x1042 MAP_ANON>,0x,0) 25323 java RET   mmap -1 errno 22 Invalid
> argument
>  25323 java CALL  write(0x1,0x7fbfd450,0x2b)
>  25323 java GIO   fd 1 wrote 43 bytes
>"Error occurred during initialization of VM
>"
>  25323 java RET   write 43/0x2b
>  25323 java CALL  write(0x1,0x80209a1e2,0x2d)
>  25323 java GIO   fd 1 wrote 45 bytes
>"Could not reserve enough space for code cache"
> 
> It seems that MAP_NORESERVE presence could be detected in sys/mman.h and
> then it is used for some reason.
> I guess that the port can be easily fixed, but this commit breaks
> compatibility with older binaries.  Perhaps MAP_NORESERVE should be removed
> as well given that we do not actually implement it.

I've allowed it for now, but I do intend on removing it in 11.

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


svn commit: r271713 - head/sys/kern

2014-09-17 Thread Alexander Motin
Author: mav
Date: Wed Sep 17 17:43:32 2014
New Revision: 271713
URL: http://svnweb.freebsd.org/changeset/base/271713

Log:
  Reprase r271616 comments.
  
  Submitted by: alc
  MFC after:1 month

Modified:
  head/sys/kern/sched_ule.c

Modified: head/sys/kern/sched_ule.c
==
--- head/sys/kern/sched_ule.c   Wed Sep 17 17:33:22 2014(r271712)
+++ head/sys/kern/sched_ule.c   Wed Sep 17 17:43:32 2014(r271713)
@@ -1039,8 +1039,8 @@ tdq_notify(struct tdq *tdq, struct threa
return;
 
/*
-* Make sure that tdq_load updated before calling this function
-* is globally visible before we read tdq_cpu_idle.  Idle thread
+* Make sure that our caller's earlier update to tdq_load is
+* globally visible before we read tdq_cpu_idle.  Idle thread
 * accesses both of them without locks, and the order is important.
 */
mb();
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r271707 - stable/10/sys/kern

2014-09-17 Thread Andrey Chernov
On 17.09.2014 21:35, Alexander Motin wrote:
> On 17.09.2014 20:08, Alan Cox wrote:
>> On 09/17/2014 11:46, Alexander Motin wrote:
>>> On 17.09.2014 19:16, Andrey Chernov wrote:
 On 17.09.2014 18:06, Alexander Motin wrote:
> + /*
> +  * Make sure that tdq_load updated before calling this function
> +  * is globally visible before we read tdq_cpu_idle.  Idle thread
> +  * accesses both of them without locks, and the order is important.
> +  */
> + mb();
> +
>   if (TD_IS_IDLETHREAD(ctd)) {
 I don't understand this comment's first phrase with two verbs. Copy &
 paste result?
>>> No, only possibly missing commas around "updated before calling this
>>> function".
>>
>>
>> Commas alone don't fix the problem.  I think what you're trying to say is:
>>
>> "Make sure that our caller's earlier update to tdq_load is globally
>> visible before we read tdq_cpu_idle."
> 
> Yes, that was my intention. Thank you. Please excuse my non-native
> English and correct it as you feel better.
> 
> Andrey, would that reveal your questions?

Sound nice for me, commit, please.

> 
 I also don't see tdq_load access in this function.
>>> It is incremented by tdq_load_add(), called by tdq_add(), called by
>>> sched_add(), just before calling tdq_notify().
> 


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


Re: svn commit: r271707 - stable/10/sys/kern

2014-09-17 Thread Alexander Motin
On 17.09.2014 20:08, Alan Cox wrote:
> On 09/17/2014 11:46, Alexander Motin wrote:
>> On 17.09.2014 19:16, Andrey Chernov wrote:
>>> On 17.09.2014 18:06, Alexander Motin wrote:
 +  /*
 +   * Make sure that tdq_load updated before calling this function
 +   * is globally visible before we read tdq_cpu_idle.  Idle thread
 +   * accesses both of them without locks, and the order is important.
 +   */
 +  mb();
 +
if (TD_IS_IDLETHREAD(ctd)) {
>>> I don't understand this comment's first phrase with two verbs. Copy &
>>> paste result?
>> No, only possibly missing commas around "updated before calling this
>> function".
> 
> 
> Commas alone don't fix the problem.  I think what you're trying to say is:
> 
> "Make sure that our caller's earlier update to tdq_load is globally
> visible before we read tdq_cpu_idle."

Yes, that was my intention. Thank you. Please excuse my non-native
English and correct it as you feel better.

Andrey, would that reveal your questions?

>>> I also don't see tdq_load access in this function.
>> It is incremented by tdq_load_add(), called by tdq_add(), called by
>> sched_add(), just before calling tdq_notify().

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


svn commit: r271712 - in head/sys: kern mips/cavium powerpc/powerpc sparc64/sparc64 sys x86/x86

2014-09-17 Thread Adrian Chadd
Author: adrian
Date: Wed Sep 17 17:33:22 2014
New Revision: 271712
URL: http://svnweb.freebsd.org/changeset/base/271712

Log:
  Migrate ie->ie_assign_cpu and associated code to use an int for CPU rather
  than u_char.
  
  Migrate post_filter to use an int for a CPU rather than u_char.
  
  Change intr_event_bind() to use an int for CPU rather than u_char.
  
  It touches the ppc, sparc64, arm and mips machdep code but it should
  (hah!) be a no-op.
  
  Tested:
  
  * i386, AMD64 laptops
  
  Reviewed by:  jhb

Modified:
  head/sys/kern/kern_intr.c
  head/sys/mips/cavium/ciu.c
  head/sys/powerpc/powerpc/intr_machdep.c
  head/sys/sparc64/sparc64/intr_machdep.c
  head/sys/sys/interrupt.h
  head/sys/x86/x86/intr_machdep.c

Modified: head/sys/kern/kern_intr.c
==
--- head/sys/kern/kern_intr.c   Wed Sep 17 16:45:20 2014(r271711)
+++ head/sys/kern/kern_intr.c   Wed Sep 17 17:33:22 2014(r271712)
@@ -249,7 +249,7 @@ intr_event_update(struct intr_event *ie)
 int
 intr_event_create(struct intr_event **event, void *source, int flags, int irq,
 void (*pre_ithread)(void *), void (*post_ithread)(void *),
-void (*post_filter)(void *), int (*assign_cpu)(void *, u_char),
+void (*post_filter)(void *), int (*assign_cpu)(void *, int),
 const char *fmt, ...)
 {
struct intr_event *ie;
@@ -292,7 +292,7 @@ intr_event_create(struct intr_event **ev
  * the interrupt event.
  */
 int
-intr_event_bind(struct intr_event *ie, u_char cpu)
+intr_event_bind(struct intr_event *ie, int cpu)
 {
lwpid_t id;
int error;
@@ -1078,7 +1078,7 @@ intr_event_schedule_thread(struct intr_e
  * a PIC.
  */
 static int
-swi_assign_cpu(void *arg, u_char cpu)
+swi_assign_cpu(void *arg, int cpu)
 {
 
return (0);

Modified: head/sys/mips/cavium/ciu.c
==
--- head/sys/mips/cavium/ciu.c  Wed Sep 17 16:45:20 2014(r271711)
+++ head/sys/mips/cavium/ciu.c  Wed Sep 17 17:33:22 2014(r271712)
@@ -91,13 +91,13 @@ static void ciu_hinted_child(device_t, 
 static voidciu_en0_intr_mask(void *);
 static voidciu_en0_intr_unmask(void *);
 #ifdef SMP
-static int ciu_en0_intr_bind(void *, u_char);
+static int ciu_en0_intr_bind(void *, int);
 #endif
 
 static voidciu_en1_intr_mask(void *);
 static voidciu_en1_intr_unmask(void *);
 #ifdef SMP
-static int ciu_en1_intr_bind(void *, u_char);
+static int ciu_en1_intr_bind(void *, int);
 #endif
 
 static int ciu_intr(void *);
@@ -208,7 +208,7 @@ ciu_setup_intr(device_t bus, device_t ch
struct intr_event *event, **eventp;
void (*mask_func)(void *);
void (*unmask_func)(void *);
-   int (*bind_func)(void *, u_char);
+   int (*bind_func)(void *, int);
mips_intrcnt_t intrcnt;
int error;
int irq;
@@ -343,7 +343,7 @@ ciu_en0_intr_unmask(void *arg)
 
 #ifdef SMP
 static int
-ciu_en0_intr_bind(void *arg, u_char target)
+ciu_en0_intr_bind(void *arg, int target)
 {
uint64_t mask;
int core;
@@ -389,7 +389,7 @@ ciu_en1_intr_unmask(void *arg)
 
 #ifdef SMP
 static int
-ciu_en1_intr_bind(void *arg, u_char target)
+ciu_en1_intr_bind(void *arg, int target)
 {
uint64_t mask;
int core;

Modified: head/sys/powerpc/powerpc/intr_machdep.c
==
--- head/sys/powerpc/powerpc/intr_machdep.c Wed Sep 17 16:45:20 2014
(r271711)
+++ head/sys/powerpc/powerpc/intr_machdep.c Wed Sep 17 17:33:22 2014
(r271712)
@@ -293,7 +293,7 @@ powerpc_intr_post_ithread(void *arg)
 }
 
 static int
-powerpc_assign_intr_cpu(void *arg, u_char cpu)
+powerpc_assign_intr_cpu(void *arg, int cpu)
 {
 #ifdef SMP
struct powerpc_intr *i = arg;

Modified: head/sys/sparc64/sparc64/intr_machdep.c
==
--- head/sys/sparc64/sparc64/intr_machdep.c Wed Sep 17 16:45:20 2014
(r271711)
+++ head/sys/sparc64/sparc64/intr_machdep.c Wed Sep 17 17:33:22 2014
(r271712)
@@ -116,7 +116,7 @@ static void intr_assign_next_cpu(struct 
 static void intr_shuffle_irqs(void *arg __unused);
 #endif
 
-static int intr_assign_cpu(void *arg, u_char cpu);
+static int intr_assign_cpu(void *arg, int cpu);
 static void intr_execute_handlers(void *);
 static void intr_stray_level(struct trapframe *);
 static void intr_stray_vector(void *);
@@ -256,7 +256,7 @@ intr_init2()
 }
 
 static int
-intr_assign_cpu(void *arg, u_char cpu)
+intr_assign_cpu(void *arg, int cpu)
 {
 #ifdef SMP
struct pcpu *pc;

Modified: head/sys/sys/interrupt.h
==
--- head/sys/sys/interrupt.hWed Sep 17 16:45:20 2014(r271711)
+++ head/sy

Re: svn commit: r271707 - stable/10/sys/kern

2014-09-17 Thread Alan Cox
On 09/17/2014 11:46, Alexander Motin wrote:
> On 17.09.2014 19:16, Andrey Chernov wrote:
>> On 17.09.2014 18:06, Alexander Motin wrote:
>>> +   /*
>>> +* Make sure that tdq_load updated before calling this function
>>> +* is globally visible before we read tdq_cpu_idle.  Idle thread
>>> +* accesses both of them without locks, and the order is important.
>>> +*/
>>> +   mb();
>>> +
>>> if (TD_IS_IDLETHREAD(ctd)) {
>> I don't understand this comment's first phrase with two verbs. Copy &
>> paste result?
> No, only possibly missing commas around "updated before calling this
> function".


Commas alone don't fix the problem.  I think what you're trying to say is:

"Make sure that our caller's earlier update to tdq_load is globally
visible before we read tdq_cpu_idle."


>> I also don't see tdq_load access in this function.
> It is incremented by tdq_load_add(), called by tdq_add(), called by
> sched_add(), just before calling tdq_notify().
>

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


Re: svn commit: r271707 - stable/10/sys/kern

2014-09-17 Thread Alexander Motin
On 17.09.2014 19:16, Andrey Chernov wrote:
> On 17.09.2014 18:06, Alexander Motin wrote:
>> +/*
>> + * Make sure that tdq_load updated before calling this function
>> + * is globally visible before we read tdq_cpu_idle.  Idle thread
>> + * accesses both of them without locks, and the order is important.
>> + */
>> +mb();
>> +
>>  if (TD_IS_IDLETHREAD(ctd)) {
> 
> I don't understand this comment's first phrase with two verbs. Copy &
> paste result?

No, only possibly missing commas around "updated before calling this
function".

> I also don't see tdq_load access in this function.

It is incremented by tdq_load_add(), called by tdq_add(), called by
sched_add(), just before calling tdq_notify().

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


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

2014-09-17 Thread Glen Barber
Author: gjb
Date: Wed Sep 17 16:45:20 2014
New Revision: 271711
URL: http://svnweb.freebsd.org/changeset/base/271711

Log:
  Update the bhyve(8) manual to reflect that it is no
  longer considered 'experimental.'
  
  Reviewed by:  grehan
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/bhyve/bhyve.8

Modified: head/usr.sbin/bhyve/bhyve.8
==
--- head/usr.sbin/bhyve/bhyve.8 Wed Sep 17 14:20:04 2014(r271710)
+++ head/usr.sbin/bhyve/bhyve.8 Wed Sep 17 16:45:20 2014(r271711)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 26, 2014
+.Dd September 17, 2014
 .Dt BHYVE 8
 .Os
 .Sh NAME
@@ -43,7 +43,7 @@
 .Ar vmname
 .Sh DESCRIPTION
 .Nm
-is an experimental hypervisor that runs guest operating systems inside a
+is a hypervisor that runs guest operating systems inside a
 virtual machine.
 .Pp
 Parameters such as the number of virtual CPUs, amount of guest memory, and
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r271707 - stable/10/sys/kern

2014-09-17 Thread Andrey Chernov
On 17.09.2014 18:06, Alexander Motin wrote:
> + /*
> +  * Make sure that tdq_load updated before calling this function
> +  * is globally visible before we read tdq_cpu_idle.  Idle thread
> +  * accesses both of them without locks, and the order is important.
> +  */
> + mb();
> +
>   if (TD_IS_IDLETHREAD(ctd)) {

I don't understand this comment's first phrase with two verbs. Copy &
paste result?
I also don't see tdq_load access in this function.

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


svn commit: r271710 - in stable/9/sys/dev: ahci usb/wlan

2014-09-17 Thread Alexander Motin
Author: mav
Date: Wed Sep 17 14:20:04 2014
New Revision: 271710
URL: http://svnweb.freebsd.org/changeset/base/271710

Log:
  MFC r271403: Add PCI ID for Promise TX8660 8-port 3Gbps HBA.
  
  This device reports RAID subclass, but appears to be AHCI compatible.
  
  Submitted by: Yuri Perejilin 

Modified:
  stable/9/sys/dev/ahci/ahci.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/forth/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/i386/gptboot/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/dev/run/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/isp/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/dev/puc/   (props changed)
  stable/9/sys/dev/usb/wlan/if_run.c   (props changed)
  stable/9/sys/dev/usb/wlan/if_runreg.h   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)
  stable/9/sys/modules/ixgbe/   (props changed)
  stable/9/sys/modules/svr4/   (props changed)
  stable/9/sys/net/   (props changed)
  stable/9/sys/netpfil/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/9/sys/dev/ahci/ahci.c
==
--- stable/9/sys/dev/ahci/ahci.cWed Sep 17 14:17:39 2014
(r271709)
+++ stable/9/sys/dev/ahci/ahci.cWed Sep 17 14:20:04 2014
(r271710)
@@ -355,6 +355,7 @@ static struct {
{0x0d8d10de, 0x00, "NVIDIA MCP89",  AHCI_Q_NOAA},
{0x0d8e10de, 0x00, "NVIDIA MCP89",  AHCI_Q_NOAA},
{0x0d8f10de, 0x00, "NVIDIA MCP89",  AHCI_Q_NOAA},
+   {0x3781105a, 0x00, "Promise TX8660",0},
{0x33491106, 0x00, "VIA VT8251",AHCI_Q_NOPMP|AHCI_Q_NONCQ},
{0x62871106, 0x00, "VIA VT8251",AHCI_Q_NOPMP|AHCI_Q_NONCQ},
{0x11841039, 0x00, "SiS 966",   0},
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271709 - stable/10/sys/dev/ahci

2014-09-17 Thread Alexander Motin
Author: mav
Date: Wed Sep 17 14:17:39 2014
New Revision: 271709
URL: http://svnweb.freebsd.org/changeset/base/271709

Log:
  MFC r271403: Add PCI ID for Promise TX8660 8-port 3Gbps HBA.
  
  This device reports RAID subclass, but appears to be AHCI compatible.
  
  Submitted by: Yuri Perejilin 
  Approved by:  re (gjb)

Modified:
  stable/10/sys/dev/ahci/ahci.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/ahci/ahci.c
==
--- stable/10/sys/dev/ahci/ahci.c   Wed Sep 17 14:07:40 2014
(r271708)
+++ stable/10/sys/dev/ahci/ahci.c   Wed Sep 17 14:17:39 2014
(r271709)
@@ -351,6 +351,7 @@ static struct {
{0x0d8d10de, 0x00, "NVIDIA MCP89",  AHCI_Q_NOAA},
{0x0d8e10de, 0x00, "NVIDIA MCP89",  AHCI_Q_NOAA},
{0x0d8f10de, 0x00, "NVIDIA MCP89",  AHCI_Q_NOAA},
+   {0x3781105a, 0x00, "Promise TX8660",0},
{0x33491106, 0x00, "VIA VT8251",AHCI_Q_NOPMP|AHCI_Q_NONCQ},
{0x62871106, 0x00, "VIA VT8251",AHCI_Q_NOPMP|AHCI_Q_NONCQ},
{0x11841039, 0x00, "SiS 966",   0},
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271708 - stable/9/sys/kern

2014-09-17 Thread Alexander Motin
Author: mav
Date: Wed Sep 17 14:07:40 2014
New Revision: 271708
URL: http://svnweb.freebsd.org/changeset/base/271708

Log:
  MFC r271604, r271616:
  Add couple memory barriers to order tdq_cpu_idle and tdq_load accesses.
  
  This change fixes transient performance drops in some of my benchmarks,
  vanishing as soon as I am trying to collect any stats from the scheduler.
  It looks like reordered access to those variables sometimes caused loss of
  IPI_PREEMPT, that delayed thread execution until some later interrupt.

Modified:
  stable/9/sys/kern/sched_ule.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/sched_ule.c
==
--- stable/9/sys/kern/sched_ule.c   Wed Sep 17 14:06:21 2014
(r271707)
+++ stable/9/sys/kern/sched_ule.c   Wed Sep 17 14:07:40 2014
(r271708)
@@ -1006,6 +1006,14 @@ tdq_notify(struct tdq *tdq, struct threa
ctd = pcpu_find(cpu)->pc_curthread;
if (!sched_shouldpreempt(pri, ctd->td_priority, 1))
return;
+
+   /*
+* Make sure that tdq_load updated before calling this function
+* is globally visible before we read tdq_cpu_idle.  Idle thread
+* accesses both of them without locks, and the order is important.
+*/
+   mb();
+
if (TD_IS_IDLETHREAD(ctd)) {
/*
 * If the MD code has an idle wakeup routine try that before
@@ -2607,6 +2615,12 @@ sched_idletd(void *dummy)
 
/* Run main MD idle handler. */
tdq->tdq_cpu_idle = 1;
+   /*
+* Make sure that tdq_cpu_idle update is globally visible
+* before cpu_idle() read tdq_load.  The order is important
+* to avoid race with tdq_notify.
+*/
+   mb();
cpu_idle(switchcnt * 4 > sched_idlespinthresh);
tdq->tdq_cpu_idle = 0;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271707 - stable/10/sys/kern

2014-09-17 Thread Alexander Motin
Author: mav
Date: Wed Sep 17 14:06:21 2014
New Revision: 271707
URL: http://svnweb.freebsd.org/changeset/base/271707

Log:
  MFC r271604, r271616:
  Add couple memory barriers to order tdq_cpu_idle and tdq_load accesses.
  
  This change fixes transient performance drops in some of my benchmarks,
  vanishing as soon as I am trying to collect any stats from the scheduler.
  It looks like reordered access to those variables sometimes caused loss of
  IPI_PREEMPT, that delayed thread execution until some later interrupt.
  
  Approved by:  re (marius)

Modified:
  stable/10/sys/kern/sched_ule.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/sched_ule.c
==
--- stable/10/sys/kern/sched_ule.c  Wed Sep 17 08:47:58 2014
(r271706)
+++ stable/10/sys/kern/sched_ule.c  Wed Sep 17 14:06:21 2014
(r271707)
@@ -1037,6 +1037,14 @@ tdq_notify(struct tdq *tdq, struct threa
ctd = pcpu_find(cpu)->pc_curthread;
if (!sched_shouldpreempt(pri, ctd->td_priority, 1))
return;
+
+   /*
+* Make sure that tdq_load updated before calling this function
+* is globally visible before we read tdq_cpu_idle.  Idle thread
+* accesses both of them without locks, and the order is important.
+*/
+   mb();
+
if (TD_IS_IDLETHREAD(ctd)) {
/*
 * If the MD code has an idle wakeup routine try that before
@@ -2645,6 +2653,12 @@ sched_idletd(void *dummy)
 
/* Run main MD idle handler. */
tdq->tdq_cpu_idle = 1;
+   /*
+* Make sure that tdq_cpu_idle update is globally visible
+* before cpu_idle() read tdq_load.  The order is important
+* to avoid race with tdq_notify.
+*/
+   mb();
cpu_idle(switchcnt * 4 > sched_idlespinthresh);
tdq->tdq_cpu_idle = 0;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2014-09-17 Thread Justin T. Gibbs
On Sep 17, 2014, at 4:38 AM, Andriy Gapon  wrote:

> On 25/07/2014 21:41, Xin LI wrote:
>> Author: delphij
>> Date: Fri Jul 25 18:41:56 2014
>> New Revision: 269093
>> URL: http://svnweb.freebsd.org/changeset/base/269093
>> 
>> Log:
>>  Transform the I/O when vdev_physical_ashift is greater than
>>  SPA_MINBLOCKSHIFT.
> 
> This commit seems illogical to me.
> I do not see why a fact that the _physical_ sector size is greater than 512B
> (e.g. 4KB) should force a data buffer of a "physical" zio to be rounded up 
> using
> ashift.
> To give an example.  ZFS knows that a vdev has physical sector size of 4KB, 
> but
> a logical sector size of 512B.  ZFS uses ashift of 12 for the vdev.
> Nevertheless in some situations ZFS wants to make a physical / special write 
> of
> 512B (taking advantage of RMW).  Why should we force that write to become 4KB
> with data beyond the first 512B being all zeros?
> 
> It would be logical to check for a logical sector size and to enforce it, but
> that is not what this commit does.
> 
> This commit is against the spirit of commit r268855.  It was specifically to
> allow ZFS physical writes to have smaller alignments than otherwise would be
> dictated by ashift.

I too don’t see the motivation behind this commit unless it was an attempt to 
get 4K native devices to work (i.e. devices that fail, by design, accesses 
smaller than 4K).  If this is the case, this is not the correct fix.  Since the 
transform doesn’t do RMW, it seems like this can also cause data loss.
 
> 
> I think that this commit should be reverted.  If ZFS wants to make a physical
> I/O operation with a particular alignment then it must be allowed to.  If that
> operation is invalid for a certain vdev, then it is higher level code that 
> must
> be modified to account for the logical sector size.  The physical zio must be
> _created_ correctly, it should not be silently transformed.

vdev_logical_ashift must be consulted when performing ZIO_FLAG_PHYSICAL I/O 
instead of assuming vdev_logical_ashift is 9.  (It is unfortunate that the zio 
flag is named this way since the I/O is *not* constrained by the physical 
characteristics of the media, but rather by the logical restrictions of the 
software running on it.)  r268855 doesn’t do this because illumos doesn’t 
(yet?) have this information in their vdev structure.  However, we’ve had it 
since r254591 so the MFV in r268855 wasn’t complete.  Catching the misalignment 
in zio.c is more user/developer friendly than having the CAM layer return EIO 
and convince ZFS that this is a media failure.  But, as Andriy points out, the 
upper level code that might issue these I/Os must be changed to understand 
“logical sector size”.

—
Justin

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


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

2014-09-17 Thread Andriy Gapon
On 25/07/2014 21:41, Xin LI wrote:
> Author: delphij
> Date: Fri Jul 25 18:41:56 2014
> New Revision: 269093
> URL: http://svnweb.freebsd.org/changeset/base/269093
> 
> Log:
>   Transform the I/O when vdev_physical_ashift is greater than
>   SPA_MINBLOCKSHIFT.

This commit seems illogical to me.
I do not see why a fact that the _physical_ sector size is greater than 512B
(e.g. 4KB) should force a data buffer of a "physical" zio to be rounded up using
ashift.
To give an example.  ZFS knows that a vdev has physical sector size of 4KB, but
a logical sector size of 512B.  ZFS uses ashift of 12 for the vdev.
Nevertheless in some situations ZFS wants to make a physical / special write of
512B (taking advantage of RMW).  Why should we force that write to become 4KB
with data beyond the first 512B being all zeros?

It would be logical to check for a logical sector size and to enforce it, but
that is not what this commit does.

This commit is against the spirit of commit r268855.  It was specifically to
allow ZFS physical writes to have smaller alignments than otherwise would be
dictated by ashift.

I think that this commit should be reverted.  If ZFS wants to make a physical
I/O operation with a particular alignment then it must be allowed to.  If that
operation is invalid for a certain vdev, then it is higher level code that must
be modified to account for the logical sector size.  The physical zio must be
_created_ correctly, it should not be silently transformed.

>   MFC after:  2 weeks
> 
> Modified:
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
> 
> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
> ==
> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jul 25 
> 18:20:56 2014(r269092)
> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jul 25 
> 18:41:56 2014(r269093)
> @@ -2622,7 +2622,8 @@ zio_vdev_io_start(zio_t **ziop)
>  
>   align = 1ULL << vd->vdev_top->vdev_ashift;
>  
> - if (!(zio->io_flags & ZIO_FLAG_PHYSICAL) &&
> + if ((!(zio->io_flags & ZIO_FLAG_PHYSICAL) ||
> + (vd->vdev_top->vdev_physical_ashift > SPA_MINBLOCKSHIFT)) &&
>   P2PHASE(zio->io_size, align) != 0) {
>   /* Transform logical writes to be a full physical block size. */
>   uint64_t asize = P2ROUNDUP(zio->io_size, align);
> 


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


svn commit: r271706 - stable/10/usr.sbin/iscsid

2014-09-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Sep 17 08:47:58 2014
New Revision: 271706
URL: http://svnweb.freebsd.org/changeset/base/271706

Log:
  MFC r271437:
  
  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
  Approved by:  re (kib)
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/usr.sbin/iscsid/login.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/iscsid/login.c
==
--- stable/10/usr.sbin/iscsid/login.c   Wed Sep 17 08:28:50 2014
(r271705)
+++ stable/10/usr.sbin/iscsid/login.c   Wed Sep 17 08:47:58 2014
(r271706)
@@ -574,7 +574,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);
@@ -628,19 +628,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-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271705 - in head/sys: dev/drm2 dev/drm2/i915 modules/drm2/i915kms sys

2014-09-17 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Wed Sep 17 08:28:50 2014
New Revision: 271705
URL: http://svnweb.freebsd.org/changeset/base/271705

Log:
  drm/i915: Add HW context support
  
  This feature is required by Mesa 9.2+. Without this, a GL application
  crashes with the following message:
  # glxinfo
  name of display: :0.0
  Gen6+ requires Kernel 3.6 or later.
  Assertion failed: (ctx->Version > 0), function handle_first_current,
file ../../src/mesa/main/context.c, line 1498.
  Abort (core dumped)
  
  Now, Mesa 10.2.4 and 10.3-rc3 works fine:
  # glxinfo
  name of display: :0
  display: :0  screen: 0
  direct rendering: Yes
  ...
  OpenGL renderer string: Mesa DRI Intel(R) 965GM
  OpenGL version string: 2.1 Mesa 10.2.4
  ...
  
  The code was imported from Linux 3.8.13.
  
  Reviewed by:  kib@
  Tested by:kwm@, danfe@, Henry Hu,
Lundberg, Johannes ,
Johannes Dieterich ,
Lutz Bichler ,
  MFC after:3 days
  Relnotes: yes

Added:
  head/sys/dev/drm2/i915/i915_gem_context.c   (contents, props changed)
Modified:
  head/sys/dev/drm2/drm_gem_names.c
  head/sys/dev/drm2/drm_gem_names.h
  head/sys/dev/drm2/i915/i915_dma.c
  head/sys/dev/drm2/i915/i915_drm.h
  head/sys/dev/drm2/i915/i915_drv.c
  head/sys/dev/drm2/i915/i915_drv.h
  head/sys/dev/drm2/i915/i915_gem.c
  head/sys/dev/drm2/i915/i915_gem_execbuffer.c
  head/sys/dev/drm2/i915/i915_gem_gtt.c
  head/sys/dev/drm2/i915/i915_irq.c
  head/sys/dev/drm2/i915/i915_reg.h
  head/sys/dev/drm2/i915/intel_ringbuffer.c
  head/sys/dev/drm2/i915/intel_ringbuffer.h
  head/sys/modules/drm2/i915kms/Makefile
  head/sys/sys/param.h

Modified: head/sys/dev/drm2/drm_gem_names.c
==
--- head/sys/dev/drm2/drm_gem_names.c   Wed Sep 17 08:25:48 2014
(r271704)
+++ head/sys/dev/drm2/drm_gem_names.c   Wed Sep 17 08:28:50 2014
(r271705)
@@ -127,6 +127,24 @@ drm_gem_find_name(struct drm_gem_names *
return (arg.res);
 }
 
+void *
+drm_gem_find_ptr(struct drm_gem_names *names, uint32_t name)
+{
+   struct drm_gem_name *n;
+   void *res;
+
+   mtx_lock(&names->lock);
+   LIST_FOREACH(n, gem_name_hash_index(names, name), link) {
+   if (n->name == name) {
+   res = n->ptr;
+   mtx_unlock(&names->lock);
+   return (res);
+   }
+   }
+   mtx_unlock(&names->lock);
+   return (NULL);
+}
+
 int
 drm_gem_name_create(struct drm_gem_names *names, void *p, uint32_t *name)
 {

Modified: head/sys/dev/drm2/drm_gem_names.h
==
--- head/sys/dev/drm2/drm_gem_names.h   Wed Sep 17 08:25:48 2014
(r271704)
+++ head/sys/dev/drm2/drm_gem_names.h   Wed Sep 17 08:28:50 2014
(r271705)
@@ -54,6 +54,7 @@ struct drm_gem_names {
 void drm_gem_names_init(struct drm_gem_names *names);
 void drm_gem_names_fini(struct drm_gem_names *names);
 uint32_t drm_gem_find_name(struct drm_gem_names *names, void *ptr);
+void *drm_gem_find_ptr(struct drm_gem_names *names, uint32_t name);
 void *drm_gem_name_ref(struct drm_gem_names *names, uint32_t name,
 void (*ref)(void *));
 int drm_gem_name_create(struct drm_gem_names *names, void *obj, uint32_t 
*name);

Modified: head/sys/dev/drm2/i915/i915_dma.c
==
--- head/sys/dev/drm2/i915/i915_dma.c   Wed Sep 17 08:25:48 2014
(r271704)
+++ head/sys/dev/drm2/i915/i915_dma.c   Wed Sep 17 08:28:50 2014
(r271705)
@@ -1357,6 +1357,7 @@ i915_driver_unload_int(struct drm_device
DRM_LOCK(dev);
i915_gem_free_all_phys_object(dev);
i915_gem_cleanup_ringbuffer(dev);
+   i915_gem_context_fini(dev);
if (!locked)
DRM_UNLOCK(dev);
i915_gem_cleanup_aliasing_ppgtt(dev);
@@ -1413,6 +1414,8 @@ i915_driver_open(struct drm_device *dev,
INIT_LIST_HEAD(&i915_file_priv->mm.request_list);
file_priv->driver_priv = i915_file_priv;
 
+   drm_gem_names_init(&i915_file_priv->context_idr);
+
return (0);
 }
 
@@ -1437,6 +1440,7 @@ i915_driver_lastclose(struct drm_device 
 void i915_driver_preclose(struct drm_device * dev, struct drm_file *file_priv)
 {
 
+   i915_gem_context_close(dev, file_priv);
i915_gem_release(dev, file_priv);
 }
 
@@ -1491,6 +1495,8 @@ struct drm_ioctl_desc i915_ioctls[] = {
DRM_IOCTL_DEF(DRM_I915_OVERLAY_ATTRS, intel_overlay_attrs, 
DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_I915_SET_SPRITE_COLORKEY, intel_sprite_set_colorkey, 
DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_I915_GET_SPRITE_COLORKEY, intel_sprite_get_colorkey, 
DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
+   DRM_IOCTL_D

svn commit: r271704 - stable/10/usr.sbin/autofs

2014-09-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Sep 17 08:25:48 2014
New Revision: 271704
URL: http://svnweb.freebsd.org/changeset/base/271704

Log:
  MFC r271167:
  
  Make it possible to quote names in autofs maps using double quotes.
  
  Note that this is a workaround, not a proper solution.  If you know
  lex well, and want to help - please let me know, I'll explain how it
  should work.
  
  PR:   192968
  Approved by:  re (kib)
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/usr.sbin/autofs/token.l
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/autofs/token.l
==
--- stable/10/usr.sbin/autofs/token.l   Wed Sep 17 07:55:23 2014
(r271703)
+++ stable/10/usr.sbin/autofs/token.l   Wed Sep 17 08:25:48 2014
(r271704)
@@ -48,6 +48,7 @@ extern intyylex(void);
 %option noyywrap
 
 %%
+\"[^"]+\"  { yytext++; yytext[strlen(yytext) - 1] = '\0'; return 
STR; };
 [a-zA-Z0-9\.\+-_/\:\[\]$&{}]+ { return STR; }
 #.*\n  { lineno++; return NEWLINE; };
 \\\n   { lineno++; };
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271703 - head/sys/dev/iscsi

2014-09-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Sep 17 07:55:23 2014
New Revision: 271703
URL: http://svnweb.freebsd.org/changeset/base/271703

Log:
  Fix LUN discovery for targets that don't support REPORT_LUNS, broken
  in r263741.  At least with CTL (slightly modified to report SPC2) there
  is still some problem: it doesn't seem to find LUNs higher than 7.
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/dev/iscsi/iscsi.c
==
--- head/sys/dev/iscsi/iscsi.c  Wed Sep 17 07:08:59 2014(r271702)
+++ head/sys/dev/iscsi/iscsi.c  Wed Sep 17 07:55:23 2014(r271703)
@@ -2179,7 +2179,12 @@ iscsi_action(struct cam_sim *sim, union 
cpi->hba_misc = PIM_EXTLUNS;
cpi->hba_eng_cnt = 0;
cpi->max_target = 0;
-   cpi->max_lun = 0;
+   /*
+* Note that the variable below is only relevant for targets
+* that don't claim compliance with anything above SPC2, which
+* means they don't support REPORT_LUNS.
+*/
+   cpi->max_lun = 255;
cpi->initiator_id = ~0;
strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
strlcpy(cpi->hba_vid, "iSCSI", HBA_IDLEN);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271702 - head/sys/cam/ctl

2014-09-17 Thread Alexander Motin
Author: mav
Date: Wed Sep 17 07:08:59 2014
New Revision: 271702
URL: http://svnweb.freebsd.org/changeset/base/271702

Log:
  Fix tpc_create_token() introduced in r269497 to encode CREATOR LOGICAL UNIT
  DESCRIPTOR field as Identification Descriptor CSCD descriptor, not just as
  Identification Descriptor.
  
  MFC after:3 days

Modified:
  head/sys/cam/ctl/ctl_tpc.c

Modified: head/sys/cam/ctl/ctl_tpc.c
==
--- head/sys/cam/ctl/ctl_tpc.c  Wed Sep 17 07:06:02 2014(r271701)
+++ head/sys/cam/ctl/ctl_tpc.c  Wed Sep 17 07:08:59 2014(r271702)
@@ -1811,6 +1811,7 @@ tpc_create_token(struct ctl_lun *lun, st
 {
static int id = 0;
struct scsi_vpd_id_descriptor *idd = NULL;
+   struct scsi_ec_cscd_id *cscd;
int targid_len;
 
scsi_ulto4b(ROD_TYPE_AUR, token->type);
@@ -1824,8 +1825,12 @@ tpc_create_token(struct ctl_lun *lun, st
idd = scsi_get_devid_desc((struct scsi_vpd_id_descriptor *)
lun->lun_devid->data, lun->lun_devid->len,
scsi_devid_is_lun_eui64);
-   if (idd != NULL)
-   memcpy(&token->body[8], idd, 4 + idd->length);
+   if (idd != NULL) {
+   cscd = (struct scsi_ec_cscd_id *)&token->body[8];
+   cscd->type_code = EC_CSCD_ID;
+   cscd->luidt_pdt = T_DIRECT;
+   memcpy(&cscd->codeset, idd, 4 + idd->length);
+   }
scsi_u64to8b(0, &token->body[40]);
scsi_u64to8b(len, &token->body[48]);
if (port->target_devid) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r271701 - stable/10/usr.sbin/ctld

2014-09-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Sep 17 07:06:02 2014
New Revision: 271701
URL: http://svnweb.freebsd.org/changeset/base/271701

Log:
  MFC r271319:
  
  Fix ctld(8) to not forget to send TargetPortalGroupTag and TargetAlias
  when the initiator skips security negotiation.  This fixes interoperability
  with Xtend SAN initiator.
  
  PR:   193021
  Approved by:  re (marius)
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/usr.sbin/ctld/login.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/ctld/login.c
==
--- stable/10/usr.sbin/ctld/login.c Wed Sep 17 06:46:37 2014
(r271700)
+++ stable/10/usr.sbin/ctld/login.c Wed Sep 17 07:06:02 2014
(r271701)
@@ -785,7 +785,8 @@ login_negotiate(struct connection *conn,
struct pdu *response;
struct iscsi_bhs_login_response *bhslr2;
struct keys *request_keys, *response_keys;
-   int i;
+   char *portal_group_tag;
+   int i, rv;
bool skipped_security;
 
if (request == NULL) {
@@ -806,6 +807,21 @@ login_negotiate(struct connection *conn,
login_set_csg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
login_set_nsg(response, BHSLR_STAGE_FULL_FEATURE_PHASE);
response_keys = keys_new();
+
+   if (skipped_security &&
+   conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) {
+   if (conn->conn_target->t_alias != NULL)
+   keys_add(response_keys,
+   "TargetAlias", conn->conn_target->t_alias);
+   rv = asprintf(&portal_group_tag, "%d",
+   conn->conn_portal->p_portal_group->pg_tag);
+   if (rv <= 0)
+   log_err(1, "asprintf");
+   keys_add(response_keys,
+   "TargetPortalGroupTag", portal_group_tag);
+   free(portal_group_tag);
+   }
+
for (i = 0; i < KEYS_MAX; i++) {
if (request_keys->keys_names[i] == NULL)
break;
@@ -1069,6 +1085,9 @@ login(struct connection *conn)
response_keys = keys_new();
keys_add(response_keys, "AuthMethod", "CHAP");
if (conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) {
+   if (conn->conn_target->t_alias != NULL)
+   keys_add(response_keys,
+   "TargetAlias", conn->conn_target->t_alias);
rv = asprintf(&portal_group_tag, "%d",
conn->conn_portal->p_portal_group->pg_tag);
if (rv <= 0)
@@ -1076,9 +1095,6 @@ login(struct connection *conn)
keys_add(response_keys,
"TargetPortalGroupTag", portal_group_tag);
free(portal_group_tag);
-   if (conn->conn_target->t_alias != NULL)
-   keys_add(response_keys,
-   "TargetAlias", conn->conn_target->t_alias);
}
keys_save(response_keys, response);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"