svn commit: r342588 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2018-12-28 Thread Cy Schubert
Author: cy
Date: Sat Dec 29 03:18:16 2018
New Revision: 342588
URL: https://svnweb.freebsd.org/changeset/base/342588

Log:
  MFC r342374:
  
  Remove the last vestiges of HP/UX from a FreeBSD-only ipfilter
  source file.

Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
  stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/11/   (props changed)
  stable/12/   (props changed)

Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==
--- stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 29 
01:19:14 2018(r342587)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 29 
03:18:16 2018(r342588)
@@ -38,9 +38,7 @@ static const char rcsid[] = "@(#)$Id$";
 #endif
 # include 
 # include 
-#if !defined(__hpux)
 # include 
-#endif
 #include 
 # include 
 # include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342588 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2018-12-28 Thread Cy Schubert
Author: cy
Date: Sat Dec 29 03:18:16 2018
New Revision: 342588
URL: https://svnweb.freebsd.org/changeset/base/342588

Log:
  MFC r342374:
  
  Remove the last vestiges of HP/UX from a FreeBSD-only ipfilter
  source file.

Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
  stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/10/   (props changed)
  stable/12/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==
--- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 29 
01:19:14 2018(r342587)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 29 
03:18:16 2018(r342588)
@@ -39,9 +39,7 @@ static const char rcsid[] = "@(#)$Id$";
 # include 
 # include 
 # include 
-#if !defined(__hpux)
 # include 
-#endif
 #include 
 # include 
 # include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342588 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2018-12-28 Thread Cy Schubert
Author: cy
Date: Sat Dec 29 03:18:16 2018
New Revision: 342588
URL: https://svnweb.freebsd.org/changeset/base/342588

Log:
  MFC r342374:
  
  Remove the last vestiges of HP/UX from a FreeBSD-only ipfilter
  source file.

Modified:
  stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
  stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/10/   (props changed)
  stable/11/   (props changed)

Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==
--- stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 29 
01:19:14 2018(r342587)
+++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 29 
03:18:16 2018(r342588)
@@ -39,9 +39,7 @@ static const char rcsid[] = "@(#)$Id$";
 # include 
 # include 
 # include 
-#if !defined(__hpux)
 # include 
-#endif
 #include 
 # include 
 # include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342587 - in stable: 10/sys/x86/x86 11/sys/x86/x86 12/sys/x86/x86

2018-12-28 Thread John Baldwin
Author: jhb
Date: Sat Dec 29 01:19:14 2018
New Revision: 342587
URL: https://svnweb.freebsd.org/changeset/base/342587

Log:
  MFC 340441: Revert r332735 and fix MSI-X to properly fail allocations when 
full.
  
  The off-by-one errors in 332735 weren't actual errors and were
  preventing the last MSI interrupt source from being used.  Instead,
  the issue is that when all MSI interrupt sources were allocated, the
  loop in msix_alloc() would terminate with 'msi' still set to non-null.
  The only check for 'i' overflowing was in the 'msi' == NULL case, so
  msix_alloc() would try to reuse the last MSI interrupt source instead
  of failing.
  
  Fix by moving the check for all sources being in use to just after the
  loop.

Modified:
  stable/12/sys/x86/x86/msi.c
Directory Properties:
  stable/12/   (props changed)

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

Modified: stable/12/sys/x86/x86/msi.c
==
--- stable/12/sys/x86/x86/msi.c Sat Dec 29 00:44:11 2018(r342586)
+++ stable/12/sys/x86/x86/msi.c Sat Dec 29 01:19:14 2018(r342587)
@@ -409,7 +409,7 @@ again:
/* Do we need to create some new sources? */
if (cnt < count) {
/* If we would exceed the max, give up. */
-   if (i + (count - cnt) >= first_msi_irq + NUM_MSI_INTS) {
+   if (i + (count - cnt) > first_msi_irq + NUM_MSI_INTS) {
mtx_unlock(_lock);
free(mirqs, M_MSI);
return (ENXIO);
@@ -647,13 +647,14 @@ again:
break;
}
 
+   /* Are all IRQs in use? */
+   if (i == first_msi_irq + NUM_MSI_INTS) {
+   mtx_unlock(_lock);
+   return (ENXIO);
+   }
+
/* Do we need to create a new source? */
if (msi == NULL) {
-   /* If we would exceed the max, give up. */
-   if (i + 1 >= first_msi_irq + NUM_MSI_INTS) {
-   mtx_unlock(_lock);
-   return (ENXIO);
-   }
mtx_unlock(_lock);
 
/* Create a new source. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342587 - in stable: 10/sys/x86/x86 11/sys/x86/x86 12/sys/x86/x86

2018-12-28 Thread John Baldwin
Author: jhb
Date: Sat Dec 29 01:19:14 2018
New Revision: 342587
URL: https://svnweb.freebsd.org/changeset/base/342587

Log:
  MFC 340441: Revert r332735 and fix MSI-X to properly fail allocations when 
full.
  
  The off-by-one errors in 332735 weren't actual errors and were
  preventing the last MSI interrupt source from being used.  Instead,
  the issue is that when all MSI interrupt sources were allocated, the
  loop in msix_alloc() would terminate with 'msi' still set to non-null.
  The only check for 'i' overflowing was in the 'msi' == NULL case, so
  msix_alloc() would try to reuse the last MSI interrupt source instead
  of failing.
  
  Fix by moving the check for all sources being in use to just after the
  loop.

Modified:
  stable/11/sys/x86/x86/msi.c
Directory Properties:
  stable/11/   (props changed)

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

Modified: stable/11/sys/x86/x86/msi.c
==
--- stable/11/sys/x86/x86/msi.c Sat Dec 29 00:44:11 2018(r342586)
+++ stable/11/sys/x86/x86/msi.c Sat Dec 29 01:19:14 2018(r342587)
@@ -404,7 +404,7 @@ again:
/* Do we need to create some new sources? */
if (cnt < count) {
/* If we would exceed the max, give up. */
-   if (i + (count - cnt) >= first_msi_irq + NUM_MSI_INTS) {
+   if (i + (count - cnt) > first_msi_irq + NUM_MSI_INTS) {
mtx_unlock(_lock);
free(mirqs, M_MSI);
return (ENXIO);
@@ -639,13 +639,14 @@ again:
break;
}
 
+   /* Are all IRQs in use? */
+   if (i == first_msi_irq + NUM_MSI_INTS) {
+   mtx_unlock(_lock);
+   return (ENXIO);
+   }
+
/* Do we need to create a new source? */
if (msi == NULL) {
-   /* If we would exceed the max, give up. */
-   if (i + 1 >= first_msi_irq + NUM_MSI_INTS) {
-   mtx_unlock(_lock);
-   return (ENXIO);
-   }
mtx_unlock(_lock);
 
/* Create a new source. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342587 - in stable: 10/sys/x86/x86 11/sys/x86/x86 12/sys/x86/x86

2018-12-28 Thread John Baldwin
Author: jhb
Date: Sat Dec 29 01:19:14 2018
New Revision: 342587
URL: https://svnweb.freebsd.org/changeset/base/342587

Log:
  MFC 340441: Revert r332735 and fix MSI-X to properly fail allocations when 
full.
  
  The off-by-one errors in 332735 weren't actual errors and were
  preventing the last MSI interrupt source from being used.  Instead,
  the issue is that when all MSI interrupt sources were allocated, the
  loop in msix_alloc() would terminate with 'msi' still set to non-null.
  The only check for 'i' overflowing was in the 'msi' == NULL case, so
  msix_alloc() would try to reuse the last MSI interrupt source instead
  of failing.
  
  Fix by moving the check for all sources being in use to just after the
  loop.

Modified:
  stable/10/sys/x86/x86/msi.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/x86/x86/msi.c
  stable/12/sys/x86/x86/msi.c
Directory Properties:
  stable/11/   (props changed)
  stable/12/   (props changed)

Modified: stable/10/sys/x86/x86/msi.c
==
--- stable/10/sys/x86/x86/msi.c Sat Dec 29 00:44:11 2018(r342586)
+++ stable/10/sys/x86/x86/msi.c Sat Dec 29 01:19:14 2018(r342587)
@@ -381,7 +381,7 @@ again:
/* Do we need to create some new sources? */
if (cnt < count) {
/* If we would exceed the max, give up. */
-   if (i + (count - cnt) >= FIRST_MSI_INT + NUM_MSI_INTS) {
+   if (i + (count - cnt) > FIRST_MSI_INT + NUM_MSI_INTS) {
mtx_unlock(_lock);
free(mirqs, M_MSI);
return (ENXIO);
@@ -556,13 +556,14 @@ again:
break;
}
 
+   /* Are all IRQs in use? */
+   if (i == FIRST_MSI_INT + NUM_MSI_INTS) {
+   mtx_unlock(_lock);
+   return (ENXIO);
+   }
+
/* Do we need to create a new source? */
if (msi == NULL) {
-   /* If we would exceed the max, give up. */
-   if (i + 1 >= FIRST_MSI_INT + NUM_MSI_INTS) {
-   mtx_unlock(_lock);
-   return (ENXIO);
-   }
mtx_unlock(_lock);
 
/* Create a new source. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342586 - in stable/10: sbin/ifconfig share/man/man4

2018-12-28 Thread Eugene Grosbein
Author: eugen
Date: Sat Dec 29 00:44:11 2018
New Revision: 342586
URL: https://svnweb.freebsd.org/changeset/base/342586

Log:
  MFC r342367: ifconfig.8, lagg.4: fix documentation bug: -use_flowid
  needs to be used to force local hash computation and disable usage
  of RSS hash provided by driver.
  
  PR:   234242

Modified:
  stable/10/sbin/ifconfig/ifconfig.8
  stable/10/share/man/man4/lagg.4
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/ifconfig/ifconfig.8
==
--- stable/10/sbin/ifconfig/ifconfig.8  Sat Dec 29 00:42:11 2018
(r342585)
+++ stable/10/sbin/ifconfig/ifconfig.8  Sat Dec 29 00:44:11 2018
(r342586)
@@ -2417,7 +2417,7 @@ src/dst address for IPv4 or IPv6.
 .It Cm l4
 src/dst port for TCP/UDP/SCTP.
 .El
-.It Cm use_flowid
+.It Cm -use_flowid
 Enable local hash computation for RSS hash on the interface.
 The
 .Li loadbalance
@@ -2426,7 +2426,7 @@ and
 modes will use the RSS hash from the network card if available
 to avoid computing one, this may give poor traffic distribution
 if the hash is invalid or uses less of the protocol header information.
-.Cm use_flowid
+.Cm -use_flowid
 disables use of RSS hash from the network card.
 The default value can be set via the
 .Va net.link.lagg.default_use_flowid
@@ -2439,8 +2439,8 @@ and
 .Li 1
 means
 .Dq enabled .
-.It Cm -use_flowid
-Disable local hash computation for RSS hash on the interface.
+.It Cm use_flowid
+Use the RSS hash from the network card if available.
 .It Cm flowid_shift Ar number
 Set a shift parameter for RSS local hash computation.
 Hash is calculated by using flowid bits in a packet header mbuf

Modified: stable/10/share/man/man4/lagg.4
==
--- stable/10/share/man/man4/lagg.4 Sat Dec 29 00:42:11 2018
(r342585)
+++ stable/10/share/man/man4/lagg.4 Sat Dec 29 00:44:11 2018
(r342586)
@@ -143,7 +143,7 @@ modes will use the RSS hash from the network card if a
 computing one, this may give poor traffic distribution if the hash is invalid
 or uses less of the protocol header information.
 Local hash computation can be forced per interface by setting the
-.Cm use_flowid
+.Cm -use_flowid
 .Xr ifconfig 8
 flag.
 The default for new interfaces is set via the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342585 - in stable/11: sbin/ifconfig share/man/man4

2018-12-28 Thread Eugene Grosbein
Author: eugen
Date: Sat Dec 29 00:42:11 2018
New Revision: 342585
URL: https://svnweb.freebsd.org/changeset/base/342585

Log:
  MFC r342367: ifconfig.8, lagg.4: fix documentation bug: -use_flowid
  needs to be used to force local hash computation and disable usage
  of RSS hash provided by driver.
  
  PR:   234242

Modified:
  stable/11/sbin/ifconfig/ifconfig.8
  stable/11/share/man/man4/lagg.4
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/ifconfig/ifconfig.8
==
--- stable/11/sbin/ifconfig/ifconfig.8  Sat Dec 29 00:41:21 2018
(r342584)
+++ stable/11/sbin/ifconfig/ifconfig.8  Sat Dec 29 00:42:11 2018
(r342585)
@@ -2467,7 +2467,7 @@ src/dst address for IPv4 or IPv6.
 .It Cm l4
 src/dst port for TCP/UDP/SCTP.
 .El
-.It Cm use_flowid
+.It Cm -use_flowid
 Enable local hash computation for RSS hash on the interface.
 The
 .Li loadbalance
@@ -2476,7 +2476,7 @@ and
 modes will use the RSS hash from the network card if available
 to avoid computing one, this may give poor traffic distribution
 if the hash is invalid or uses less of the protocol header information.
-.Cm use_flowid
+.Cm -use_flowid
 disables use of RSS hash from the network card.
 The default value can be set via the
 .Va net.link.lagg.default_use_flowid
@@ -2489,8 +2489,8 @@ and
 .Li 1
 means
 .Dq enabled .
-.It Cm -use_flowid
-Disable local hash computation for RSS hash on the interface.
+.It Cm use_flowid
+Use the RSS hash from the network card if available.
 .It Cm flowid_shift Ar number
 Set a shift parameter for RSS local hash computation.
 Hash is calculated by using flowid bits in a packet header mbuf

Modified: stable/11/share/man/man4/lagg.4
==
--- stable/11/share/man/man4/lagg.4 Sat Dec 29 00:41:21 2018
(r342584)
+++ stable/11/share/man/man4/lagg.4 Sat Dec 29 00:42:11 2018
(r342585)
@@ -148,7 +148,7 @@ modes will use the RSS hash from the network card if a
 computing one, this may give poor traffic distribution if the hash is invalid
 or uses less of the protocol header information.
 Local hash computation can be forced per interface by setting the
-.Cm use_flowid
+.Cm -use_flowid
 .Xr ifconfig 8
 flag.
 The default for new interfaces is set via the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342584 - in stable/12: sbin/ifconfig share/man/man4

2018-12-28 Thread Eugene Grosbein
Author: eugen
Date: Sat Dec 29 00:41:21 2018
New Revision: 342584
URL: https://svnweb.freebsd.org/changeset/base/342584

Log:
  MFC r342367: ifconfig.8, lagg.4: fix documentation bug: -use_flowid
  needs to be used to force local hash computation and disable usage
  of RSS hash provided by driver.
  
  PR:   234242

Modified:
  stable/12/sbin/ifconfig/ifconfig.8
  stable/12/share/man/man4/lagg.4
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/ifconfig/ifconfig.8
==
--- stable/12/sbin/ifconfig/ifconfig.8  Sat Dec 29 00:30:17 2018
(r342583)
+++ stable/12/sbin/ifconfig/ifconfig.8  Sat Dec 29 00:41:21 2018
(r342584)
@@ -2469,7 +2469,7 @@ src/dst address for IPv4 or IPv6.
 .It Cm l4
 src/dst port for TCP/UDP/SCTP.
 .El
-.It Cm use_flowid
+.It Cm -use_flowid
 Enable local hash computation for RSS hash on the interface.
 The
 .Li loadbalance
@@ -2478,7 +2478,7 @@ and
 modes will use the RSS hash from the network card if available
 to avoid computing one, this may give poor traffic distribution
 if the hash is invalid or uses less of the protocol header information.
-.Cm use_flowid
+.Cm -use_flowid
 disables use of RSS hash from the network card.
 The default value can be set via the
 .Va net.link.lagg.default_use_flowid
@@ -2491,8 +2491,8 @@ and
 .Li 1
 means
 .Dq enabled .
-.It Cm -use_flowid
-Disable local hash computation for RSS hash on the interface.
+.It Cm use_flowid
+Use the RSS hash from the network card if available.
 .It Cm flowid_shift Ar number
 Set a shift parameter for RSS local hash computation.
 Hash is calculated by using flowid bits in a packet header mbuf

Modified: stable/12/share/man/man4/lagg.4
==
--- stable/12/share/man/man4/lagg.4 Sat Dec 29 00:30:17 2018
(r342583)
+++ stable/12/share/man/man4/lagg.4 Sat Dec 29 00:41:21 2018
(r342584)
@@ -146,7 +146,7 @@ modes will use the RSS hash from the network card if a
 computing one, this may give poor traffic distribution if the hash is invalid
 or uses less of the protocol header information.
 Local hash computation can be forced per interface by setting the
-.Cm use_flowid
+.Cm -use_flowid
 .Xr ifconfig 8
 flag.
 The default for new interfaces is set via the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342583 - in stable: 10/sys/dev/cxgbe/tom 11/sys/dev/cxgbe/tom 12/sys/dev/cxgbe/tom

2018-12-28 Thread John Baldwin
Author: jhb
Date: Sat Dec 29 00:30:17 2018
New Revision: 342583
URL: https://svnweb.freebsd.org/changeset/base/342583

Log:
  MFC 340304: Use tcp_state_change() in the cxgbe(4) TOE module.
  
  r254889 added tcp_state_change() as a centralized place to log state
  changes in TCP connections for DTrace.  r294869 and r296881 took
  advantage of this central location to manage per-state counters.
  However, TOE sockets were still performing some (but not all) state
  change updates via direct assignments to t_state.  This resulted in
  state counters underflowing when TOE was in use.  Fix by using
  tcp_state_change() when changing a TOE connection's state.

Modified:
  stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c
Directory Properties:
  stable/11/   (props changed)

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

Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 29 00:06:41 2018
(r342582)
+++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 29 00:30:17 2018
(r342583)
@@ -316,7 +316,7 @@ make_established(struct toepcb *toep, uint32_t snd_isn
CTR6(KTR_CXGBE, "%s: tid %d, so %p, inp %p, tp %p, toep %p",
__func__, toep->tid, so, inp, tp, toep);
 
-   tp->t_state = TCPS_ESTABLISHED;
+   tcp_state_change(tp, TCPS_ESTABLISHED);
tp->t_starttime = ticks;
TCPSTAT_INC(tcps_connects);
 
@@ -1181,11 +1181,11 @@ do_peer_close(struct sge_iq *iq, const struct rss_head
/* FALLTHROUGH */ 
 
case TCPS_ESTABLISHED:
-   tp->t_state = TCPS_CLOSE_WAIT;
+   tcp_state_change(tp, TCPS_CLOSE_WAIT);
break;
 
case TCPS_FIN_WAIT_1:
-   tp->t_state = TCPS_CLOSING;
+   tcp_state_change(tp, TCPS_CLOSING);
break;
 
case TCPS_FIN_WAIT_2:
@@ -1266,7 +1266,7 @@ release:
case TCPS_FIN_WAIT_1:
if (so->so_rcv.sb_state & SBS_CANTRCVMORE)
soisdisconnected(so);
-   tp->t_state = TCPS_FIN_WAIT_2;
+   tcp_state_change(tp, TCPS_FIN_WAIT_2);
break;
 
default:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342583 - in stable: 10/sys/dev/cxgbe/tom 11/sys/dev/cxgbe/tom 12/sys/dev/cxgbe/tom

2018-12-28 Thread John Baldwin
Author: jhb
Date: Sat Dec 29 00:30:17 2018
New Revision: 342583
URL: https://svnweb.freebsd.org/changeset/base/342583

Log:
  MFC 340304: Use tcp_state_change() in the cxgbe(4) TOE module.
  
  r254889 added tcp_state_change() as a centralized place to log state
  changes in TCP connections for DTrace.  r294869 and r296881 took
  advantage of this central location to manage per-state counters.
  However, TOE sockets were still performing some (but not all) state
  change updates via direct assignments to t_state.  This resulted in
  state counters underflowing when TOE was in use.  Fix by using
  tcp_state_change() when changing a TOE connection's state.

Modified:
  stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c
Directory Properties:
  stable/12/   (props changed)

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

Modified: stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 29 00:06:41 2018
(r342582)
+++ stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 29 00:30:17 2018
(r342583)
@@ -396,7 +396,7 @@ make_established(struct toepcb *toep, uint32_t snd_isn
CTR6(KTR_CXGBE, "%s: tid %d, so %p, inp %p, tp %p, toep %p",
__func__, toep->tid, so, inp, tp, toep);
 
-   tp->t_state = TCPS_ESTABLISHED;
+   tcp_state_change(tp, TCPS_ESTABLISHED);
tp->t_starttime = ticks;
TCPSTAT_INC(tcps_connects);
 
@@ -1303,11 +1303,11 @@ do_peer_close(struct sge_iq *iq, const struct rss_head
/* FALLTHROUGH */ 
 
case TCPS_ESTABLISHED:
-   tp->t_state = TCPS_CLOSE_WAIT;
+   tcp_state_change(tp, TCPS_CLOSE_WAIT);
break;
 
case TCPS_FIN_WAIT_1:
-   tp->t_state = TCPS_CLOSING;
+   tcp_state_change(tp, TCPS_CLOSING);
break;
 
case TCPS_FIN_WAIT_2:
@@ -1389,7 +1389,7 @@ release:
case TCPS_FIN_WAIT_1:
if (so->so_rcv.sb_state & SBS_CANTRCVMORE)
soisdisconnected(so);
-   tp->t_state = TCPS_FIN_WAIT_2;
+   tcp_state_change(tp, TCPS_FIN_WAIT_2);
break;
 
default:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342583 - in stable: 10/sys/dev/cxgbe/tom 11/sys/dev/cxgbe/tom 12/sys/dev/cxgbe/tom

2018-12-28 Thread John Baldwin
Author: jhb
Date: Sat Dec 29 00:30:17 2018
New Revision: 342583
URL: https://svnweb.freebsd.org/changeset/base/342583

Log:
  MFC 340304: Use tcp_state_change() in the cxgbe(4) TOE module.
  
  r254889 added tcp_state_change() as a centralized place to log state
  changes in TCP connections for DTrace.  r294869 and r296881 took
  advantage of this central location to manage per-state counters.
  However, TOE sockets were still performing some (but not all) state
  change updates via direct assignments to t_state.  This resulted in
  state counters underflowing when TOE was in use.  Fix by using
  tcp_state_change() when changing a TOE connection's state.

Modified:
  stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c
  stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c
Directory Properties:
  stable/11/   (props changed)
  stable/12/   (props changed)

Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 29 00:06:41 2018
(r342582)
+++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 29 00:30:17 2018
(r342583)
@@ -310,7 +310,7 @@ make_established(struct toepcb *toep, uint32_t snd_isn
CTR4(KTR_CXGBE, "%s: tid %d, toep %p, inp %p",
__func__, toep->tid, toep, inp);
 
-   tp->t_state = TCPS_ESTABLISHED;
+   tcp_state_change(tp, TCPS_ESTABLISHED);
tp->t_starttime = ticks;
TCPSTAT_INC(tcps_connects);
 
@@ -1138,11 +1138,11 @@ do_peer_close(struct sge_iq *iq, const struct rss_head
/* FALLTHROUGH */ 
 
case TCPS_ESTABLISHED:
-   tp->t_state = TCPS_CLOSE_WAIT;
+   tcp_state_change(tp, TCPS_CLOSE_WAIT);
break;
 
case TCPS_FIN_WAIT_1:
-   tp->t_state = TCPS_CLOSING;
+   tcp_state_change(tp, TCPS_CLOSING);
break;
 
case TCPS_FIN_WAIT_2:
@@ -1223,7 +1223,7 @@ release:
case TCPS_FIN_WAIT_1:
if (so->so_rcv.sb_state & SBS_CANTRCVMORE)
soisdisconnected(so);
-   tp->t_state = TCPS_FIN_WAIT_2;
+   tcp_state_change(tp, TCPS_FIN_WAIT_2);
break;
 
default:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342582 - stable/11

2018-12-28 Thread Rick Macklem
Author: rmacklem
Date: Sat Dec 29 00:06:41 2018
New Revision: 342582
URL: https://svnweb.freebsd.org/changeset/base/342582

Log:
  Add an UPDATING entry for r342562.
  
  This is a direct commit.

Modified:
  stable/11/UPDATING

Modified: stable/11/UPDATING
==
--- stable/11/UPDATING  Sat Dec 29 00:00:39 2018(r342581)
+++ stable/11/UPDATING  Sat Dec 29 00:06:41 2018(r342582)
@@ -16,6 +16,14 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20181228:
+   r342562 modifies the NFSv4 server so that it obeys vfs.nfsd.nfs_privport
+   in the same as it is applied to NFSv2 and 3.  This implies that NFSv4
+   servers that have vfs.nfsd.nfs_privport set will only allow mounts
+   from clients using a reserved port#. Since both the FreeBSD and Linux
+   NFSv4 clients use reserved port#s by default, this should not affect
+   most NFSv4 mounts.
+
 20181107:
The '%I' format in the kern.corefile sysctl limits the number of
core files that a process can generate to the number stored in the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342581 - stable/12

2018-12-28 Thread Rick Macklem
Author: rmacklem
Date: Sat Dec 29 00:00:39 2018
New Revision: 342581
URL: https://svnweb.freebsd.org/changeset/base/342581

Log:
  Add an UPDATING entry for r342561.
  
  This is a direct commit.

Modified:
  stable/12/UPDATING

Modified: stable/12/UPDATING
==
--- stable/12/UPDATING  Fri Dec 28 22:47:55 2018(r342580)
+++ stable/12/UPDATING  Sat Dec 29 00:00:39 2018(r342581)
@@ -16,6 +16,14 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20181228:
+   r342561 modifies the NFSv4 server so that it obeys vfs.nfsd.nfs_privport
+   in the same as it is applied to NFSv2 and 3.  This implies that NFSv4
+   servers that have vfs.nfsd.nfs_privport set will only allow mounts
+   from clients using a reserved port#. Since both the FreeBSD and Linux
+   NFSv4 clients use reserved port#s by default, this should not affect
+   most NFSv4 mounts.
+
 20181129:
On amd64, arm64 and armv7 (architectures that install LLVM's ld.lld
linker as /usr/bin/ld) GNU ld is no longer installed as ld.bfd, as
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r342576 - head/share/skel

2018-12-28 Thread Yuri Pankov
Rodney W. Grimes wrote:
>> Author: trasz
>> Date: Fri Dec 28 17:50:40 2018
>> New Revision: 342576
>> URL: https://svnweb.freebsd.org/changeset/base/342576
>>
>> Log:
>>   Simplify the way we set the default sh(1) PS1.  No functional changes.
>>   
>>   Reviewed by:   jilles
>>   MFC after: 2 weeks
>>   Sponsored by:  DARPA, AFRL
>>   Differential Revision: https://reviews.freebsd.org/D18662
>>
>> Modified:
>>   head/share/skel/dot.shrc
>>
>> Modified: head/share/skel/dot.shrc
>> ==
>> --- head/share/skel/dot.shrc Fri Dec 28 17:00:12 2018(r342575)
>> +++ head/share/skel/dot.shrc Fri Dec 28 17:50:40 2018(r342576)
>> @@ -33,11 +33,7 @@ alias g='egrep -i'
>>  
>>  
>>  # # set prompt: ``username@hostname$ '' 
>> -# PS1="`whoami`@`hostname | sed 's/\..*//'`"
>> -# case `id -u` in
>> -#   0) PS1="${PS1}# ";;
>> -#   *) PS1="${PS1}$ ";;
>> -# esac
>> +# PS1="`whoami`@\h\\$ "
> 
> You lost the fact that for root the prompt ends in #

Note that '$' is not literal here.  '\$' is expanded to '$' for normal
users, and to '#' for superusers.

>>  
>>  # search path for cd(1)
>>  # CDPATH=:$HOME
>>
>>
> 




signature.asc
Description: OpenPGP digital signature


Re: svn commit: r342576 - head/share/skel

2018-12-28 Thread Rodney W. Grimes
> Author: trasz
> Date: Fri Dec 28 17:50:40 2018
> New Revision: 342576
> URL: https://svnweb.freebsd.org/changeset/base/342576
> 
> Log:
>   Simplify the way we set the default sh(1) PS1.  No functional changes.
>   
>   Reviewed by:jilles
>   MFC after:  2 weeks
>   Sponsored by:   DARPA, AFRL
>   Differential Revision:  https://reviews.freebsd.org/D18662
> 
> Modified:
>   head/share/skel/dot.shrc
> 
> Modified: head/share/skel/dot.shrc
> ==
> --- head/share/skel/dot.shrc  Fri Dec 28 17:00:12 2018(r342575)
> +++ head/share/skel/dot.shrc  Fri Dec 28 17:50:40 2018(r342576)
> @@ -33,11 +33,7 @@ alias g='egrep -i'
>  
>  
>  # # set prompt: ``username@hostname$ '' 
> -# PS1="`whoami`@`hostname | sed 's/\..*//'`"
> -# case `id -u` in
> -#0) PS1="${PS1}# ";;
> -#*) PS1="${PS1}$ ";;
> -# esac
> +# PS1="`whoami`@\h\\$ "

You lost the fact that for root the prompt ends in #

>  
>  # search path for cd(1)
>  # CDPATH=:$HOME
> 
> 

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


svn commit: r342580 - head/usr.bin/ar

2018-12-28 Thread Ed Maste
Author: emaste
Date: Fri Dec 28 22:47:55 2018
New Revision: 342580
URL: https://svnweb.freebsd.org/changeset/base/342580

Log:
  ar: detect and error out on 32-bit symbol table overflow
  
  BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
  previously truncated to 32-bits, silently producing corrupted archives
  larger than 4GB.
  
  This is another overflow case in addtion to r342575.
  
  PR:   234454
  Reported by:  Aijaz Baig, imp
  MFC after:2 weeks
  MFC with: r342575
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/ar/write.c

Modified: head/usr.bin/ar/write.c
==
--- head/usr.bin/ar/write.c Fri Dec 28 21:26:45 2018(r342579)
+++ head/usr.bin/ar/write.c Fri Dec 28 22:47:55 2018(r342580)
@@ -628,6 +628,9 @@ write_objs(struct bsdar *bsdar)
if (strlen(obj->name) > _MAXNAMELEN_SVR4)
add_to_ar_str_table(bsdar, obj->name);
bsdar->rela_off += _ARHDR_LEN + obj->size + obj->size % 2;
+   if (bsdar->rela_off > UINT32_MAX)
+   bsdar_errc(bsdar, EX_SOFTWARE, 0,
+   "Symbol table offset overflow");
}
 
/*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342579 - head/usr.sbin/efibootmgr

2018-12-28 Thread Rebecca Cran
Author: bcran
Date: Fri Dec 28 21:26:45 2018
New Revision: 342579
URL: https://svnweb.freebsd.org/changeset/base/342579

Log:
  Improve the efibootmgr(8) man page
  
  Fix formatting, typos, and attempt to improve the wording.
  
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D18646

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

Modified: head/usr.sbin/efibootmgr/efibootmgr.8
==
--- head/usr.sbin/efibootmgr/efibootmgr.8   Fri Dec 28 19:49:58 2018
(r342578)
+++ head/usr.sbin/efibootmgr/efibootmgr.8   Fri Dec 28 21:26:45 2018
(r342579)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2017 Netflix, Inc
+.\" Copyright (c) 2017-2018 Netflix, Inc
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,19 +24,19 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 8, 2018
+.Dd December 28, 2018
 .Dt EFIBOOTMGR 8
 .Os
 .Sh NAME
 .Nm efibootmgr 
 .Nd manipulate the EFI Boot Manager
 .Sh SYNOPSIS
-.Op Fl aAnNB Ar Bootvar
+.Op Fl aAnNB Ar bootnum
 .Op Fl t Ar timeout
 .Op Fl T
 .Op Fl o Ar bootorder
-.Op Fl verbose
-.Op Fl c -k Ar kernel -l Ar loader [-L Ar label] [--dry-run] [-b Bootvar]
+.Op Fl v
+.Op Fl c l Ar loader [ Fl k Ar kernel ] [ Fl L Ar label ] [ Fl -dry-run ] [ Fl 
b Ar bootnum ]
 .Sh "DESCRIPTION"
 .Nm
 manipulates how UEFI Boot Managers boot the system.
@@ -59,7 +59,7 @@ The currently booting method is communicated using 
 A global timeout can also be set.
 .Pp
 .Nm
-requires that the kernel efirt module to get and set these
+requires that the kernel efirt module be loaded to get and set these
 non-volatile variables.
 .Pp
 The following options are available:
@@ -70,45 +70,45 @@ Create a new Boot Variable
 The path to and name of the loader.
 .It Fl k -kernel Ar kernel
 The path to and name of the kernel.
-.It Fl b Bootvar
-When creating an entry, use Bootvar as the index.
+.It Fl b -bootnum Ar bootnum
+When creating a new entry, use bootnum as the index.
 Fail if it already exists.
 .It Fl L -label Ar label
 An optional description for the entry.
 .It Fl D -dry-run
-Process but do not set the given BootVar.
-.It Fl B -delete Ar BootVarNum
-Delete the given BootVar Num.
-.It Fl a -activate Ar BootVarNum
-Activate the given BootVarNum.
-.It Fl A -deactivate Ar BootVarNum
-Deactivate the given BootVarNum.
-.It Fl n -bootnext  Ar BootVarNum
-Set BootVarNum as the BootNext variable.
+Process but do not change any variables.
+.It Fl B -delete Ar bootnum
+Delete the given bootnum boot entry.
+.It Fl a -activate Ar bootnum
+Activate the given bootnum boot entry.
+.It Fl A -deactivate Ar bootnum
+Deactivate the given bootnum boot entry.
+.It Fl n -bootnext Ar bootnum
+Set bootnum boot entry as the BootNext variable.
 .It Fl N -delete-bootnext 
-Delete the BootNext optional BootVar.
+Delete the BootNext optional variable.
 .It Fl o -bootorder Ar bootorder
-Set BootOrder variable to the given comma delimited set of BootVarNums.
+Set BootOrder variable to the given comma delimited set of bootnums.
 The numbers are in hex to match Boot, but may omit leading zeros.
 .It Fl t -set-timeout Ar timeout
 Set the bootmenu timeout value.
 .It Fl T -del-timeout
 Delete the BootTimeout variable.
 .It Fl v -verbose
-Display the device path of BootVars in the output.
+Display the device path of boot entries in the output.
 .El
 .Pp
-.Sh Exammples
+.Sh Examples
 .Pp
 To Display the current Boot related variables in the system:
 .Pp
 .Dl efibootmgr [-v]
 .Pp
-This will display the optional BootNext BootVar, BootCurrent,
-or currently booted BootVar, followed by the optional Timeout value, any
-BootOrder that maybe set, followed finally by all currently defined Boot
+This will display the optional BootNext bootnum, BootCurrent,
+or currently booted bootnum, followed by the optional Timeout value, any
+BootOrder that may be set, followed finally by all currently defined Boot
 variables, active or not. The verbose flag will augment this output with
-the hardrive partition uuids, size/offset and device-path of the
+the disk partition uuids, size/offset and device-path of the
 variable.
 .Pp
 The
@@ -117,28 +117,28 @@ program can be used to create new EFI boot variables. 
 boot var pointing to an installation with its EFI partition mounted
 under /mnt, the given loader and a label "FreeBSD-11":
 .Pp
-.Dl efibootmgr -c -l /mnt/EFI/BOOT/BOOTX64.EFI -L FreeBSD-11
+.Dl efibootmgr -c -l /mnt/EFI/freebsd/loader.efi -L FreeBSD-11
 .Pp
-This will result in the next available BootVarNum being assigned to a
-new UEFI load variable, and given the label "FreeBSD-11" such as:
+This will result in the next available bootnum being assigned to a
+new UEFI boot variable, and given the label "FreeBSD-11" such as:
 .Pp
 .Dl Boot0009 FreeBSD-11
 .Pp
-Note newly created BootVars are created inactive. The active state is denoted
-by an '*' following the BootVar name in the output.  

svn commit: r342578 - head/share/man/man5

2018-12-28 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Fri Dec 28 19:49:58 2018
New Revision: 342578
URL: https://svnweb.freebsd.org/changeset/base/342578

Log:
  Add a style.mdoc(5) manual page.
  
  The aim of this manual page is to act as a style and formatting guide for
  mdoc(7) manual pages. Currently, mdoc(7) does not provide much guidance
  when it comes to the usage of macros making it difficult to format manual
  pages in a consistent way.
  
  Reviewed by:  bcr
  Approved by:  bcr (doc), krion (mentor, implicit), mat (mentor, implicit)
  Differential Revision:https://reviews.freebsd.org/D18394

Added:
  head/share/man/man5/style.mdoc.5   (contents, props changed)
Modified:
  head/share/man/man5/Makefile

Modified: head/share/man/man5/Makefile
==
--- head/share/man/man5/MakefileFri Dec 28 17:51:40 2018
(r342577)
+++ head/share/man/man5/MakefileFri Dec 28 19:49:58 2018
(r342578)
@@ -66,6 +66,7 @@ MAN=  acct.5 \
src.conf.5 \
stab.5 \
style.Makefile.5 \
+   style.mdoc.5 \
sysctl.conf.5 \
tmpfs.5
 

Added: head/share/man/man5/style.mdoc.5
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man5/style.mdoc.5Fri Dec 28 19:49:58 2018
(r342578)
@@ -0,0 +1,205 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+.\"
+.\" Copyright (c) 2018 Mateusz Piotrowski <0...@freebsd.org>
+.\"
+.\" 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 December 28, 2018
+.Dt STYLE.MDOC 5
+.Os
+.Sh NAME
+.Nm style.mdoc
+.Nd
+.Fx
+.Xr mdoc 7
+file style guide
+.Sh DESCRIPTION
+This file specifies the preferred style for manual pages in the
+.Fx
+source tree.
+.Ss Code examples
+.Bl -dash -width ""
+.It
+Use literal formatting for examples and literal shell commands, e.g.:
+.Bd -literal -offset indent
+Then run
+\&.Dq Li make install clean .
+.Ed
+.Pp
+which renders as:
+.Bd -filled -offset indent
+Then run
+.Dq Li make install clean .
+.Ed
+.Pp
+The incorrect way would be to use macros like
+.Sy \
+to stylize the command invocation:
+.Bd -literal -offset indent
+Then run
+\&.Dq Nm make Cm install Cm clean .
+.Ed
+.Pp
+which renders as:
+.Bd -filled -offset indent
+Then run
+.Dq Nm make Cm install Cm clean .
+.Ed
+.El
+.Ss Synopsis formatting
+.Bl -dash -width ""
+.It
+Do not put whitespace between alternative parameters separated with a pipe
+.Pq Dq | ,
+e.g.:
+.Bd -literal -offset indent
+\&.Cm compression Cm on Ns | Ns Cm off
+\&.Cm install Fl -all Ns | Ns Ar portname Ar ...
+.Ed
+.Pp
+which in the SYNOPSIS section is rendered as:
+.Bd -unfilled -offset indent
+.Cm compression Cm on Ns | Ns Cm off
+.Cm install Fl -all Ns | Ns Ar portname Ar ...
+.Ed
+.It
+Use
+.Sy \
+to stylize characters that are command modifiers
+.Po e.g.,
+.Dq \&, ,
+.Dq @
+or
+.Dq "="
+.Pc .
+For example:
+.Bd -literal -offset indent
+\&.Sm off
+\&.Fl -meet Cm = Ar who Oo Cm \&, Ar who " " Ar "..." Oc Cm @ Ar where
+\&.Sm on
+.Ed
+.Pp
+which renders as:
+.Bd -filled -offset indent
+.Sm off
+.Fl -meet Cm = Ar who Oo Cm \&, Ar who " " Ar "..." Oc Cm @ Ar where
+.Sm on
+.Ed
+.Pp
+instead of:
+.Bd -literal -offset indent
+\&.Sm off
+\&.Fl -meet No = Ar who Oo , Ar who " " Ar "..." Oc @ Ar where
+\&.Sm on
+.Ed
+.Pp
+which would render as:
+.Bd -filled -offset indent
+.Sm off
+.Fl -meet No = Ar who Oo , Ar who " " Ar "..." Oc @ Ar where
+.Sm on
+.Ed
+.Pp
+It is important to realize that in the correct example,
+.Dq \&, ,
+.Dq @
+and
+.Dq =
+are stylized with
+.Sy \ .
+At the same time, the square brackets
+.Pq 

Re: svn commit: r342389 - head/share/man/man5

2018-12-28 Thread Chris Rees



On 28 December 2018 19:02:14 GMT+00:00, Niclas Zeising  
wrote:
>On 12/28/18 7:43 PM, Chris Rees wrote:
>> Hey,
>> 
>> On 28 December 2018 18:19:57 GMT+00:00, Niclas Zeising
> wrote:
>>> On 12/24/18 11:47 AM, Chris Rees wrote:
 Author: crees (doc,ports committer)
 Date: Mon Dec 24 10:47:48 2018
 New Revision: 342389
 URL: https://svnweb.freebsd.org/changeset/base/342389

 Log:
 Clarify kld_list format
 
 PR:docs/234248
 Submitted by:  David Fiander
 Submitted by:  Miroslav Lachman

 Modified:
 head/share/man/man5/rc.conf.5

 Modified: head/share/man/man5/rc.conf.5

>>>
>==
 --- head/share/man/man5/rc.conf.5  Mon Dec 24 06:14:32
>2018   (r342388)
 +++ head/share/man/man5/rc.conf.5  Mon Dec 24 10:47:48
>2018   (r342389)
 @@ -248,12 +248,14 @@ Default
.Pa /etc/ddb.conf .
.It Va kld_list
.Pq Vt str
 -A list of kernel modules to load right after the local
 -disks are mounted.
 +A whitespace-separated list of kernel modules to load right after
 +the local disks are mounted, without any
 +.Pa .ko
 +extension or path.
Loading modules at this point in the boot process is
much faster than doing it via
.Pa /boot/loader.conf
 -for those modules not necessary for mounting local disk.
 +for those modules not necessary for mounting local disks.
.It Va kldxref_enable
.Pq Vt bool
Set to
>>>
>>>
>>> Hi!
>>> Sorry for jumping into this so late.
>>> Please please PLEASE don't break loading modules by path in
>kld_list.
>>> This is used by the drm-kmod files to distinguish them from the base
>>> modules, and this has been communicated in documentation all over
>the
>>> place, including numerous ports.
>>>
>>> Can this please be reverted, or amended to match reality.
>>>
>>> In practice, adding both the path and the extension (.ko) to a
>module
>>> in
>>> kld_list works and the module loads.
>> 
>> As the code itself stands, it works for loading, but throws an error
>if you try to load an already loaded module adding a .ko extension.  In
>other words, it works but is wrong.  The path actually still does work,
>which was my mistake.
>> 
>> I'm awaiting approval for this, which correctly handles all cases:
>> 
>> https://reviews.freebsd.org/D18670
>> 
>> Konstantin has reviewed, but doesn't feel comfortable giving approval
>as it's not his area, which is fair enough.
>> 
>> Chris
>> 
>
>Ok.
>Will this continue to work when loading /path/to/foo.ko rather than 
>path/to/foo? (I assume it will)
>Regards

Unlike now, it will work correctly, including if the module is already loaded.

Chris

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: svn commit: r342389 - head/share/man/man5

2018-12-28 Thread Niclas Zeising

On 12/28/18 7:43 PM, Chris Rees wrote:

Hey,

On 28 December 2018 18:19:57 GMT+00:00, Niclas Zeising  
wrote:

On 12/24/18 11:47 AM, Chris Rees wrote:

Author: crees (doc,ports committer)
Date: Mon Dec 24 10:47:48 2018
New Revision: 342389
URL: https://svnweb.freebsd.org/changeset/base/342389

Log:
Clarify kld_list format

PR:		docs/234248

Submitted by:   David Fiander
Submitted by:   Miroslav Lachman

Modified:
head/share/man/man5/rc.conf.5

Modified: head/share/man/man5/rc.conf.5


==

--- head/share/man/man5/rc.conf.5   Mon Dec 24 06:14:32 2018
(r342388)
+++ head/share/man/man5/rc.conf.5   Mon Dec 24 10:47:48 2018
(r342389)
@@ -248,12 +248,14 @@ Default
   .Pa /etc/ddb.conf .
   .It Va kld_list
   .Pq Vt str
-A list of kernel modules to load right after the local
-disks are mounted.
+A whitespace-separated list of kernel modules to load right after
+the local disks are mounted, without any
+.Pa .ko
+extension or path.
   Loading modules at this point in the boot process is
   much faster than doing it via
   .Pa /boot/loader.conf
-for those modules not necessary for mounting local disk.
+for those modules not necessary for mounting local disks.
   .It Va kldxref_enable
   .Pq Vt bool
   Set to



Hi!
Sorry for jumping into this so late.
Please please PLEASE don't break loading modules by path in kld_list.
This is used by the drm-kmod files to distinguish them from the base
modules, and this has been communicated in documentation all over the
place, including numerous ports.

Can this please be reverted, or amended to match reality.

In practice, adding both the path and the extension (.ko) to a module
in
kld_list works and the module loads.


As the code itself stands, it works for loading, but throws an error if you try 
to load an already loaded module adding a .ko extension.  In other words, it 
works but is wrong.  The path actually still does work, which was my mistake.

I'm awaiting approval for this, which correctly handles all cases:

https://reviews.freebsd.org/D18670

Konstantin has reviewed, but doesn't feel comfortable giving approval as it's 
not his area, which is fair enough.

Chris



Ok.
Will this continue to work when loading /path/to/foo.ko rather than 
path/to/foo? (I assume it will)

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


Re: svn commit: r342389 - head/share/man/man5

2018-12-28 Thread Chris Rees
Hey,

On 28 December 2018 18:19:57 GMT+00:00, Niclas Zeising  
wrote:
>On 12/24/18 11:47 AM, Chris Rees wrote:
>> Author: crees (doc,ports committer)
>> Date: Mon Dec 24 10:47:48 2018
>> New Revision: 342389
>> URL: https://svnweb.freebsd.org/changeset/base/342389
>> 
>> Log:
>>Clarify kld_list format
>>
>>PR:   docs/234248
>>Submitted by: David Fiander
>>Submitted by: Miroslav Lachman
>> 
>> Modified:
>>head/share/man/man5/rc.conf.5
>> 
>> Modified: head/share/man/man5/rc.conf.5
>>
>==
>> --- head/share/man/man5/rc.conf.5Mon Dec 24 06:14:32 2018
>> (r342388)
>> +++ head/share/man/man5/rc.conf.5Mon Dec 24 10:47:48 2018
>> (r342389)
>> @@ -248,12 +248,14 @@ Default
>>   .Pa /etc/ddb.conf .
>>   .It Va kld_list
>>   .Pq Vt str
>> -A list of kernel modules to load right after the local
>> -disks are mounted.
>> +A whitespace-separated list of kernel modules to load right after
>> +the local disks are mounted, without any
>> +.Pa .ko
>> +extension or path.
>>   Loading modules at this point in the boot process is
>>   much faster than doing it via
>>   .Pa /boot/loader.conf
>> -for those modules not necessary for mounting local disk.
>> +for those modules not necessary for mounting local disks.
>>   .It Va kldxref_enable
>>   .Pq Vt bool
>>   Set to
>
>
>Hi!
>Sorry for jumping into this so late.
>Please please PLEASE don't break loading modules by path in kld_list. 
>This is used by the drm-kmod files to distinguish them from the base 
>modules, and this has been communicated in documentation all over the 
>place, including numerous ports.
>
>Can this please be reverted, or amended to match reality.
>
>In practice, adding both the path and the extension (.ko) to a module
>in 
>kld_list works and the module loads.

As the code itself stands, it works for loading, but throws an error if you try 
to load an already loaded module adding a .ko extension.  In other words, it 
works but is wrong.  The path actually still does work, which was my mistake.

I'm awaiting approval for this, which correctly handles all cases:

https://reviews.freebsd.org/D18670

Konstantin has reviewed, but doesn't feel comfortable giving approval as it's 
not his area, which is fair enough.

Chris

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: svn commit: r342389 - head/share/man/man5

2018-12-28 Thread Niclas Zeising

On 12/24/18 11:47 AM, Chris Rees wrote:

Author: crees (doc,ports committer)
Date: Mon Dec 24 10:47:48 2018
New Revision: 342389
URL: https://svnweb.freebsd.org/changeset/base/342389

Log:
   Clarify kld_list format
   
   PR:		docs/234248

   Submitted by:David Fiander
   Submitted by:Miroslav Lachman

Modified:
   head/share/man/man5/rc.conf.5

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Mon Dec 24 06:14:32 2018
(r342388)
+++ head/share/man/man5/rc.conf.5   Mon Dec 24 10:47:48 2018
(r342389)
@@ -248,12 +248,14 @@ Default
  .Pa /etc/ddb.conf .
  .It Va kld_list
  .Pq Vt str
-A list of kernel modules to load right after the local
-disks are mounted.
+A whitespace-separated list of kernel modules to load right after
+the local disks are mounted, without any
+.Pa .ko
+extension or path.
  Loading modules at this point in the boot process is
  much faster than doing it via
  .Pa /boot/loader.conf
-for those modules not necessary for mounting local disk.
+for those modules not necessary for mounting local disks.
  .It Va kldxref_enable
  .Pq Vt bool
  Set to



Hi!
Sorry for jumping into this so late.
Please please PLEASE don't break loading modules by path in kld_list. 
This is used by the drm-kmod files to distinguish them from the base 
modules, and this has been communicated in documentation all over the 
place, including numerous ports.


Can this please be reverted, or amended to match reality.

In practice, adding both the path and the extension (.ko) to a module in 
kld_list works and the module loads.


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


Re: svn commit: r342577 - head/bin/sh

2018-12-28 Thread John Baldwin
On 12/28/18 9:51 AM, Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Fri Dec 28 17:51:40 2018
> New Revision: 342577
> URL: https://svnweb.freebsd.org/changeset/base/342577
> 
> Log:
>   Make sh(1) collapse $HOME into "~" in PS1.
>   
>   Reviewed by:jilles
>   MFC after:  2 weeks
>   Sponsored by:   DARPA, AFRL
>   Differential Revision:  https://reviews.freebsd.org/D18663
> 
> Modified:
>   head/bin/sh/parser.c
> 
> Modified: head/bin/sh/parser.c
> ==
> --- head/bin/sh/parser.c  Fri Dec 28 17:50:40 2018(r342576)
> +++ head/bin/sh/parser.c  Fri Dec 28 17:51:40 2018(r342577)
> @@ -1978,7 +1978,9 @@ getprompt(void *unused __unused)
>  {
>   static char ps[PROMPTLEN];
>   const char *fmt;
> + const char *home;
>   const char *pwd;
> + size_t homelen;
>   int i, trim;
>   static char internal_error[] = "??";
>  
> @@ -2039,8 +2041,24 @@ getprompt(void *unused __unused)
>   *pwd == '/' && pwd[1] != '\0')
>   strlcpy([i], strrchr(pwd, '/') + 1,
>   PROMPTLEN - i);
> - else
> - strlcpy([i], pwd, PROMPTLEN - i);
> + else {
> + home = lookupvar("HOME");
> + if (home != NULL)
> + homelen = strlen(home);
> + if (home != NULL &&
> + strcmp(home, "/") != 0 &&
> + strncmp(pwd, home, homelen) == 0 &&
> + (pwd[homelen] == '/' ||
> + pwd[homelen] == '\0')) {
> + strlcpy([i], "~",
> + PROMPTLEN - i);
> + strlcpy([i + 1],
> + pwd + homelen,
> + PROMPTLEN - i - 1);
> + } else {
> + strlcpy([i], pwd, PROMPTLEN 
> - i);
> + }
> + }

The existing code already did this, but isn't the fancy math with the size
passed to strlcpy() one of the things strlcpy() tries to prevent?  Using
strlcat would seem to be harder to get wrong, that is:

 if (...) {
 strlcat(ps, "~", PROMPTLEN);
 strlcat(ps, pwd + homelen, PROMPTLEN);
 } else
 strlcat(ps, pwd, PROMPTLEN);

looks simpler to read and seems less error prone.

-- 
John Baldwin


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


svn commit: r342577 - head/bin/sh

2018-12-28 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Dec 28 17:51:40 2018
New Revision: 342577
URL: https://svnweb.freebsd.org/changeset/base/342577

Log:
  Make sh(1) collapse $HOME into "~" in PS1.
  
  Reviewed by:  jilles
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D18663

Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==
--- head/bin/sh/parser.cFri Dec 28 17:50:40 2018(r342576)
+++ head/bin/sh/parser.cFri Dec 28 17:51:40 2018(r342577)
@@ -1978,7 +1978,9 @@ getprompt(void *unused __unused)
 {
static char ps[PROMPTLEN];
const char *fmt;
+   const char *home;
const char *pwd;
+   size_t homelen;
int i, trim;
static char internal_error[] = "??";
 
@@ -2039,8 +2041,24 @@ getprompt(void *unused __unused)
*pwd == '/' && pwd[1] != '\0')
strlcpy([i], strrchr(pwd, '/') + 1,
PROMPTLEN - i);
-   else
-   strlcpy([i], pwd, PROMPTLEN - i);
+   else {
+   home = lookupvar("HOME");
+   if (home != NULL)
+   homelen = strlen(home);
+   if (home != NULL &&
+   strcmp(home, "/") != 0 &&
+   strncmp(pwd, home, homelen) == 0 &&
+   (pwd[homelen] == '/' ||
+   pwd[homelen] == '\0')) {
+   strlcpy([i], "~",
+   PROMPTLEN - i);
+   strlcpy([i + 1],
+   pwd + homelen,
+   PROMPTLEN - i - 1);
+   } else {
+   strlcpy([i], pwd, PROMPTLEN 
- i);
+   }
+   }
/* Skip to end of path. */
while (ps[i + 1] != '\0')
i++;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342576 - head/share/skel

2018-12-28 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Dec 28 17:50:40 2018
New Revision: 342576
URL: https://svnweb.freebsd.org/changeset/base/342576

Log:
  Simplify the way we set the default sh(1) PS1.  No functional changes.
  
  Reviewed by:  jilles
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D18662

Modified:
  head/share/skel/dot.shrc

Modified: head/share/skel/dot.shrc
==
--- head/share/skel/dot.shrcFri Dec 28 17:00:12 2018(r342575)
+++ head/share/skel/dot.shrcFri Dec 28 17:50:40 2018(r342576)
@@ -33,11 +33,7 @@ alias g='egrep -i'
 
 
 # # set prompt: ``username@hostname$ '' 
-# PS1="`whoami`@`hostname | sed 's/\..*//'`"
-# case `id -u` in
-#  0) PS1="${PS1}# ";;
-#  *) PS1="${PS1}$ ";;
-# esac
+# PS1="`whoami`@\h\\$ "
 
 # search path for cd(1)
 # CDPATH=:$HOME
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342575 - head/usr.bin/ar

2018-12-28 Thread Ed Maste
Author: emaste
Date: Fri Dec 28 17:00:12 2018
New Revision: 342575
URL: https://svnweb.freebsd.org/changeset/base/342575

Log:
  ar: detect and error out on 32-bit symbol table overflow
  
  BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
  previously truncated to 32-bits, silently producing corrupted archives
  larger than 4GB.
  
  Note that this is only a partial fix; additional checks will come.
  
  PR:   234454
  Reported by:  Aijaz Baig, imp
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/ar/write.c

Modified: head/usr.bin/ar/write.c
==
--- head/usr.bin/ar/write.c Fri Dec 28 16:08:49 2018(r342574)
+++ head/usr.bin/ar/write.c Fri Dec 28 17:00:12 2018(r342575)
@@ -659,9 +659,13 @@ write_objs(struct bsdar *bsdar)
pm_sz = _ARMAG_LEN + (_ARHDR_LEN + s_sz);
if (bsdar->as != NULL)
pm_sz += _ARHDR_LEN + bsdar->as_sz;
-   for (i = 0; (size_t)i < bsdar->s_cnt; i++)
+   for (i = 0; (size_t)i < bsdar->s_cnt; i++) {
+   if (*(bsdar->s_so + i) > UINT32_MAX - pm_sz)
+   bsdar_errc(bsdar, EX_SOFTWARE, 0,
+   "Symbol table offset overflow");
*(bsdar->s_so + i) = htobe32(*(bsdar->s_so + i) +
pm_sz);
+   }
}
 
if ((a = archive_write_new()) == NULL)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342574 - head/lib/libc/string

2018-12-28 Thread Konstantin Belousov
Author: kib
Date: Fri Dec 28 16:08:49 2018
New Revision: 342574
URL: https://svnweb.freebsd.org/changeset/base/342574

Log:
  Fix WITHOUT_NLS build after r342551.
  
  Reported by:  gj
  MFC after:13 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libc/string/strerror.c

Modified: head/lib/libc/string/strerror.c
==
--- head/lib/libc/string/strerror.c Fri Dec 28 15:11:22 2018
(r342573)
+++ head/lib/libc/string/strerror.c Fri Dec 28 16:08:49 2018
(r342574)
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
  * statically linked binaries.
  */
 static void
-errstr(int num, char *uprefix, char *buf, size_t len)
+errstr(int num, const char *uprefix, char *buf, size_t len)
 {
char *t;
unsigned int uerr;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342573 - head/usr.sbin/autofs

2018-12-28 Thread Chris Rees
Author: crees (doc,ports committer)
Date: Fri Dec 28 15:11:22 2018
New Revision: 342573
URL: https://svnweb.freebsd.org/changeset/base/342573

Log:
  There is no way of escaping literal $ signs in auto_master(5), which
  makes for difficulty with hidden Samba shares; shares with $ at the end
  of their name.  This enables the use of ${DOLLAR} to work around this.
  
  Reviewed by:  bcr (man page)
  Approved by:  trasz
  Differential Revision:https://reviews.freebsd.org/D7048

Modified:
  head/usr.sbin/autofs/auto_master.5
  head/usr.sbin/autofs/defined.c

Modified: head/usr.sbin/autofs/auto_master.5
==
--- head/usr.sbin/autofs/auto_master.5  Fri Dec 28 13:32:14 2018
(r342572)
+++ head/usr.sbin/autofs/auto_master.5  Fri Dec 28 15:11:22 2018
(r342573)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 13, 2015
+.Dd December 28, 2018
 .Dt AUTO_MASTER 5
 .Os
 .Sh NAME
@@ -187,6 +187,8 @@ Expands to the output of
 .Li "uname -p" .
 .It Li CPU
 Same as ARCH.
+.It Li DOLLAR
+A literal $ sign.
 .It Li HOST
 Expands to the output of
 .Li "uname -n" .

Modified: head/usr.sbin/autofs/defined.c
==
--- head/usr.sbin/autofs/defined.c  Fri Dec 28 13:32:14 2018
(r342572)
+++ head/usr.sbin/autofs/defined.c  Fri Dec 28 15:11:22 2018
(r342573)
@@ -266,6 +266,7 @@ defined_init(void)
 
defined_add("ARCH", name.machine);
defined_add("CPU", name.machine);
+   defined_add("DOLLAR", "$");
defined_add("HOST", name.nodename);
defined_add("OSNAME", name.sysname);
defined_add("OSREL", name.release);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342572 - head/sys/kern

2018-12-28 Thread Jilles Tjoelker
Author: jilles
Date: Fri Dec 28 13:32:14 2018
New Revision: 342572
URL: https://svnweb.freebsd.org/changeset/base/342572

Log:
  pfind, pfind_any: Correct zombie logic
  
  SVN r340744 erroneously changed pfind() to return any process including
  zombies and pfind_any() to return only non-zombie processes.
  
  In particular, this caused kill() on a zombie process to fail with [ESRCH].
  There is no direct test case for this but /usr/tests/bin/sh/builtins/kill1.0
  occasionally triggers it (as reported by lwhsu).
  
  Conversely, returning zombies from pfind() seems likely to violate
  invariants and cause panics, but I have not looked at this.
  
  PR:   233646
  Reviewed by:  mjg, kib, ngie
  Differential Revision:https://reviews.freebsd.org/D18665

Modified:
  head/sys/kern/kern_proc.c

Modified: head/sys/kern/kern_proc.c
==
--- head/sys/kern/kern_proc.c   Fri Dec 28 10:10:16 2018(r342571)
+++ head/sys/kern/kern_proc.c   Fri Dec 28 13:32:14 2018(r342572)
@@ -388,7 +388,7 @@ _pfind(pid_t pid, bool zombie)
if (p->p_pid == pid) {
PROC_LOCK(p);
if (p->p_state == PRS_NEW ||
-   (zombie && p->p_state == PRS_ZOMBIE)) {
+   (!zombie && p->p_state == PRS_ZOMBIE)) {
PROC_UNLOCK(p);
p = NULL;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342571 - stable/11/sbin/ipfw

2018-12-28 Thread Andrey V. Elsukov
Author: ae
Date: Fri Dec 28 10:10:16 2018
New Revision: 342571
URL: https://svnweb.freebsd.org/changeset/base/342571

Log:
  MFC r342298:
Allow use underscores and dots in service names without escaping.
  
PR: 234237

Modified:
  stable/11/sbin/ipfw/ipfw2.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/ipfw/ipfw2.c
==
--- stable/11/sbin/ipfw/ipfw2.c Fri Dec 28 10:09:18 2018(r342570)
+++ stable/11/sbin/ipfw/ipfw2.c Fri Dec 28 10:10:16 2018(r342571)
@@ -940,7 +940,8 @@ strtoport(char *s, char **end, int base, int proto)
/*
 * find separator. '\\' escapes the next char.
 */
-   for (s1 = s; *s1 && (isalnum(*s1) || *s1 == '\\') ; s1++)
+   for (s1 = s; *s1 && (isalnum(*s1) || *s1 == '\\' ||
+   *s1 == '_' || *s1 == '.') ; s1++)
if (*s1 == '\\' && s1[1] != '\0')
s1++;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342570 - stable/12/sbin/ipfw

2018-12-28 Thread Andrey V. Elsukov
Author: ae
Date: Fri Dec 28 10:09:18 2018
New Revision: 342570
URL: https://svnweb.freebsd.org/changeset/base/342570

Log:
  MFC r342298:
Allow use underscores and dots in service names without escaping.
  
PR: 234237

Modified:
  stable/12/sbin/ipfw/ipfw2.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/ipfw/ipfw2.c
==
--- stable/12/sbin/ipfw/ipfw2.c Fri Dec 28 08:53:26 2018(r342569)
+++ stable/12/sbin/ipfw/ipfw2.c Fri Dec 28 10:09:18 2018(r342570)
@@ -940,7 +940,8 @@ strtoport(char *s, char **end, int base, int proto)
/*
 * find separator. '\\' escapes the next char.
 */
-   for (s1 = s; *s1 && (isalnum(*s1) || *s1 == '\\') ; s1++)
+   for (s1 = s; *s1 && (isalnum(*s1) || *s1 == '\\' ||
+   *s1 == '_' || *s1 == '.') ; s1++)
if (*s1 == '\\' && s1[1] != '\0')
s1++;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342568 - stable/12/sys/dev/ichwd

2018-12-28 Thread Andriy Gapon
Author: avg
Date: Fri Dec 28 08:52:50 2018
New Revision: 342568
URL: https://svnweb.freebsd.org/changeset/base/342568

Log:
  MFC r342193: ichwd: add a few assertions about tco_version

Modified:
  stable/12/sys/dev/ichwd/ichwd.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/ichwd/ichwd.c
==
--- stable/12/sys/dev/ichwd/ichwd.c Fri Dec 28 08:50:27 2018
(r342567)
+++ stable/12/sys/dev/ichwd/ichwd.c Fri Dec 28 08:52:50 2018
(r342568)
@@ -635,6 +635,13 @@ ichwd_identify(driver_t *driver, device_t parent)
return;
}
 
+   KASSERT(id_p->tco_version >= 1,
+   ("unexpected TCO version %d", id_p->tco_version));
+   KASSERT(id_p->tco_version != 4 || smb != NULL,
+   ("could not find PCI SMBus device for TCOv4"));
+   KASSERT(id_p->tco_version >= 4 || ich != NULL,
+   ("could not find PCI LPC bridge device for TCOv1-3"));
+
/* good, add child to bus */
if ((dev = device_find_child(parent, driver->name, 0)) == NULL)
dev = BUS_ADD_CHILD(parent, 0, driver->name, 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342569 - stable/11/sys/dev/ichwd

2018-12-28 Thread Andriy Gapon
Author: avg
Date: Fri Dec 28 08:53:26 2018
New Revision: 342569
URL: https://svnweb.freebsd.org/changeset/base/342569

Log:
  MFC r342193: ichwd: add a few assertions about tco_version

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

Modified: stable/11/sys/dev/ichwd/ichwd.c
==
--- stable/11/sys/dev/ichwd/ichwd.c Fri Dec 28 08:52:50 2018
(r342568)
+++ stable/11/sys/dev/ichwd/ichwd.c Fri Dec 28 08:53:26 2018
(r342569)
@@ -633,6 +633,13 @@ ichwd_identify(driver_t *driver, device_t parent)
return;
}
 
+   KASSERT(id_p->tco_version >= 1,
+   ("unexpected TCO version %d", id_p->tco_version));
+   KASSERT(id_p->tco_version != 4 || smb != NULL,
+   ("could not find PCI SMBus device for TCOv4"));
+   KASSERT(id_p->tco_version >= 4 || ich != NULL,
+   ("could not find PCI LPC bridge device for TCOv1-3"));
+
/* good, add child to bus */
if ((dev = device_find_child(parent, driver->name, 0)) == NULL)
dev = BUS_ADD_CHILD(parent, 0, driver->name, 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342567 - stable/11/sys/dev/ichwd

2018-12-28 Thread Andriy Gapon
Author: avg
Date: Fri Dec 28 08:50:27 2018
New Revision: 342567
URL: https://svnweb.freebsd.org/changeset/base/342567

Log:
  MFC r342073: ichwd: add Sunrise Point-LP ID

Modified:
  stable/11/sys/dev/ichwd/ichwd.c
  stable/11/sys/dev/ichwd/ichwd.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/ichwd/ichwd.c
==
--- stable/11/sys/dev/ichwd/ichwd.c Fri Dec 28 08:49:51 2018
(r342566)
+++ stable/11/sys/dev/ichwd/ichwd.c Fri Dec 28 08:50:27 2018
(r342567)
@@ -293,6 +293,7 @@ static struct ichwd_device ichwd_devices[] = {
 
 static struct ichwd_device ichwd_smb_devices[] = {
{ DEVICEID_LEWISBURG_SMB, "Lewisburg watchdog timer",   10, 4 },
+   { DEVICEID_SRPTLP_SMB,"Sunrise Point-LP watchdog timer",10, 4 },
{ 0, NULL, 0, 0 },
 };
 

Modified: stable/11/sys/dev/ichwd/ichwd.h
==
--- stable/11/sys/dev/ichwd/ichwd.h Fri Dec 28 08:49:51 2018
(r342566)
+++ stable/11/sys/dev/ichwd/ichwd.h Fri Dec 28 08:50:27 2018
(r342567)
@@ -274,6 +274,7 @@ struct ichwd_softc {
 #defineDEVICEID_WCPT_LP7   0x9cc7
 #defineDEVICEID_WCPT_LP9   0x9cc9
 #defineDEVICEID_LEWISBURG_SMB  0xa1a3
+#defineDEVICEID_SRPTLP_SMB 0x9d23
 
 /* ICH LPC Interface Bridge Registers (ICH5 and older) */
 #defineICH_GEN_STA 0xd4
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342566 - stable/12/sys/dev/ichwd

2018-12-28 Thread Andriy Gapon
Author: avg
Date: Fri Dec 28 08:49:51 2018
New Revision: 342566
URL: https://svnweb.freebsd.org/changeset/base/342566

Log:
  MFC r342073: ichwd: add Sunrise Point-LP ID

Modified:
  stable/12/sys/dev/ichwd/ichwd.c
  stable/12/sys/dev/ichwd/ichwd.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/ichwd/ichwd.c
==
--- stable/12/sys/dev/ichwd/ichwd.c Fri Dec 28 08:48:37 2018
(r342565)
+++ stable/12/sys/dev/ichwd/ichwd.c Fri Dec 28 08:49:51 2018
(r342566)
@@ -295,6 +295,7 @@ static struct ichwd_device ichwd_devices[] = {
 
 static struct ichwd_device ichwd_smb_devices[] = {
{ DEVICEID_LEWISBURG_SMB, "Lewisburg watchdog timer",   10, 4 },
+   { DEVICEID_SRPTLP_SMB,"Sunrise Point-LP watchdog timer",10, 4 },
{ 0, NULL, 0, 0 },
 };
 

Modified: stable/12/sys/dev/ichwd/ichwd.h
==
--- stable/12/sys/dev/ichwd/ichwd.h Fri Dec 28 08:48:37 2018
(r342565)
+++ stable/12/sys/dev/ichwd/ichwd.h Fri Dec 28 08:49:51 2018
(r342566)
@@ -276,6 +276,7 @@ struct ichwd_softc {
 #defineDEVICEID_WCPT_LP7   0x9cc7
 #defineDEVICEID_WCPT_LP9   0x9cc9
 #defineDEVICEID_LEWISBURG_SMB  0xa1a3
+#defineDEVICEID_SRPTLP_SMB 0x9d23
 
 /* ICH LPC Interface Bridge Registers (ICH5 and older) */
 #defineICH_GEN_STA 0xd4
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342565 - stable/11/sys/dev/ichwd

2018-12-28 Thread Andriy Gapon
Author: avg
Date: Fri Dec 28 08:48:37 2018
New Revision: 342565
URL: https://svnweb.freebsd.org/changeset/base/342565

Log:
  MFC r342072: ichwd: add support for clearing No Reboot bit in TCOv4

Modified:
  stable/11/sys/dev/ichwd/ichwd.c
  stable/11/sys/dev/ichwd/ichwd.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/ichwd/ichwd.c
==
--- stable/11/sys/dev/ichwd/ichwd.c Fri Dec 28 08:47:52 2018
(r342564)
+++ stable/11/sys/dev/ichwd/ichwd.c Fri Dec 28 08:48:37 2018
(r342565)
@@ -74,6 +74,10 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include 
+#include 
+#include 
+
 static struct ichwd_device ichwd_devices[] = {
{ DEVICEID_82801AA,  "Intel 82801AA watchdog timer",1, 1 },
{ DEVICEID_82801AB,  "Intel 82801AB watchdog timer",1, 1 },
@@ -307,6 +311,8 @@ static devclass_t ichwd_devclass;
 /* NB: TCO version 3 devices use the gcs_res resource for the PMC register. */
 #define ichwd_read_pmc_4(sc, off) \
bus_read_4((sc)->gcs_res, (off))
+#define ichwd_read_gc_4(sc, off) \
+   bus_read_4((sc)->gc_res, (off))
 
 #define ichwd_write_tco_1(sc, off, val) \
bus_write_1((sc)->tco_res, (off), (val))
@@ -321,6 +327,8 @@ static devclass_t ichwd_devclass;
 /* NB: TCO version 3 devices use the gcs_res resource for the PMC register. */
 #define ichwd_write_pmc_4(sc, off, val) \
bus_write_4((sc)->gcs_res, (off), (val))
+#define ichwd_write_gc_4(sc, off, val) \
+   bus_write_4((sc)->gc_res, (off), (val))
 
 #define ichwd_verbose_printf(dev, ...) \
do {\
@@ -493,9 +501,12 @@ ichwd_clear_noreboot(struct ichwd_softc *sc)
rc = EIO;
break;
case 4:
-   /*
-* TODO.  This needs access to a hidden PCI device at 31:1.
-*/
+   status = ichwd_read_gc_4(sc, 0);
+   status &= ~SMB_GC_NO_REBOOT;
+   ichwd_write_gc_4(sc, 0, status);
+   status = ichwd_read_gc_4(sc, 0);
+   if (status & SMB_GC_NO_REBOOT)
+   rc = EIO;
break;
default:
ichwd_verbose_printf(sc->device,
@@ -609,6 +620,7 @@ ichwd_identify(driver_t *driver, device_t parent)
struct ichwd_device *id_p;
device_t ich, smb;
device_t dev;
+   uint64_t base_address64;
uint32_t base_address;
uint32_t ctl;
int rc;
@@ -669,6 +681,33 @@ ichwd_identify(driver_t *driver, device_t parent)
"Can not set TCO v%d I/O resource (err = %d)\n",
id_p->tco_version, rc);
}
+
+   /*
+* Unhide Primary to Sideband Bridge (P2SB) PCI device, so that
+* we can discover the base address of Private Configuration
+* Space via the bridge's BAR.
+* Then hide back the bridge.
+*/
+   pci_cfgregwrite(0, 31, 1, 0xe1, 0, 1);
+   base_address64 = pci_cfgregread(0, 31, 1, SBREG_BAR + 4, 4);
+   base_address64 <<= 32;
+   base_address64 |= pci_cfgregread(0, 31, 1, SBREG_BAR, 4);
+   base_address64 &= ~0xfull;
+   pci_cfgregwrite(0, 31, 1, 0xe1, 1, 1);
+
+   /*
+* No Reboot bit is in General Control register, offset 0xc,
+* within the SMBus target port, ID 0xc6.
+*/
+   base_address64 += PCR_REG_OFF(SMB_PORT_ID, SMB_GC_REG);
+   rc = bus_set_resource(dev, SYS_RES_MEMORY, 1, base_address64,
+   SMB_GC_SIZE);
+   if (rc != 0) {
+   ichwd_verbose_printf(dev,
+   "Can not set TCO v%d PCR I/O resource (err = %d)\n",
+   id_p->tco_version, rc);
+   }
+
break;
default:
ichwd_verbose_printf(dev,
@@ -721,6 +760,18 @@ ichwd_smb_attach(device_t dev)
return (ENXIO);
}
 
+   /*
+* Allocate General Control I/O register in PCH
+* Private Configuration Space (PCR).
+*/
+   sc->gc_rid = 1;
+   sc->gc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, >gc_rid,
+   RF_ACTIVE | RF_SHAREABLE);
+   if (sc->gc_res == NULL) {
+   device_printf(dev, "unable to reserve hidden P2SB registers\n");
+   return (ENXIO);
+   }
+
/* Get ACPI base address. */
isab = device_get_parent(device_get_parent(dev));
pmdev = pci_find_dbsf(pci_get_domain(isab), pci_get_bus(isab), 31, 2);
@@ -735,7 +786,7 @@ ichwd_smb_attach(device_t dev)
}
 
/* Allocate SMI control I/O register space. */
-   sc->smi_rid = 1;
+   sc->smi_rid = 2;
sc->smi_res = 

svn commit: r342564 - stable/12/sys/dev/ichwd

2018-12-28 Thread Andriy Gapon
Author: avg
Date: Fri Dec 28 08:47:52 2018
New Revision: 342564
URL: https://svnweb.freebsd.org/changeset/base/342564

Log:
  MFC r342072: ichwd: add support for clearing No Reboot bit in TCOv4

Modified:
  stable/12/sys/dev/ichwd/ichwd.c
  stable/12/sys/dev/ichwd/ichwd.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/ichwd/ichwd.c
==
--- stable/12/sys/dev/ichwd/ichwd.c Fri Dec 28 01:34:08 2018
(r342563)
+++ stable/12/sys/dev/ichwd/ichwd.c Fri Dec 28 08:47:52 2018
(r342564)
@@ -76,6 +76,10 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include 
+#include 
+#include 
+
 static struct ichwd_device ichwd_devices[] = {
{ DEVICEID_82801AA,  "Intel 82801AA watchdog timer",1, 1 },
{ DEVICEID_82801AB,  "Intel 82801AB watchdog timer",1, 1 },
@@ -309,6 +313,8 @@ static devclass_t ichwd_devclass;
 /* NB: TCO version 3 devices use the gcs_res resource for the PMC register. */
 #define ichwd_read_pmc_4(sc, off) \
bus_read_4((sc)->gcs_res, (off))
+#define ichwd_read_gc_4(sc, off) \
+   bus_read_4((sc)->gc_res, (off))
 
 #define ichwd_write_tco_1(sc, off, val) \
bus_write_1((sc)->tco_res, (off), (val))
@@ -323,6 +329,8 @@ static devclass_t ichwd_devclass;
 /* NB: TCO version 3 devices use the gcs_res resource for the PMC register. */
 #define ichwd_write_pmc_4(sc, off, val) \
bus_write_4((sc)->gcs_res, (off), (val))
+#define ichwd_write_gc_4(sc, off, val) \
+   bus_write_4((sc)->gc_res, (off), (val))
 
 #define ichwd_verbose_printf(dev, ...) \
do {\
@@ -495,9 +503,12 @@ ichwd_clear_noreboot(struct ichwd_softc *sc)
rc = EIO;
break;
case 4:
-   /*
-* TODO.  This needs access to a hidden PCI device at 31:1.
-*/
+   status = ichwd_read_gc_4(sc, 0);
+   status &= ~SMB_GC_NO_REBOOT;
+   ichwd_write_gc_4(sc, 0, status);
+   status = ichwd_read_gc_4(sc, 0);
+   if (status & SMB_GC_NO_REBOOT)
+   rc = EIO;
break;
default:
ichwd_verbose_printf(sc->device,
@@ -611,6 +622,7 @@ ichwd_identify(driver_t *driver, device_t parent)
struct ichwd_device *id_p;
device_t ich, smb;
device_t dev;
+   uint64_t base_address64;
uint32_t base_address;
uint32_t ctl;
int rc;
@@ -671,6 +683,33 @@ ichwd_identify(driver_t *driver, device_t parent)
"Can not set TCO v%d I/O resource (err = %d)\n",
id_p->tco_version, rc);
}
+
+   /*
+* Unhide Primary to Sideband Bridge (P2SB) PCI device, so that
+* we can discover the base address of Private Configuration
+* Space via the bridge's BAR.
+* Then hide back the bridge.
+*/
+   pci_cfgregwrite(0, 31, 1, 0xe1, 0, 1);
+   base_address64 = pci_cfgregread(0, 31, 1, SBREG_BAR + 4, 4);
+   base_address64 <<= 32;
+   base_address64 |= pci_cfgregread(0, 31, 1, SBREG_BAR, 4);
+   base_address64 &= ~0xfull;
+   pci_cfgregwrite(0, 31, 1, 0xe1, 1, 1);
+
+   /*
+* No Reboot bit is in General Control register, offset 0xc,
+* within the SMBus target port, ID 0xc6.
+*/
+   base_address64 += PCR_REG_OFF(SMB_PORT_ID, SMB_GC_REG);
+   rc = bus_set_resource(dev, SYS_RES_MEMORY, 1, base_address64,
+   SMB_GC_SIZE);
+   if (rc != 0) {
+   ichwd_verbose_printf(dev,
+   "Can not set TCO v%d PCR I/O resource (err = %d)\n",
+   id_p->tco_version, rc);
+   }
+
break;
default:
ichwd_verbose_printf(dev,
@@ -723,6 +762,18 @@ ichwd_smb_attach(device_t dev)
return (ENXIO);
}
 
+   /*
+* Allocate General Control I/O register in PCH
+* Private Configuration Space (PCR).
+*/
+   sc->gc_rid = 1;
+   sc->gc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, >gc_rid,
+   RF_ACTIVE | RF_SHAREABLE);
+   if (sc->gc_res == NULL) {
+   device_printf(dev, "unable to reserve hidden P2SB registers\n");
+   return (ENXIO);
+   }
+
/* Get ACPI base address. */
isab = device_get_parent(device_get_parent(dev));
pmdev = pci_find_dbsf(pci_get_domain(isab), pci_get_bus(isab), 31, 2);
@@ -737,7 +788,7 @@ ichwd_smb_attach(device_t dev)
}
 
/* Allocate SMI control I/O register space. */
-   sc->smi_rid = 1;
+   sc->smi_rid = 2;
sc->smi_res =