svn commit: r346983 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 12/contrib/sqlite3 12/contrib/sqlite3/tea

2019-04-30 Thread Cy Schubert
Author: cy
Date: Wed May  1 01:53:19 2019
New Revision: 346983
URL: https://svnweb.freebsd.org/changeset/base/346983

Log:
  MFC r346459:
  
MFV r346450:
  
Update sqlite3-3.27.1 (3270100) --> sqlite3-3.27.2 (3270200)

Modified:
  stable/12/contrib/sqlite3/configure
  stable/12/contrib/sqlite3/configure.ac
  stable/12/contrib/sqlite3/sqlite3.c
  stable/12/contrib/sqlite3/sqlite3.h
  stable/12/contrib/sqlite3/tea/configure
  stable/12/contrib/sqlite3/tea/configure.ac
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/contrib/sqlite3/configure
  stable/11/contrib/sqlite3/configure.ac
  stable/11/contrib/sqlite3/sqlite3.c
  stable/11/contrib/sqlite3/sqlite3.h
  stable/11/contrib/sqlite3/tea/configure
  stable/11/contrib/sqlite3/tea/configure.ac
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/contrib/sqlite3/configure
==
--- stable/12/contrib/sqlite3/configure Wed May  1 01:49:33 2019
(r346982)
+++ stable/12/contrib/sqlite3/configure Wed May  1 01:53:19 2019
(r346983)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.27.1.
+# Generated by GNU Autoconf 2.69 for sqlite 3.27.2.
 #
 # Report bugs to .
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.27.1'
-PACKAGE_STRING='sqlite 3.27.1'
+PACKAGE_VERSION='3.27.2'
+PACKAGE_STRING='sqlite 3.27.2'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 PACKAGE_URL=''
 
@@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.27.1 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.27.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1412,7 +1412,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of sqlite 3.27.1:";;
+ short | recursive ) echo "Configuration of sqlite 3.27.2:";;
esac
   cat <<\_ACEOF
 
@@ -1537,7 +1537,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.27.1
+sqlite configure 3.27.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.27.1, which was
+It was created by sqlite $as_me 3.27.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2818,7 +2818,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='sqlite'
- VERSION='3.27.1'
+ VERSION='3.27.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.27.1, which was
+This file was extended by sqlite $as_me 3.27.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -14495,7 +14495,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-sqlite config.status 3.27.1
+sqlite config.status 3.27.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: stable/12/contrib/sqlite3/configure.ac
==
--- stable/12/contrib/sqlite3/configure.ac  Wed May  1 01:49:33 2019
(r346982)
+++ stable/12/contrib/sqlite3/configure.ac  Wed May  1 01:53:19 2019
(r346983)
@@ -10,7 +10,7 @@
 #
 
 AC_PREREQ(2.61)
-AC_INIT(sqlite, 3.27.1, http://www.sqlite.org)
+AC_INIT(sqlite, 3.27.2, http://www.sqlite.org)
 AC_CONFIG_SRCDIR([sqlite3.c])
 AC_CONFIG_AUX_DIR([.])
 

Modified: stable/12/contrib/sqlite3/sqlite3.c
==
--- stable/12/contrib/sqlite3/sqlite3.c Wed May  1 01:49:33 2019
(r346982)
+++ stable/12/contrib/sqlite3/sqlite3.c Wed May  1 01:53:19 2019
(r346983)
@@ -1,6 +1,6 @@
 /**
 ** This file is an amalgamation of many separate C source files from SQLite
-** version 3.27.1.  By combining all the individual C code files into this
+** version 3.27.2.  By combining all the individual C code files into this
 ** single 

svn commit: r346983 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 12/contrib/sqlite3 12/contrib/sqlite3/tea

2019-04-30 Thread Cy Schubert
Author: cy
Date: Wed May  1 01:53:19 2019
New Revision: 346983
URL: https://svnweb.freebsd.org/changeset/base/346983

Log:
  MFC r346459:
  
MFV r346450:
  
Update sqlite3-3.27.1 (3270100) --> sqlite3-3.27.2 (3270200)

Modified:
  stable/11/contrib/sqlite3/configure
  stable/11/contrib/sqlite3/configure.ac
  stable/11/contrib/sqlite3/sqlite3.c
  stable/11/contrib/sqlite3/sqlite3.h
  stable/11/contrib/sqlite3/tea/configure
  stable/11/contrib/sqlite3/tea/configure.ac
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/contrib/sqlite3/configure
  stable/12/contrib/sqlite3/configure.ac
  stable/12/contrib/sqlite3/sqlite3.c
  stable/12/contrib/sqlite3/sqlite3.h
  stable/12/contrib/sqlite3/tea/configure
  stable/12/contrib/sqlite3/tea/configure.ac
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/contrib/sqlite3/configure
==
--- stable/11/contrib/sqlite3/configure Wed May  1 01:49:33 2019
(r346982)
+++ stable/11/contrib/sqlite3/configure Wed May  1 01:53:19 2019
(r346983)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.27.1.
+# Generated by GNU Autoconf 2.69 for sqlite 3.27.2.
 #
 # Report bugs to .
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.27.1'
-PACKAGE_STRING='sqlite 3.27.1'
+PACKAGE_VERSION='3.27.2'
+PACKAGE_STRING='sqlite 3.27.2'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 PACKAGE_URL=''
 
@@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.27.1 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.27.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1412,7 +1412,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
- short | recursive ) echo "Configuration of sqlite 3.27.1:";;
+ short | recursive ) echo "Configuration of sqlite 3.27.2:";;
esac
   cat <<\_ACEOF
 
@@ -1537,7 +1537,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.27.1
+sqlite configure 3.27.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.27.1, which was
+It was created by sqlite $as_me 3.27.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2818,7 +2818,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='sqlite'
- VERSION='3.27.1'
+ VERSION='3.27.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.27.1, which was
+This file was extended by sqlite $as_me 3.27.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -14495,7 +14495,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-sqlite config.status 3.27.1
+sqlite config.status 3.27.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: stable/11/contrib/sqlite3/configure.ac
==
--- stable/11/contrib/sqlite3/configure.ac  Wed May  1 01:49:33 2019
(r346982)
+++ stable/11/contrib/sqlite3/configure.ac  Wed May  1 01:53:19 2019
(r346983)
@@ -10,7 +10,7 @@
 #
 
 AC_PREREQ(2.61)
-AC_INIT(sqlite, 3.27.1, http://www.sqlite.org)
+AC_INIT(sqlite, 3.27.2, http://www.sqlite.org)
 AC_CONFIG_SRCDIR([sqlite3.c])
 AC_CONFIG_AUX_DIR([.])
 

Modified: stable/11/contrib/sqlite3/sqlite3.c
==
--- stable/11/contrib/sqlite3/sqlite3.c Wed May  1 01:49:33 2019
(r346982)
+++ stable/11/contrib/sqlite3/sqlite3.c Wed May  1 01:53:19 2019
(r346983)
@@ -1,6 +1,6 @@
 /**
 ** This file is an amalgamation of many separate C source files from SQLite
-** version 3.27.1.  By combining all the individual C code files into this
+** version 3.27.2.  By combining all the individual C code files into this
 ** single 

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

2019-04-30 Thread Cy Schubert
Author: cy
Date: Wed May  1 01:49:33 2019
New Revision: 346982
URL: https://svnweb.freebsd.org/changeset/base/346982

Log:
  MFC r346804:
  
  Left justify a function header brace as it should be.
  No functional change.

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 Wed May  1 
01:43:17 2019(r346981)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed May  1 
01:49:33 2019(r346982)
@@ -1203,7 +1203,7 @@ ipf_checkv6sum(fin)
 size_t
 mbufchainlen(m0)
struct mbuf *m0;
-   {
+{
size_t len;
 
if ((m0->m_flags & M_PKTHDR) != 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: r346982 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2019-04-30 Thread Cy Schubert
Author: cy
Date: Wed May  1 01:49:33 2019
New Revision: 346982
URL: https://svnweb.freebsd.org/changeset/base/346982

Log:
  MFC r346804:
  
  Left justify a function header brace as it should be.
  No functional change.

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 Wed May  1 
01:43:17 2019(r346981)
+++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed May  1 
01:49:33 2019(r346982)
@@ -1181,7 +1181,7 @@ ipf_checkv6sum(fin)
 size_t
 mbufchainlen(m0)
struct mbuf *m0;
-   {
+{
size_t len;
 
if ((m0->m_flags & M_PKTHDR) != 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: r346982 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2019-04-30 Thread Cy Schubert
Author: cy
Date: Wed May  1 01:49:33 2019
New Revision: 346982
URL: https://svnweb.freebsd.org/changeset/base/346982

Log:
  MFC r346804:
  
  Left justify a function header brace as it should be.
  No functional change.

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 Wed May  1 
01:43:17 2019(r346981)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed May  1 
01:49:33 2019(r346982)
@@ -1181,7 +1181,7 @@ ipf_checkv6sum(fin)
 size_t
 mbufchainlen(m0)
struct mbuf *m0;
-   {
+{
size_t len;
 
if ((m0->m_flags & M_PKTHDR) != 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: r346981 - in stable/11: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/src/...

2019-04-30 Thread Cy Schubert
Author: cy
Date: Wed May  1 01:43:17 2019
New Revision: 346981
URL: https://svnweb.freebsd.org/changeset/base/346981

Log:
  MFC r341759, r341839, r346591:
  The following five MFCs update wpa 2.6 --> 2.8.
  
  r341759:
  MFV r341618: Update wpa 2.6 --> 2.7.
  
  r341839:
  Set default ciphers.
  
  Submitted by:   jkim@
  
  r346591:
  Update wpa_supplicant/hostapd 2.7 --> 2.8
  
  Upstream documents the following advisories:
  
  - https://w1.fi/security/2019-1/sae-side-channel-attacks.txt
  - https://w1.fi/security/2019-2/eap-pwd-side-channel-attack.txt
  - https://w1.fi/security/2019-3/sae-confirm-missing-state-validation.txt
  - https://w1.fi/security/2019-4/eap-pwd-missing-commit-validation.txt
  - https://w1.fi/security/2019-5/eap-pwd-message-reassembly-issue-\
with-unexpected-fragment.txt
  
  Security: CVE-2019-9494, VU#871675, CVE-2019-9495, CVE-2019-9496,
CVE-2019-9497, CVE-2019-9498, CVE-2019-9499
  
  Relnotes: yes

Added:
  stable/11/contrib/wpa/hostapd/README-MULTI-AP
 - copied unchanged from r346591, head/contrib/wpa/hostapd/README-MULTI-AP
  stable/11/contrib/wpa/src/ap/dpp_hostapd.c
 - copied, changed from r341759, head/contrib/wpa/src/ap/dpp_hostapd.c
  stable/11/contrib/wpa/src/ap/dpp_hostapd.h
 - copied, changed from r341759, head/contrib/wpa/src/ap/dpp_hostapd.h
  stable/11/contrib/wpa/src/ap/eth_p_oui.c
 - copied unchanged from r341759, head/contrib/wpa/src/ap/eth_p_oui.c
  stable/11/contrib/wpa/src/ap/eth_p_oui.h
 - copied unchanged from r341759, head/contrib/wpa/src/ap/eth_p_oui.h
  stable/11/contrib/wpa/src/ap/fils_hlp.c
 - copied, changed from r341759, head/contrib/wpa/src/ap/fils_hlp.c
  stable/11/contrib/wpa/src/ap/fils_hlp.h
 - copied unchanged from r341759, head/contrib/wpa/src/ap/fils_hlp.h
  stable/11/contrib/wpa/src/ap/gas_query_ap.c
 - copied unchanged from r341759, head/contrib/wpa/src/ap/gas_query_ap.c
  stable/11/contrib/wpa/src/ap/gas_query_ap.h
 - copied unchanged from r341759, head/contrib/wpa/src/ap/gas_query_ap.h
  stable/11/contrib/wpa/src/ap/ieee802_11_he.c
 - copied, changed from r341759, head/contrib/wpa/src/ap/ieee802_11_he.c
  stable/11/contrib/wpa/src/common/dhcp.h
 - copied unchanged from r341759, head/contrib/wpa/src/common/dhcp.h
  stable/11/contrib/wpa/src/common/dpp.c
 - copied, changed from r341759, head/contrib/wpa/src/common/dpp.c
  stable/11/contrib/wpa/src/common/dpp.h
 - copied, changed from r341759, head/contrib/wpa/src/common/dpp.h
  stable/11/contrib/wpa/src/common/gas_server.c
 - copied unchanged from r341759, head/contrib/wpa/src/common/gas_server.c
  stable/11/contrib/wpa/src/common/gas_server.h
 - copied unchanged from r341759, head/contrib/wpa/src/common/gas_server.h
  stable/11/contrib/wpa/src/common/ocv.c
 - copied unchanged from r346591, head/contrib/wpa/src/common/ocv.c
  stable/11/contrib/wpa/src/common/ocv.h
 - copied unchanged from r346591, head/contrib/wpa/src/common/ocv.h
  stable/11/contrib/wpa/src/crypto/crypto_linux.c
 - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_linux.c
  stable/11/contrib/wpa/src/crypto/crypto_nettle.c
 - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_nettle.c
  stable/11/contrib/wpa/src/crypto/crypto_wolfssl.c
 - copied, changed from r341759, 
head/contrib/wpa/src/crypto/crypto_wolfssl.c
  stable/11/contrib/wpa/src/crypto/fips_prf_wolfssl.c
 - copied unchanged from r341759, 
head/contrib/wpa/src/crypto/fips_prf_wolfssl.c
  stable/11/contrib/wpa/src/crypto/sha384-kdf.c
 - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha384-kdf.c
  stable/11/contrib/wpa/src/crypto/sha384.c
 - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha384.c
  stable/11/contrib/wpa/src/crypto/sha512-kdf.c
 - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512-kdf.c
  stable/11/contrib/wpa/src/crypto/sha512-prf.c
 - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512-prf.c
  stable/11/contrib/wpa/src/crypto/sha512.c
 - copied unchanged from r346591, head/contrib/wpa/src/crypto/sha512.c
  stable/11/contrib/wpa/src/crypto/sha512.h
 - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512.h
  stable/11/contrib/wpa/src/crypto/tls_wolfssl.c
 - copied, changed from r341759, head/contrib/wpa/src/crypto/tls_wolfssl.c
  stable/11/contrib/wpa/src/drivers/driver_macsec_linux.c
 - copied, changed from r341759, 
head/contrib/wpa/src/drivers/driver_macsec_linux.c
  stable/11/contrib/wpa/src/drivers/driver_wired_common.c
 - copied unchanged from r341759, 
head/contrib/wpa/src/drivers/driver_wired_common.c
  stable/11/contrib/wpa/src/drivers/driver_wired_common.h
 - copied unchanged from r341759, 
head/contrib/wpa/src/drivers/driver_wired_common.h
  stable/11/contrib/wpa/src/utils/const_time.h
 - copied unchanged from r346591, head/contrib/wpa/src/utils/const_time.h
  

svn commit: r346980 - in stable/12: . contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/sr...

2019-04-30 Thread Cy Schubert
Author: cy
Date: Wed May  1 01:42:38 2019
New Revision: 346980
URL: https://svnweb.freebsd.org/changeset/base/346980

Log:
  MFC r341759, r341796, r341839, r341989, r346591:
  The following five MFCs update wpa 2.6 --> 2.8.
  
  r341759:
  MFV r341618: Update wpa 2.6 --> 2.7.
  
  r341796:
  Clean stale wpa dependencies and objects after r341759
  
  The wpa update added some source files with the same name as a file in
  another directory (found via .PATH in the previous version).  Having a
  stale entry in a .depend file means the new file won't be built, so test
  for this case and if found remove all of wpa's dependency files.
  
  Sponsored by:   The FreeBSD Foundation
  
  r341839:
  Set default ciphers.
  
  Submitted by:   jkim@
  
  r341989:
  Makefile.inc1: update stale wpa dependency removal statement
  
  Only stale .depend files are removed; do not mention object files.
  
  r346591:
  Update wpa_supplicant/hostapd 2.7 --> 2.8
  
  Upstream documents the following advisories:
  
  - https://w1.fi/security/2019-1/sae-side-channel-attacks.txt
  - https://w1.fi/security/2019-2/eap-pwd-side-channel-attack.txt
  - https://w1.fi/security/2019-3/sae-confirm-missing-state-validation.txt
  - https://w1.fi/security/2019-4/eap-pwd-missing-commit-validation.txt
  - https://w1.fi/security/2019-5/eap-pwd-message-reassembly-issue-\
with-unexpected-fragment.txt
  
  Security: CVE-2019-9494, VU#871675, CVE-2019-9495, CVE-2019-9496,
CVE-2019-9497, CVE-2019-9498, CVE-2019-9499
  
  Relnotes: yes

Added:
  stable/12/contrib/wpa/hostapd/README-MULTI-AP
 - copied unchanged from r346591, head/contrib/wpa/hostapd/README-MULTI-AP
  stable/12/contrib/wpa/src/ap/dpp_hostapd.c
 - copied, changed from r341759, head/contrib/wpa/src/ap/dpp_hostapd.c
  stable/12/contrib/wpa/src/ap/dpp_hostapd.h
 - copied, changed from r341759, head/contrib/wpa/src/ap/dpp_hostapd.h
  stable/12/contrib/wpa/src/ap/eth_p_oui.c
 - copied unchanged from r341759, head/contrib/wpa/src/ap/eth_p_oui.c
  stable/12/contrib/wpa/src/ap/eth_p_oui.h
 - copied unchanged from r341759, head/contrib/wpa/src/ap/eth_p_oui.h
  stable/12/contrib/wpa/src/ap/fils_hlp.c
 - copied, changed from r341759, head/contrib/wpa/src/ap/fils_hlp.c
  stable/12/contrib/wpa/src/ap/fils_hlp.h
 - copied unchanged from r341759, head/contrib/wpa/src/ap/fils_hlp.h
  stable/12/contrib/wpa/src/ap/gas_query_ap.c
 - copied unchanged from r341759, head/contrib/wpa/src/ap/gas_query_ap.c
  stable/12/contrib/wpa/src/ap/gas_query_ap.h
 - copied unchanged from r341759, head/contrib/wpa/src/ap/gas_query_ap.h
  stable/12/contrib/wpa/src/ap/ieee802_11_he.c
 - copied, changed from r341759, head/contrib/wpa/src/ap/ieee802_11_he.c
  stable/12/contrib/wpa/src/common/dhcp.h
 - copied unchanged from r341759, head/contrib/wpa/src/common/dhcp.h
  stable/12/contrib/wpa/src/common/dpp.c
 - copied, changed from r341759, head/contrib/wpa/src/common/dpp.c
  stable/12/contrib/wpa/src/common/dpp.h
 - copied, changed from r341759, head/contrib/wpa/src/common/dpp.h
  stable/12/contrib/wpa/src/common/gas_server.c
 - copied unchanged from r341759, head/contrib/wpa/src/common/gas_server.c
  stable/12/contrib/wpa/src/common/gas_server.h
 - copied unchanged from r341759, head/contrib/wpa/src/common/gas_server.h
  stable/12/contrib/wpa/src/common/ocv.c
 - copied unchanged from r346591, head/contrib/wpa/src/common/ocv.c
  stable/12/contrib/wpa/src/common/ocv.h
 - copied unchanged from r346591, head/contrib/wpa/src/common/ocv.h
  stable/12/contrib/wpa/src/crypto/crypto_linux.c
 - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_linux.c
  stable/12/contrib/wpa/src/crypto/crypto_nettle.c
 - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_nettle.c
  stable/12/contrib/wpa/src/crypto/crypto_wolfssl.c
 - copied, changed from r341759, 
head/contrib/wpa/src/crypto/crypto_wolfssl.c
  stable/12/contrib/wpa/src/crypto/fips_prf_wolfssl.c
 - copied unchanged from r341759, 
head/contrib/wpa/src/crypto/fips_prf_wolfssl.c
  stable/12/contrib/wpa/src/crypto/sha384-kdf.c
 - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha384-kdf.c
  stable/12/contrib/wpa/src/crypto/sha384.c
 - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha384.c
  stable/12/contrib/wpa/src/crypto/sha512-kdf.c
 - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512-kdf.c
  stable/12/contrib/wpa/src/crypto/sha512-prf.c
 - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512-prf.c
  stable/12/contrib/wpa/src/crypto/sha512.c
 - copied unchanged from r346591, head/contrib/wpa/src/crypto/sha512.c
  stable/12/contrib/wpa/src/crypto/sha512.h
 - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512.h
  stable/12/contrib/wpa/src/crypto/tls_wolfssl.c
 - copied, changed from r341759, head/contrib/wpa/src/crypto/tls_wolfssl.c
  

Re: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs

2019-04-30 Thread Yoshihiro Ota
I looked into this more.

I started wondering if "xdev" has been obsolete after 
/usr/obj/. dir chaneg.

Both of these commands worked okay:
% make kernel-toolchain kernel TARGET_ARCH=mips KERNCONF=PB92 -C /usr/src
% make buildworld TARGET_ARCH=arm -C /usr/src

While I kept getting compile errors by:
% make xdev-build TARGET_ARCH=mips TARGET=mips -C /usr/src

In other words, if I don't run explict xdev command, buildworld and buildkernel
compile okay.

Hiro


On Wed, 24 Apr 2019 00:24:34 -0400
Yoshihiro Ota  wrote:

> Hi Ed and thank you for taking a look.
> 
> my svn info says 346593 which is after few other fixes were commited.
> 
> I'm on i386 arch.
> I haven't done installworld yet after picking up libcasper changes.
> 'make buildworld' works fine.
> 'make xdev-build' fails and I tried with both "arm" and "mips" for TARGET and 
> TARGET_ARCH.
> Both fail same way.
> Please check your /usr/include/casper/ca_fileargs.h and I suspect that's 
> where you pick up
> FA_OPEN.
> 
> I attached a log file this time.
> 
> Regards,
> Hiro
> 
> On Tue, 23 Apr 2019 09:49:00 -0400
> Ed Maste  wrote:
> 
> > On Tue, 23 Apr 2019 at 00:07, Yoshihiro Ota  wrote:
> > >
> > > It looks this change is causing 'make xdev TARGET=mips TARGET_ARCH=mips' 
> > > to fail as the
> > > following with HEAD checked out under "/usr/obj/freebsd":
> > 
> > Hello Hiro-san, sorry about that.
> > 
> > I tried `make xdev TARGET=mips TARGET_ARCH=mips` on HEAD just now (but
> > it failed on the install as DESTDIR wasn't set and I ran as non-root).
> > Just `make xdev-build` was successful though.
> > 
> > What version were you trying to build? There were (several) followup
> > commits to address issues with the initial commit of cap_fileargs
> > lstat support.
___
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: r346978 - in stable: 11/sys/amd64/vmm/intel 12/sys/amd64/vmm/intel

2019-04-30 Thread John Baldwin
Author: jhb
Date: Tue Apr 30 23:53:54 2019
New Revision: 346978
URL: https://svnweb.freebsd.org/changeset/base/346978

Log:
  MFC 344711: Fix missed posted interrupts in VT-x in bhyve.
  
  When a vCPU is HLTed, interrupts with a priority below the processor
  priority (PPR) should not resume the vCPU while interrupts at or above
  the PPR should.  With posted interrupts, bhyve maintains a bitmap of
  pending interrupts in PIR descriptor along with a single 'pending'
  bit.  This bit is checked by a CPU running in guest mode at various
  places to determine if it should be checked.  In addition, another CPU
  can force a CPU in guest mode to check for pending interrupts by
  sending an IPI to a special IDT vector reserved for this purpose.
  
  bhyve had a bug in that it would only notify a guest vCPU of an
  interrupt (e.g. by sending the special IPI or by resuming it if it was
  idle due to HLT) if an interrupt arrived that was higher priority than
  PPR and no interrupts were currently pending.  This assumed that if
  the 'pending' bit was set, any needed notification was already in
  progress.  However, if the first interrupt sent to a HLTed vCPU was
  lower priority than PPR and the second was higher than PPR, the first
  interrupt would set 'pending' but not notify the vCPU, and the second
  interrupt would not notify the vCPU because 'pending' was already set.
  To fix this, track the priority of pending interrupts in a separate
  per-vCPU bitmask and notify a vCPU anytime an interrupt arrives that
  is above PPR and higher than any previously-received interrupt.
  
  This was found and debugged in the bhyve port to SmartOS maintained by
  Joyent.  Relevant SmartOS bugs with more background:
  
  https://smartos.org/bugview/OS-6829
  https://smartos.org/bugview/OS-6930
  https://smartos.org/bugview/OS-7354

Modified:
  stable/11/sys/amd64/vmm/intel/vmx.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sys/amd64/vmm/intel/vmx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sys/amd64/vmm/intel/vmx.c
==
--- stable/11/sys/amd64/vmm/intel/vmx.c Tue Apr 30 23:01:13 2019
(r346977)
+++ stable/11/sys/amd64/vmm/intel/vmx.c Tue Apr 30 23:53:54 2019
(r346978)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 2011 NetApp, Inc.
  * All rights reserved.
+ * Copyright (c) 2018 Joyent, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -3264,8 +3265,11 @@ struct vlapic_vtx {
struct vlapic   vlapic;
struct pir_desc *pir_desc;
struct vmx  *vmx;
+   u_int   pending_prio;
 };
 
+#define VPR_PRIO_BIT(vpr)  (1 << ((vpr) >> 4))
+
 #defineVMX_CTR_PIR(vm, vcpuid, pir_desc, notify, vector, level, msg)   
\
 do {   \
VCPU_CTR2(vm, vcpuid, msg " assert %s-triggered vector %d", \
@@ -3287,7 +3291,7 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, 
struct vlapic_vtx *vlapic_vtx;
struct pir_desc *pir_desc;
uint64_t mask;
-   int idx, notify;
+   int idx, notify = 0;
 
vlapic_vtx = (struct vlapic_vtx *)vlapic;
pir_desc = vlapic_vtx->pir_desc;
@@ -3300,8 +3304,38 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, 
idx = vector / 64;
mask = 1UL << (vector % 64);
atomic_set_long(_desc->pir[idx], mask);
-   notify = atomic_cmpset_long(_desc->pending, 0, 1);
 
+   /*
+* A notification is required whenever the 'pending' bit makes a
+* transition from 0->1.
+*
+* Even if the 'pending' bit is already asserted, notification about
+* the incoming interrupt may still be necessary.  For example, if a
+* vCPU is HLTed with a high PPR, a low priority interrupt would cause
+* the 0->1 'pending' transition with a notification, but the vCPU
+* would ignore the interrupt for the time being.  The same vCPU would
+* need to then be notified if a high-priority interrupt arrived which
+* satisfied the PPR.
+*
+* The priorities of interrupts injected while 'pending' is asserted
+* are tracked in a custom bitfield 'pending_prio'.  Should the
+* to-be-injected interrupt exceed the priorities already present, the
+* notification is sent.  The priorities recorded in 'pending_prio' are
+* cleared whenever the 'pending' bit makes another 0->1 transition.
+*/
+   if (atomic_cmpset_long(_desc->pending, 0, 1) != 0) {
+   notify = 1;
+   vlapic_vtx->pending_prio = 0;
+   } else {
+   const u_int old_prio = vlapic_vtx->pending_prio;
+   const u_int prio_bit = VPR_PRIO_BIT(vector & 

svn commit: r346978 - in stable: 11/sys/amd64/vmm/intel 12/sys/amd64/vmm/intel

2019-04-30 Thread John Baldwin
Author: jhb
Date: Tue Apr 30 23:53:54 2019
New Revision: 346978
URL: https://svnweb.freebsd.org/changeset/base/346978

Log:
  MFC 344711: Fix missed posted interrupts in VT-x in bhyve.
  
  When a vCPU is HLTed, interrupts with a priority below the processor
  priority (PPR) should not resume the vCPU while interrupts at or above
  the PPR should.  With posted interrupts, bhyve maintains a bitmap of
  pending interrupts in PIR descriptor along with a single 'pending'
  bit.  This bit is checked by a CPU running in guest mode at various
  places to determine if it should be checked.  In addition, another CPU
  can force a CPU in guest mode to check for pending interrupts by
  sending an IPI to a special IDT vector reserved for this purpose.
  
  bhyve had a bug in that it would only notify a guest vCPU of an
  interrupt (e.g. by sending the special IPI or by resuming it if it was
  idle due to HLT) if an interrupt arrived that was higher priority than
  PPR and no interrupts were currently pending.  This assumed that if
  the 'pending' bit was set, any needed notification was already in
  progress.  However, if the first interrupt sent to a HLTed vCPU was
  lower priority than PPR and the second was higher than PPR, the first
  interrupt would set 'pending' but not notify the vCPU, and the second
  interrupt would not notify the vCPU because 'pending' was already set.
  To fix this, track the priority of pending interrupts in a separate
  per-vCPU bitmask and notify a vCPU anytime an interrupt arrives that
  is above PPR and higher than any previously-received interrupt.
  
  This was found and debugged in the bhyve port to SmartOS maintained by
  Joyent.  Relevant SmartOS bugs with more background:
  
  https://smartos.org/bugview/OS-6829
  https://smartos.org/bugview/OS-6930
  https://smartos.org/bugview/OS-7354

Modified:
  stable/12/sys/amd64/vmm/intel/vmx.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/amd64/vmm/intel/vmx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/sys/amd64/vmm/intel/vmx.c
==
--- stable/12/sys/amd64/vmm/intel/vmx.c Tue Apr 30 23:01:13 2019
(r346977)
+++ stable/12/sys/amd64/vmm/intel/vmx.c Tue Apr 30 23:53:54 2019
(r346978)
@@ -3,6 +3,7 @@
  *
  * Copyright (c) 2011 NetApp, Inc.
  * All rights reserved.
+ * Copyright (c) 2018 Joyent, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -3402,8 +3403,11 @@ struct vlapic_vtx {
struct vlapic   vlapic;
struct pir_desc *pir_desc;
struct vmx  *vmx;
+   u_int   pending_prio;
 };
 
+#define VPR_PRIO_BIT(vpr)  (1 << ((vpr) >> 4))
+
 #defineVMX_CTR_PIR(vm, vcpuid, pir_desc, notify, vector, level, msg)   
\
 do {   \
VCPU_CTR2(vm, vcpuid, msg " assert %s-triggered vector %d", \
@@ -3425,7 +3429,7 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, 
struct vlapic_vtx *vlapic_vtx;
struct pir_desc *pir_desc;
uint64_t mask;
-   int idx, notify;
+   int idx, notify = 0;
 
vlapic_vtx = (struct vlapic_vtx *)vlapic;
pir_desc = vlapic_vtx->pir_desc;
@@ -3438,8 +3442,38 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, 
idx = vector / 64;
mask = 1UL << (vector % 64);
atomic_set_long(_desc->pir[idx], mask);
-   notify = atomic_cmpset_long(_desc->pending, 0, 1);
 
+   /*
+* A notification is required whenever the 'pending' bit makes a
+* transition from 0->1.
+*
+* Even if the 'pending' bit is already asserted, notification about
+* the incoming interrupt may still be necessary.  For example, if a
+* vCPU is HLTed with a high PPR, a low priority interrupt would cause
+* the 0->1 'pending' transition with a notification, but the vCPU
+* would ignore the interrupt for the time being.  The same vCPU would
+* need to then be notified if a high-priority interrupt arrived which
+* satisfied the PPR.
+*
+* The priorities of interrupts injected while 'pending' is asserted
+* are tracked in a custom bitfield 'pending_prio'.  Should the
+* to-be-injected interrupt exceed the priorities already present, the
+* notification is sent.  The priorities recorded in 'pending_prio' are
+* cleared whenever the 'pending' bit makes another 0->1 transition.
+*/
+   if (atomic_cmpset_long(_desc->pending, 0, 1) != 0) {
+   notify = 1;
+   vlapic_vtx->pending_prio = 0;
+   } else {
+   const u_int old_prio = vlapic_vtx->pending_prio;
+   const u_int prio_bit = VPR_PRIO_BIT(vector & 

svn commit: r346977 - in stable/12/lib/libsecureboot: . h

2019-04-30 Thread Simon J. Gerraty
Author: sjg
Date: Tue Apr 30 23:01:13 2019
New Revision: 346977
URL: https://svnweb.freebsd.org/changeset/base/346977

Log:
  Allow no_hash to appear in manifest.
  
  sbin/veriexec will ignore entries that have no hash anyway,
  but loader needs to be explicitly told that such files are
  ok to ignore (not verify).
  
  We will report as Unverified depending on verbose level,
  but with no reason - because we are not rejecting the file.
  
  MFC r346604

Modified:
  stable/12/lib/libsecureboot/h/libsecureboot.h
  stable/12/lib/libsecureboot/vectx.c
  stable/12/lib/libsecureboot/veopen.c
  stable/12/lib/libsecureboot/verify_file.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libsecureboot/h/libsecureboot.h
==
--- stable/12/lib/libsecureboot/h/libsecureboot.h   Tue Apr 30 21:38:38 
2019(r346976)
+++ stable/12/lib/libsecureboot/h/libsecureboot.h   Tue Apr 30 23:01:13 
2019(r346977)
@@ -86,6 +86,7 @@ ssize_t ve_pcr_get(unsigned char *, size_t);
 #define VEF_VERBOSE1
 
 #define VE_FINGERPRINT_OK  1
+#define VE_FINGERPRINT_IGNORE  2
 /* errors from verify_fd */
 #define VE_FINGERPRINT_NONE-2
 #define VE_FINGERPRINT_WRONG   -3

Modified: stable/12/lib/libsecureboot/vectx.c
==
--- stable/12/lib/libsecureboot/vectx.c Tue Apr 30 21:38:38 2019
(r346976)
+++ stable/12/lib/libsecureboot/vectx.c Tue Apr 30 23:01:13 2019
(r346977)
@@ -120,7 +120,10 @@ vectx_open(int fd, const char *path, off_t off, struct
ctx->vec_status = VE_FINGERPRINT_NONE;
ve_error_set("%s: no entry", path);
} else {
-   if (strncmp(cp, "sha256=", 7) == 0) {
+   if (strncmp(cp, "no_hash", 7) == 0) {
+   ctx->vec_status = VE_FINGERPRINT_IGNORE;
+   hashsz = 0;
+   } else if (strncmp(cp, "sha256=", 7) == 0) {
ctx->vec_md = _sha256_vtable;
hashsz = br_sha256_SIZE;
cp += 7;
@@ -150,11 +153,13 @@ vectx_open(int fd, const char *path, off_t off, struct
*error = ctx->vec_status;
ctx->vec_hashsz = hashsz;
ctx->vec_want = cp;
-   ctx->vec_md->init(>vec_ctx.vtable);
+   if (hashsz > 0) {
+   ctx->vec_md->init(>vec_ctx.vtable);
 
-   if (hashsz > 0 && off > 0) {
-   lseek(fd, 0, SEEK_SET);
-   vectx_lseek(ctx, off, SEEK_SET);
+   if (off > 0) {
+   lseek(fd, 0, SEEK_SET);
+   vectx_lseek(ctx, off, SEEK_SET);
+   }
}
return (ctx);
 

Modified: stable/12/lib/libsecureboot/veopen.c
==
--- stable/12/lib/libsecureboot/veopen.cTue Apr 30 21:38:38 2019
(r346976)
+++ stable/12/lib/libsecureboot/veopen.cTue Apr 30 23:01:13 2019
(r346977)
@@ -345,7 +345,9 @@ verify_fingerprint(int fd, const char *path, const cha
size_t hlen;
int n;
 
-   if (strncmp(cp, "sha256=", 7) == 0) {
+   if (strncmp(cp, "no_hash", 7) == 0) {
+   return (VE_FINGERPRINT_IGNORE);
+   } else if (strncmp(cp, "sha256=", 7) == 0) {
md = _sha256_vtable;
hlen = br_sha256_SIZE;
cp += 7;
@@ -423,6 +425,7 @@ verify_fd(int fd, const char *path, off_t off, struct 
rc = verify_fingerprint(fd, path, cp, off);
switch (rc) {
case VE_FINGERPRINT_OK:
+   case VE_FINGERPRINT_IGNORE:
case VE_FINGERPRINT_UNKNOWN:
return (rc);
default:

Modified: stable/12/lib/libsecureboot/verify_file.c
==
--- stable/12/lib/libsecureboot/verify_file.c   Tue Apr 30 21:38:38 2019
(r346976)
+++ stable/12/lib/libsecureboot/verify_file.c   Tue Apr 30 23:01:13 2019
(r346977)
@@ -343,10 +343,14 @@ verify_file(int fd, const char *filename, off_t off, i
if ((rc = verify_fd(fd, filename, off, )) >= 0) {
if (verbose || severity > VE_WANT) {
 #if defined(VE_DEBUG_LEVEL) && VE_DEBUG_LEVEL > 0
-   printf("Verified %s %llu,%llu\n", filename,
+   printf("%serified %s %llu,%llu\n",
+   (rc == VE_FINGERPRINT_IGNORE) ? "Unv" : "V",
+   filename,
(long long)st.st_dev, (long long)st.st_ino);
 #else
-   printf("Verified %s\n", filename);
+   printf("%serified %s\n",
+   (rc == VE_FINGERPRINT_IGNORE) ? "Unv" : "V",
+   filename);
 

svn commit: r346976 - head/usr.sbin/mountd

2019-04-30 Thread Alexander Motin
Author: mav
Date: Tue Apr 30 21:38:38 2019
New Revision: 346976
URL: https://svnweb.freebsd.org/changeset/base/346976

Log:
  Respect quotes and escapes when splitting exports fields.
  
  Without this r293305 was still unable to handle names with spaces.
  
  MFC after:1 week
  Sponsored by: iXsystems, Inc.

Modified:
  head/usr.sbin/mountd/mountd.c

Modified: head/usr.sbin/mountd/mountd.c
==
--- head/usr.sbin/mountd/mountd.c   Tue Apr 30 21:27:32 2019
(r346975)
+++ head/usr.sbin/mountd/mountd.c   Tue Apr 30 21:38:38 2019
(r346976)
@@ -2824,18 +2824,27 @@ static void
 nextfield(char **cp, char **endcp)
 {
char *p;
+   char quot = 0;
 
p = *cp;
while (*p == ' ' || *p == '\t')
p++;
-   if (*p == '\n' || *p == '\0')
-   *cp = *endcp = p;
-   else {
-   *cp = p++;
-   while (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\0')
-   p++;
-   *endcp = p;
-   }
+   *cp = p;
+   while (*p != '\0') {
+   if (quot) {
+   if (*p == quot)
+   quot = 0;
+   } else {
+   if (*p == '\\' && *(p + 1) != '\0')
+   p++;
+   else if (*p == '\'' || *p == '"')
+   quot = *p;
+   else if (*p == ' ' || *p == '\t')
+   break;
+   }
+   p++;
+   };
+   *endcp = p;
 }
 
 /*
@@ -2907,8 +2916,8 @@ parsecred(char *namelist, struct xucred *cr)
/*
 * Get the user's password table entry.
 */
-   names = strsep_quote(, " \t\n");
-   name = strsep(, ":");
+   names = namelist;
+   name = strsep_quote(, ":");
/* Bug?  name could be NULL here */
if (isdigit(*name) || *name == '-')
pw = getpwuid(atoi(name));
@@ -2952,7 +2961,7 @@ parsecred(char *namelist, struct xucred *cr)
}
cr->cr_ngroups = 0;
while (names != NULL && *names != '\0' && cr->cr_ngroups < XU_NGROUPS) {
-   name = strsep(, ":");
+   name = strsep_quote(, ":");
if (isdigit(*name) || *name == '-') {
cr->cr_groups[cr->cr_ngroups++] = atoi(name);
} else {
___
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: r346975 - stable/12/sys/dev/cxgbe

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 21:27:32 2019
New Revision: 346975
URL: https://svnweb.freebsd.org/changeset/base/346975

Log:
  MFC r346567:
  
  cxgbe(4): Make sure bundled_fw is always initialized before use.
  
  This fixes a bug that prevented the driver from auto-flashing the
  firmware when it didn't see one on the card.  This feature was
  introduced in r321390 and this bug was introduced in r343269.
  
  Reported by:  gallatin@
  Sponsored by: Chelsio Communications

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

Modified: stable/12/sys/dev/cxgbe/t4_main.c
==
--- stable/12/sys/dev/cxgbe/t4_main.c   Tue Apr 30 21:24:44 2019
(r346974)
+++ stable/12/sys/dev/cxgbe/t4_main.c   Tue Apr 30 21:27:32 2019
(r346975)
@@ -3529,19 +3529,6 @@ install_kld_firmware(struct adapter *sc, struct fw_h *
load_attempted = false;
fw_install = t4_fw_install < 0 ? -t4_fw_install : t4_fw_install;
 
-   if (reason != NULL)
-   goto install;
-
-   if ((sc->flags & FW_OK) == 0) {
-
-   if (c == 0x) {
-   reason = "missing";
-   goto install;
-   }
-
-   return (0);
-   }
-
memcpy(_fw, drv_fw, sizeof(bundled_fw));
if (t4_fw_install < 0) {
rc = load_fw_module(sc, , );
@@ -3557,6 +3544,20 @@ install_kld_firmware(struct adapter *sc, struct fw_h *
load_attempted = true;
}
d = be32toh(bundled_fw.fw_ver);
+
+   if (reason != NULL)
+   goto install;
+
+   if ((sc->flags & FW_OK) == 0) {
+
+   if (c == 0x) {
+   reason = "missing";
+   goto install;
+   }
+
+   rc = 0;
+   goto done;
+   }
 
if (!fw_compatible(card_fw, _fw)) {
reason = "incompatible or unusable";
___
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: r346974 - stable/12/sys/dev/cxgbe

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 21:24:44 2019
New Revision: 346974
URL: https://svnweb.freebsd.org/changeset/base/346974

Log:
  MFC r340375 (by jch@):
  
  cxgbe/netmap: Fix cxgbe netmap when interface is DOWN
  
  A kernel panic can occur if the cxgbe interface is DOWN
  when activating netmap. This patch prevents the driver
  from freeing up cxgbe netmap resources when they have not
  been allocated.
  
  Submitted by: Nicolas Witkowski 
  Reviewed by:  np
  Sponsored by: Verisign, Inc.
  Differential Revision:https://reviews.freebsd.org/D17802

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

Modified: stable/12/sys/dev/cxgbe/t4_netmap.c
==
--- stable/12/sys/dev/cxgbe/t4_netmap.c Tue Apr 30 18:48:20 2019
(r346973)
+++ stable/12/sys/dev/cxgbe/t4_netmap.c Tue Apr 30 21:24:44 2019
(r346974)
@@ -492,6 +492,9 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v
 
ASSERT_SYNCHRONIZED_OP(sc);
 
+   if (!nm_netmap_on(na))
+   return (0);
+
if ((vi->flags & VI_INIT_DONE) == 0)
return (0);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r346973 - head/stand/i386/gptboot

2019-04-30 Thread Ian Lepore
Author: ian
Date: Tue Apr 30 18:48:20 2019
New Revision: 346973
URL: https://svnweb.freebsd.org/changeset/base/346973

Log:
  Add a paragraph that mentions gptboot having an interactive mode, and
  direct the user to the boot(8) manpage, which provides the details on that.

Modified:
  head/stand/i386/gptboot/gptboot.8

Modified: head/stand/i386/gptboot/gptboot.8
==
--- head/stand/i386/gptboot/gptboot.8   Tue Apr 30 18:42:42 2019
(r346972)
+++ head/stand/i386/gptboot/gptboot.8   Tue Apr 30 18:48:20 2019
(r346973)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 5, 2014
+.Dd April 30, 2019
 .Dt GPTBOOT 8
 .Os
 .Sh NAME
@@ -39,6 +39,20 @@ is installed in a
 .Cm freebsd-boot
 partition with
 .Xr gpart 8 .
+.Pp
+When it starts,
+.Nm
+first reads the GPT and determines which drive and partition to
+boot from, as described under
+.Sx BOOTING ,
+below.
+If it does not find an eligible partition, or if the user hits a
+key within three seconds,
+.Nm
+switches from auto-boot to interactive mode.
+Interactive mode allows manual selection of the disk, partition,
+filename, and boot option flags, as described in
+.Xr boot 8 .
 .Sh IMPLEMENTATION NOTES
 The GPT standard allows a variable number of partitions, but
 .Nm
___
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: r346972 - stable/11/sys/netinet6

2019-04-30 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 30 18:42:42 2019
New Revision: 346972
URL: https://svnweb.freebsd.org/changeset/base/346972

Log:
  MFC r346596:
  ipoib: assign link-local address according to RFC.

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

Modified: stable/11/sys/netinet6/in6_ifattach.c
==
--- stable/11/sys/netinet6/in6_ifattach.c   Tue Apr 30 18:36:56 2019
(r346971)
+++ stable/11/sys/netinet6/in6_ifattach.c   Tue Apr 30 18:42:42 2019
(r346972)
@@ -348,6 +348,14 @@ found:
IF_ADDR_RUNLOCK(ifp);
return -1;
 
+   case IFT_INFINIBAND:
+   if (addrlen != 20) {
+   IF_ADDR_RUNLOCK(ifp);
+   return -1;
+   }
+   bcopy(addr + 12, >s6_addr[8], 8);
+   break;
+
default:
IF_ADDR_RUNLOCK(ifp);
return -1;
___
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: r346971 - stable/12/sys/netinet6

2019-04-30 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 30 18:36:56 2019
New Revision: 346971
URL: https://svnweb.freebsd.org/changeset/base/346971

Log:
  MFC r346596:
  ipoib: assign link-local address according to RFC.

Modified:
  stable/12/sys/netinet6/in6_ifattach.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet6/in6_ifattach.c
==
--- stable/12/sys/netinet6/in6_ifattach.c   Tue Apr 30 18:03:17 2019
(r346970)
+++ stable/12/sys/netinet6/in6_ifattach.c   Tue Apr 30 18:36:56 2019
(r346971)
@@ -327,6 +327,14 @@ found:
IF_ADDR_RUNLOCK(ifp);
return -1;
 
+   case IFT_INFINIBAND:
+   if (addrlen != 20) {
+   IF_ADDR_RUNLOCK(ifp);
+   return -1;
+   }
+   bcopy(addr + 12, >s6_addr[8], 8);
+   break;
+
default:
IF_ADDR_RUNLOCK(ifp);
return -1;
___
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: r346970 - stable/11/sys/dev/cxgbe/tom

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 18:03:17 2019
New Revision: 346970
URL: https://svnweb.freebsd.org/changeset/base/346970

Log:
  MFC r342208:
  
  cxgbe/t4_tom: fixes for issues on the passive open side.
  
  - Fix PR 227760 by getting the TOE to respond to the SYN after the call
to toe_syncache_add, not during it.  The kernel syncache code calls
syncache_respond just before syncache_insert.  If the ACK to the
syncache_respond is processed in another thread it may run before the
syncache_insert and won't find the entry.  Note that this affects only
t4_tom because it's the only driver trying to insert and expand
syncache entries from different threads.
  
  - Do not leak resources if an embryonic connection terminates at
SYN_RCVD because of L2 lookup failures.
  
  - Retire lctx->synq and associated code because there is never a need to
walk the list of embryonic connections associated with a listener.
The per-tid state is still called a synq entry in the driver even
though the synq itself is now gone.
  
  PR:   227760
  Sponsored by: Chelsio Communications

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

Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c
==
--- stable/11/sys/dev/cxgbe/tom/t4_connect.cTue Apr 30 17:45:22 2019
(r346969)
+++ stable/11/sys/dev/cxgbe/tom/t4_connect.cTue Apr 30 18:03:17 2019
(r346970)
@@ -97,7 +97,8 @@ do_act_establish(struct sge_iq *iq, const struct rss_h
goto done;
}
 
-   make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt);
+   make_established(toep, be32toh(cpl->snd_isn) - 1,
+   be32toh(cpl->rcv_isn) - 1, cpl->tcp_opt);
 
if (toep->ulp_mode == ULP_MODE_TLS)
tls_establish(toep);

Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Apr 30 17:45:22 2019
(r346969)
+++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Apr 30 18:03:17 2019
(r346970)
@@ -383,18 +383,15 @@ assign_rxopt(struct tcpcb *tp, unsigned int opt)
  * Completes some final bits of initialization for just established connections
  * and changes their state to TCPS_ESTABLISHED.
  *
- * The ISNs are from after the exchange of SYNs.  i.e., the true ISN + 1.
+ * The ISNs are from the exchange of SYNs.
  */
 void
-make_established(struct toepcb *toep, uint32_t snd_isn, uint32_t rcv_isn,
-uint16_t opt)
+make_established(struct toepcb *toep, uint32_t iss, uint32_t irs, uint16_t opt)
 {
struct inpcb *inp = toep->inp;
struct socket *so = inp->inp_socket;
struct tcpcb *tp = intotcpcb(inp);
long bufsize;
-   uint32_t iss = be32toh(snd_isn) - 1;/* true ISS */
-   uint32_t irs = be32toh(rcv_isn) - 1;/* true IRS */
uint16_t tcpopt = be16toh(opt);
struct flowc_tx_params ftxp;
 
@@ -1254,22 +1251,12 @@ do_peer_close(struct sge_iq *iq, const struct rss_head
KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__));
 
if (__predict_false(toep->flags & TPF_SYNQE)) {
-#ifdef INVARIANTS
-   struct synq_entry *synqe = (void *)toep;
-
-   INP_WLOCK(synqe->lctx->inp);
-   if (synqe->flags & TPF_SYNQE_HAS_L2TE) {
-   KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN,
-   ("%s: listen socket closed but tid %u not aborted.",
-   __func__, tid));
-   } else {
-   /*
-* do_pass_accept_req is still running and will
-* eventually take care of this tid.
-*/
-   }
-   INP_WUNLOCK(synqe->lctx->inp);
-#endif
+   /*
+* do_pass_establish must have run before do_peer_close and if
+* this is still a synqe instead of a toepcb then the connection
+* must be getting aborted.
+*/
+   MPASS(toep->flags & TPF_ABORT_SHUTDOWN);
CTR4(KTR_CXGBE, "%s: tid %u, synqe %p (0x%x)", __func__, tid,
toep, toep->flags);
return (0);
@@ -1574,22 +1561,12 @@ do_rx_data(struct sge_iq *iq, const struct rss_header 
uint32_t ddp_placed = 0;
 
if (__predict_false(toep->flags & TPF_SYNQE)) {
-#ifdef INVARIANTS
-   struct synq_entry *synqe = (void *)toep;
-
-   INP_WLOCK(synqe->lctx->inp);
-   if (synqe->flags & TPF_SYNQE_HAS_L2TE) {
-   KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN,
-   

Re: svn commit: r346959 - in head/release: . tools

2019-04-30 Thread Conrad Meyer
Thanks, Glen!

On Tue, Apr 30, 2019 at 7:29 AM Glen Barber  wrote:
>
> Author: gjb
> Date: Tue Apr 30 14:29:09 2019
> New Revision: 346959
> URL: https://svnweb.freebsd.org/changeset/base/346959
>
> Log:
>   Reduce the default image size for virtual machine disk images from
>   30GB to 3GB.  The raw images can be resized using truncate(1), and
>   other formats can be resized with tools included with other tools
>   included with other hypervisors.
>
>   Enable the growfs(8) rc(8) at firstboot if the disk was resized
>   prior to booting the virtual machine for the first time.
>
>   Discussed with:   several
>   PR:   232313 (requested in other context)
>   MFC after:3 days
>   Sponsored by: The FreeBSD Foundation
___
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: r346969 - head/stand/i386/zfsboot

2019-04-30 Thread Toomas Soome
Author: tsoome
Date: Tue Apr 30 17:45:22 2019
New Revision: 346969
URL: https://svnweb.freebsd.org/changeset/base/346969

Log:
  zfsboot: to detect disk size, use GPT information first
  
  If we do have GPT on disk, read the disk size from it and do not
  call int13.
  
  Since int13 does report bogus informatiopn too often, rather trust the
  partition table. We are using the same strategy with loader.
  
  MFC after:1 month

Modified:
  head/stand/i386/zfsboot/zfsboot.c

Modified: head/stand/i386/zfsboot/zfsboot.c
==
--- head/stand/i386/zfsboot/zfsboot.c   Tue Apr 30 17:42:05 2019
(r346968)
+++ head/stand/i386/zfsboot/zfsboot.c   Tue Apr 30 17:45:22 2019
(r346969)
@@ -460,6 +460,33 @@ copy_dsk(struct zfsdsk *zdsk)
 }
 
 /*
+ * Get disk size from GPT.
+ */
+static uint64_t
+drvsize_gpt(struct dsk *dskp)
+{
+#ifdef GPT
+   struct gpt_hdr hdr;
+   char *sec;
+
+   sec = dmadat->secbuf;
+   if (drvread(dskp, sec, 1, 1))
+   return (0);
+
+   memcpy(, sec, sizeof(hdr));
+   if (memcmp(hdr.hdr_sig, GPT_HDR_SIG, sizeof(hdr.hdr_sig)) != 0 ||
+   hdr.hdr_lba_self != 1 || hdr.hdr_revision < 0x0001 ||
+   hdr.hdr_entsz < sizeof(struct gpt_ent) ||
+   DEV_BSIZE % hdr.hdr_entsz != 0) {
+   return (0);
+   }
+   return (hdr.hdr_lba_alt + 1);
+#else
+   return (0);
+#endif
+}
+
+/*
  * Get disk size from eax=0x800 and 0x4800. We need to probe both
  * because 0x4800 may not be available and we would like to get more
  * or less correct disk size - if it is possible at all.
@@ -474,6 +501,11 @@ drvsize_ext(struct zfsdsk *zdsk)
int cyl, hds, sec;
 
dskp = >dsk;
+
+   /* Try to read disk size from GPT */
+   size = drvsize_gpt(dskp);
+   if (size != 0)
+   return (size);
 
v86.ctl = V86_FLAGS;
v86.addr = 0x13;
___
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: r346968 - head/sbin/reboot

2019-04-30 Thread Ian Lepore
Author: ian
Date: Tue Apr 30 17:42:05 2019
New Revision: 346968
URL: https://svnweb.freebsd.org/changeset/base/346968

Log:
  Update the manpage text to show the output generated by the first-stage
  bootloader these days (x86 instead of i386).

Modified:
  head/sbin/reboot/boot_i386.8

Modified: head/sbin/reboot/boot_i386.8
==
--- head/sbin/reboot/boot_i386.8Tue Apr 30 17:30:37 2019
(r346967)
+++ head/sbin/reboot/boot_i386.8Tue Apr 30 17:42:05 2019
(r346968)
@@ -36,7 +36,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 15, 2018
+.Dd April 30, 2019
 .Dt BOOT 8 i386
 .Os
 .Sh NAME
@@ -95,7 +95,7 @@ program is documented separately.
 After the boot blocks have been loaded,
 you should see a prompt similar to the following:
 .Bd -literal
->> FreeBSD/i386 BOOT
+>> FreeBSD/x86 BOOT
 Default: 0:ad(0,a)/boot/loader
 boot:
 .Ed
___
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: r346967 - in stable/11/sys/dev/cxgbe: . common firmware tom

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 17:30:37 2019
New Revision: 346967
URL: https://svnweb.freebsd.org/changeset/base/346967

Log:
  MFC r345334:
  
  cxgbe(4): Treat the viid as an opaque identifier.
  
  Recent firmwares prefer to use a different format for viid internally
  and this change allows them to do so.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/11/sys/dev/cxgbe/adapter.h
  stable/11/sys/dev/cxgbe/common/common.h
  stable/11/sys/dev/cxgbe/common/t4_hw.c
  stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h
  stable/11/sys/dev/cxgbe/t4_main.c
  stable/11/sys/dev/cxgbe/t4_sge.c
  stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c
  stable/11/sys/dev/cxgbe/tom/t4_listen.c
  stable/11/sys/dev/cxgbe/tom/t4_tom.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/cxgbe/adapter.h
==
--- stable/11/sys/dev/cxgbe/adapter.h   Tue Apr 30 17:20:38 2019
(r346966)
+++ stable/11/sys/dev/cxgbe/adapter.h   Tue Apr 30 17:30:37 2019
(r346967)
@@ -192,8 +192,10 @@ struct vi_info {
int if_flags;
 
uint16_t *rss, *nm_rss;
-   int smt_idx;/* for convenience */
-   uint16_t viid;
+   uint16_t viid;  /* opaque VI identifier */
+   uint16_t smt_idx;
+   uint16_t vin;
+   uint8_t vfvld;
int16_t  xact_addr_filt;/* index of exact MAC address filter */
uint16_t rss_size;  /* size of VI's RSS table slice */
uint16_t rss_base;  /* start of VI's RSS table slice */

Modified: stable/11/sys/dev/cxgbe/common/common.h
==
--- stable/11/sys/dev/cxgbe/common/common.h Tue Apr 30 17:20:38 2019
(r346966)
+++ stable/11/sys/dev/cxgbe/common/common.h Tue Apr 30 17:30:37 2019
(r346967)
@@ -373,8 +373,9 @@ struct adapter_params {
 
uint32_t mps_bg_map;/* rx buffer group map for all ports (upto 4) */
 
-   bool ulptx_memwrite_dsgl;/* use of T5 DSGL allowed */
-   bool fr_nsmr_tpte_wr_support;/* FW support for FR_NSMR_TPTE_WR */
+   bool ulptx_memwrite_dsgl;   /* use of T5 DSGL allowed */
+   bool fr_nsmr_tpte_wr_support;   /* FW support for FR_NSMR_TPTE_WR */
+   bool viid_smt_extn_support; /* FW returns vin, vfvld & smt index? */
 };
 
 #define CHELSIO_T4 0x4
@@ -754,10 +755,11 @@ int t4_cfg_pfvf(struct adapter *adap, unsigned int mbo
 int t4_alloc_vi_func(struct adapter *adap, unsigned int mbox,
 unsigned int port, unsigned int pf, unsigned int vf,
 unsigned int nmac, u8 *mac, u16 *rss_size,
+uint8_t *vfvld, uint16_t *vin,
 unsigned int portfunc, unsigned int idstype);
 int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port,
unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac,
-   u16 *rss_size);
+   u16 *rss_size, uint8_t *vfvld, uint16_t *vin);
 int t4_free_vi(struct adapter *adap, unsigned int mbox,
   unsigned int pf, unsigned int vf,
   unsigned int viid);
@@ -768,7 +770,7 @@ int t4_alloc_mac_filt(struct adapter *adap, unsigned i
  bool free, unsigned int naddr, const u8 **addr, u16 *idx,
  u64 *hash, bool sleep_ok);
 int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid,
- int idx, const u8 *addr, bool persist, bool add_smt);
+ int idx, const u8 *addr, bool persist, uint16_t *smt_idx);
 int t4_set_addr_hash(struct adapter *adap, unsigned int mbox, unsigned int 
viid,
 bool ucast, u64 vec, bool sleep_ok);
 int t4_enable_vi_params(struct adapter *adap, unsigned int mbox,

Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c
==
--- stable/11/sys/dev/cxgbe/common/t4_hw.c  Tue Apr 30 17:20:38 2019
(r346966)
+++ stable/11/sys/dev/cxgbe/common/t4_hw.c  Tue Apr 30 17:30:37 2019
(r346967)
@@ -7827,6 +7827,7 @@ int t4_cfg_pfvf(struct adapter *adap, unsigned int mbo
 int t4_alloc_vi_func(struct adapter *adap, unsigned int mbox,
 unsigned int port, unsigned int pf, unsigned int vf,
 unsigned int nmac, u8 *mac, u16 *rss_size,
+uint8_t *vfvld, uint16_t *vin,
 unsigned int portfunc, unsigned int idstype)
 {
int ret;
@@ -7847,6 +7848,7 @@ int t4_alloc_vi_func(struct adapter *adap, unsigned in
ret = t4_wr_mbox(adap, mbox, , sizeof(c), );
if (ret)
return ret;
+   ret = G_FW_VI_CMD_VIID(be16_to_cpu(c.type_to_viid));
 
if (mac) {
memcpy(mac, c.mac, sizeof(c.mac));
@@ -7863,7 +7865,18 @@ int t4_alloc_vi_func(struct adapter *adap, unsigned in
}
if 

svn commit: r346966 - stable/11/sys/dev/cxgbe

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 17:20:38 2019
New Revision: 346966
URL: https://svnweb.freebsd.org/changeset/base/346966

Log:
  MFC r344654:
  
  cxgbe(4): Request high priority filter support explicitly, as required
  by recent firmwares.
  
  Sponsored by: Chelsio Communications

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

Modified: stable/11/sys/dev/cxgbe/t4_main.c
==
--- stable/11/sys/dev/cxgbe/t4_main.c   Tue Apr 30 17:18:05 2019
(r346965)
+++ stable/11/sys/dev/cxgbe/t4_main.c   Tue Apr 30 17:20:38 2019
(r346966)
@@ -603,6 +603,7 @@ static int cfg_itype_and_nqueues(struct adapter *, str
 static int contact_firmware(struct adapter *);
 static int partition_resources(struct adapter *);
 static int get_params__pre_init(struct adapter *);
+static int set_params__pre_init(struct adapter *);
 static int get_params__post_init(struct adapter *);
 static int set_params__post_init(struct adapter *);
 static void t4_set_desc(struct adapter *);
@@ -3914,6 +3915,7 @@ apply_cfg_and_initialize(struct adapter *sc, char *cfg
}
 
t4_tweak_chip_settings(sc);
+   set_params__pre_init(sc);
 
/* get basic stuff going */
rc = -t4_fw_initialize(sc, sc->mbox);
@@ -4036,6 +4038,35 @@ get_params__pre_init(struct adapter *sc)
 }
 
 /*
+ * Any params that need to be set before FW_INITIALIZE.
+ */
+static int
+set_params__pre_init(struct adapter *sc)
+{
+   int rc = 0;
+   uint32_t param, val;
+
+   if (chip_id(sc) >= CHELSIO_T6) {
+   param = FW_PARAM_DEV(HPFILTER_REGION_SUPPORT);
+   val = 1;
+   rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, , );
+   /* firmwares < 1.20.1.0 do not have this param. */
+   if (rc == FW_EINVAL && sc->params.fw_vers <
+   (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) |
+   V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) {
+   rc = 0;
+   }
+   if (rc != 0) {
+   device_printf(sc->dev,
+   "failed to enable high priority filters :%d.\n",
+   rc);
+   }
+   }
+
+   return (rc);
+}
+
+/*
  * Retrieve various parameters that are of interest to the driver.  The device
  * has been initialized by the firmware at this point.
  */
@@ -4077,20 +4108,6 @@ get_params__post_init(struct adapter *sc)
sc->params.core_vdd = val[6];
 
if (chip_id(sc) >= CHELSIO_T6) {
-
-#ifdef INVARIANTS
-   if (sc->params.fw_vers >=
-   (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) |
-   V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) {
-   /*
-* Note that the code to enable the region should run
-* before t4_fw_initialize and not here.  This is just a
-* reminder to add said code.
-*/
-   device_printf(sc->dev,
-   "hpfilter region not enabled.\n");
-   }
-#endif
 
sc->tids.tid_base = t4_read_reg(sc,
A_LE_DB_ACTIVE_TABLE_START_INDEX);
___
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: r346965 - head/sys/compat/linux

2019-04-30 Thread Dmitry Chagin
Author: dchagin
Date: Tue Apr 30 17:18:05 2019
New Revision: 346965
URL: https://svnweb.freebsd.org/changeset/base/346965

Log:
  Follow the FreeBSD and implement PDEATH_SIG prctl ops in the Linuxulator.
  It was first introduced in r163734 and missied by me in r283383.
  
  MFC after:1 week

Modified:
  head/sys/compat/linux/linux_emul.c
  head/sys/compat/linux/linux_emul.h
  head/sys/compat/linux/linux_misc.c

Modified: head/sys/compat/linux/linux_emul.c
==
--- head/sys/compat/linux/linux_emul.c  Tue Apr 30 16:52:50 2019
(r346964)
+++ head/sys/compat/linux/linux_emul.c  Tue Apr 30 17:18:05 2019
(r346965)
@@ -127,7 +127,6 @@ linux_proc_init(struct thread *td, struct thread *newt
 
em->em_tid = p->p_pid;
em->flags = 0;
-   em->pdeath_signal = 0;
em->robust_futexes = NULL;
em->child_clear_tid = NULL;
em->child_set_tid = NULL;

Modified: head/sys/compat/linux/linux_emul.h
==
--- head/sys/compat/linux/linux_emul.h  Tue Apr 30 16:52:50 2019
(r346964)
+++ head/sys/compat/linux/linux_emul.h  Tue Apr 30 17:18:05 2019
(r346965)
@@ -40,7 +40,6 @@ struct linux_emuldata {
int*child_set_tid;  /* in clone(): Child's TID to set on clone */
int*child_clear_tid;/* in clone(): Child's TID to clear on exit */
 
-   int pdeath_signal;  /* parent death signal */
int flags;  /* thread emuldata flags */
int em_tid; /* thread id */
 

Modified: head/sys/compat/linux/linux_misc.c
==
--- head/sys/compat/linux/linux_misc.c  Tue Apr 30 16:52:50 2019
(r346964)
+++ head/sys/compat/linux/linux_misc.c  Tue Apr 30 17:18:05 2019
(r346965)
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1993,7 +1994,6 @@ linux_prctl(struct thread *td, struct linux_prctl_args
int error = 0, max_size;
struct proc *p = td->td_proc;
char comm[LINUX_MAX_COMM_LEN];
-   struct linux_emuldata *em;
int pdeath_signal;
 
 #ifdef DEBUG
@@ -2007,17 +2007,18 @@ linux_prctl(struct thread *td, struct linux_prctl_args
case LINUX_PR_SET_PDEATHSIG:
if (!LINUX_SIG_VALID(args->arg2))
return (EINVAL);
-   em = em_find(td);
-   KASSERT(em != NULL, ("prctl: emuldata not found.\n"));
-   em->pdeath_signal = args->arg2;
-   break;
+   pdeath_signal = linux_to_bsd_signal(args->arg2);
+   return (kern_procctl(td, P_PID, 0, PROC_PDEATHSIG_CTL,
+   _signal));
case LINUX_PR_GET_PDEATHSIG:
-   em = em_find(td);
-   KASSERT(em != NULL, ("prctl: emuldata not found.\n"));
-   pdeath_signal = em->pdeath_signal;
-   error = copyout(_signal,
+   error = kern_procctl(td, P_PID, 0, PROC_PDEATHSIG_STATUS,
+   _signal);
+   if (error != 0)
+   return (error);
+   pdeath_signal = bsd_to_linux_signal(pdeath_signal);
+   return (copyout(_signal,
(void *)(register_t)args->arg2,
-   sizeof(pdeath_signal));
+   sizeof(pdeath_signal)));
break;
case LINUX_PR_GET_KEEPCAPS:
/*
___
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: r346964 - in stable/11/sys/dev/cxgbe: . common

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 16:52:50 2019
New Revision: 346964
URL: https://svnweb.freebsd.org/changeset/base/346964

Log:
  MFC r343889, r344519, r344682, r344719
  
  r343889:
  cxgbev(4): Initialize debug_flags from the environment like in the PF driver.
  
  r344519:
  cxgbe(4): Use correct port_info in the call to is_bt().
  
  This fixes a panic during configuration if the tx channel of a port
  isn't the same as its port id.
  
  Reported by:  Fabrice Bruel
  Sponsored by: Chelsio Communications
  
  r344682:
  cxgbe(4): Don't forget to report link state to the kernel if the link is
  already up at attach.
  
  Reported by:  Fabrice Bruel @ Orange Business Service
  Sponsored by: Chelsio Communications
  
  r344719:
  cxgbev(4): Enable 32b port capabilities in the VF driver.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/11/sys/dev/cxgbe/common/t4_hw.c
  stable/11/sys/dev/cxgbe/t4_main.c
  stable/11/sys/dev/cxgbe/t4_vf.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c
==
--- stable/11/sys/dev/cxgbe/common/t4_hw.c  Tue Apr 30 16:41:27 2019
(r346963)
+++ stable/11/sys/dev/cxgbe/common/t4_hw.c  Tue Apr 30 16:52:50 2019
(r346964)
@@ -3892,7 +3892,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m
speed = fwcap_top_speed(lc->supported);
 
/* Force AN on for BT cards. */
-   if (is_bt(adap->port[port]))
+   if (is_bt(adap->port[adap->chan_map[port]]))
aneg = lc->supported & FW_PORT_CAP32_ANEG;
 
rcap = aneg | speed | fc | fec;

Modified: stable/11/sys/dev/cxgbe/t4_main.c
==
--- stable/11/sys/dev/cxgbe/t4_main.c   Tue Apr 30 16:41:27 2019
(r346963)
+++ stable/11/sys/dev/cxgbe/t4_main.c   Tue Apr 30 16:52:50 2019
(r346964)
@@ -5002,6 +5002,8 @@ cxgbe_init_synchronized(struct vi_info *vi)
callout_reset(>tick, hz, vi_tick, vi);
else
callout_reset(>tick, hz, cxgbe_tick, pi);
+   if (pi->link_cfg.link_ok)
+   t4_os_link_changed(pi);
PORT_UNLOCK(pi);
 done:
if (rc != 0)

Modified: stable/11/sys/dev/cxgbe/t4_vf.c
==
--- stable/11/sys/dev/cxgbe/t4_vf.c Tue Apr 30 16:41:27 2019
(r346963)
+++ stable/11/sys/dev/cxgbe/t4_vf.c Tue Apr 30 16:52:50 2019
(r346964)
@@ -295,6 +295,12 @@ set_params__post_init(struct adapter *sc)
val = 1;
(void)t4vf_set_params(sc, 1, , );
 
+   /* Enable 32b port caps if the firmware supports it. */
+   param = FW_PARAM_PFVF(PORT_CAPS32);
+   val = 1;
+   if (t4vf_set_params(sc, 1, , ) == 0)
+   sc->params.port_caps32 = 1;
+
return (0);
 }
 
@@ -479,6 +485,7 @@ t4vf_attach(device_t dev)
sc->params.pci.mps = pci_get_max_payload(dev);
 
sc->flags |= IS_VF;
+   TUNABLE_INT_FETCH("hw.cxgbe.dflags", >debug_flags);
 
sc->sge_gts_reg = VF_SGE_REG(A_SGE_VF_GTS);
sc->sge_kdoorbell_reg = VF_SGE_REG(A_SGE_VF_KDOORBELL);
___
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: r346963 - in stable/11/sys/dev/cxgbe: . common

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 16:41:27 2019
New Revision: 346963
URL: https://svnweb.freebsd.org/changeset/base/346963

Log:
  MFC r343666, r343861-r343862, r343923, r343968, r345660, r345810
  
  r343666:
  cxgbe(4): Improved error reporting and diagnostics.
  
  "slow" interrupt handler:
  - Expand the list of INT_CAUSE registers known to the driver.
  - Add decode information for many more bits but decouple it from the
rest of intr_info so that it is entirely optional.
  - Call t4_fatal_err exactly once, and from the top level PL intr handler.
  
  t4_fatal_err:
  - Use t4_shutdown_adapter from the common code to stop the adapter.
  - Stop servicing slow interrupts after the first fatal one.
  
  Driver/firmware interaction:
  - CH_DUMP_MBOX: note whether the mailbox being dumped is a command or a
reply or something else.
  - Log the raw value of pcie_fw for some errors.
  - Use correct log levels (debug vs. error).
  
  Sponsored by: Chelsio Communications
  
  r343861:
  cxgbe(4): Auto-dump the device log on a mailbox timeout or when the
  firmware reports an error in pcie_fw.
  
  Sponsored by: Chelsio Communications
  
  r343862:
  cxgbe(4): Auto-dump the CIM block's logic analyzer on a TIMER0 interrupt.
  
  Sponsored by: Chelsio Communications
  
  r343923:
  cxgbe(4): Delay the panic due to a fatal error by 30s.
  
  This lets information logged by the interrupt handler reach the system
  log before the system goes down.
  
  r343968:
  cxgbe(4): Ignore unused interrupts.
  
  Sponsored by: Chelsio Communications
  
  r345660:
  cxgbe(4): Count and clear interrupts generated at the software's request.
  
  An interrupt can be requested by setting the F_SWINT bit in PL_PF_CTL.
  
  Sponsored by: Chelsio Communications
  
  r345810:
  cxgbe(4): Add a flag to indicate that bits in interrupt cause but not in
  interrupt enable are not fatal.
  
  The firmware sets up all the interrupt enables based on run time
  configuration, which means the information in the enables is more
  accurate than what's compiled into the driver.  This change also allows
  the fatal bits to be updated without any changes in the driver in some
  cases.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/11/sys/dev/cxgbe/adapter.h
  stable/11/sys/dev/cxgbe/common/common.h
  stable/11/sys/dev/cxgbe/common/t4_hw.c
  stable/11/sys/dev/cxgbe/t4_main.c
  stable/11/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/cxgbe/adapter.h
==
--- stable/11/sys/dev/cxgbe/adapter.h   Tue Apr 30 16:30:16 2019
(r346962)
+++ stable/11/sys/dev/cxgbe/adapter.h   Tue Apr 30 16:41:27 2019
(r346963)
@@ -153,7 +153,7 @@ enum {
CHK_MBOX_ACCESS = (1 << 2),
MASTER_PF   = (1 << 3),
ADAP_SYSCTL_CTX = (1 << 4),
-   /* TOM_INIT_DONE= (1 << 5), No longer used */
+   ADAP_ERR= (1 << 5),
BUF_PACKING_OK  = (1 << 6),
IS_VF   = (1 << 7),
 
@@ -173,6 +173,7 @@ enum {
DF_LOAD_FW_ANYTIME  = (1 << 1), /* Allow LOAD_FW after init */
DF_DISABLE_TCB_CACHE= (1 << 2), /* Disable TCB cache (T6+) */
DF_DISABLE_CFG_RETRY= (1 << 3), /* Disable fallback config */
+   DF_VERBOSE_SLOWINTR = (1 << 4), /* Chatty slow intr handler */
 };
 
 #define IS_DOOMED(vi)  ((vi)->flags & DOOMED)
@@ -886,6 +887,8 @@ struct adapter {
const char *last_op;
const void *last_op_thr;
int last_op_flags;
+
+   int swintr;
 };
 
 #define ADAPTER_LOCK(sc)   mtx_lock(&(sc)->sc_lock)
@@ -926,24 +929,6 @@ struct adapter {
 #define TXQ_LOCK_ASSERT_OWNED(txq) EQ_LOCK_ASSERT_OWNED(&(txq)->eq)
 #define TXQ_LOCK_ASSERT_NOTOWNED(txq)  EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq)
 
-#define CH_DUMP_MBOX(sc, mbox, data_reg) \
-   do { \
-   if (sc->debug_flags & DF_DUMP_MBOX) { \
-   log(LOG_NOTICE, \
-   "%s mbox %u: %016llx %016llx %016llx %016llx " \
-   "%016llx %016llx %016llx %016llx\n", \
-   device_get_nameunit(sc->dev), mbox, \
-   (unsigned long long)t4_read_reg64(sc, data_reg), \
-   (unsigned long long)t4_read_reg64(sc, data_reg + 
8), \
-   (unsigned long long)t4_read_reg64(sc, data_reg + 
16), \
-   (unsigned long long)t4_read_reg64(sc, data_reg + 
24), \
-   (unsigned long long)t4_read_reg64(sc, data_reg + 
32), \
-   (unsigned long long)t4_read_reg64(sc, data_reg + 
40), \
-   (unsigned long long)t4_read_reg64(sc, data_reg + 
48), \
-   (unsigned long long)t4_read_reg64(sc, data_reg + 
56)); \
-   } \
-   } while (0)
-
 #define for_each_txq(vi, iter, q) \

svn commit: r346962 - stable/11/sys/dev/cxgbe

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 16:30:16 2019
New Revision: 346962
URL: https://svnweb.freebsd.org/changeset/base/346962

Log:
  MFC r343539:
  
  cxgbe(4): Add adapter information to messages logged by the OS-agnostic
  code in t4_hw.c.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/11/sys/dev/cxgbe/osdep.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/cxgbe/osdep.h
==
--- stable/11/sys/dev/cxgbe/osdep.h Tue Apr 30 15:28:52 2019
(r346961)
+++ stable/11/sys/dev/cxgbe/osdep.h Tue Apr 30 16:30:16 2019
(r346962)
@@ -40,10 +40,14 @@
 #include 
 #include 
 
-#define CH_ERR(adap, fmt, ...) log(LOG_ERR, fmt, ##__VA_ARGS__)
-#define CH_WARN(adap, fmt, ...) log(LOG_WARNING, fmt, ##__VA_ARGS__)
-#define CH_ALERT(adap, fmt, ...) log(LOG_ALERT, fmt, ##__VA_ARGS__)
-#define CH_WARN_RATELIMIT(adap, fmt, ...) log(LOG_WARNING, fmt, ##__VA_ARGS__)
+#define CH_ERR(adap, fmt, ...) log(LOG_ERR, "%s: " fmt, \
+device_get_nameunit(adap->dev), ##__VA_ARGS__)
+#define CH_WARN(adap, fmt, ...) log(LOG_WARNING, "%s: " fmt, \
+device_get_nameunit(adap->dev), ##__VA_ARGS__)
+#define CH_ALERT(adap, fmt, ...) log(LOG_ALERT, "%s: " fmt, \
+device_get_nameunit(adap->dev), ##__VA_ARGS__)
+#define CH_WARN_RATELIMIT(adap, fmt, ...) log(LOG_WARNING, "%s: " fmt, \
+device_get_nameunit(adap->dev), ##__VA_ARGS__)
 
 #ifndef LINUX_TYPES_DEFINED
 typedef int8_t  s8;
___
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: r346958 - head/sys/compat/linuxkpi/common/src

2019-04-30 Thread Tycho Nightingale

> On Apr 30, 2019, at 11:24 AM, Warner Losh  wrote:
> 
> 
> On Tue, Apr 30, 2019 at 9:17 AM Hans Petter Selasky  > wrote:
> On 4/30/19 3:10 PM, Niclas Zeising wrote:
> > On 2019-04-30 12:41, Hans Petter Selasky wrote:
> >> Author: hselasky
> >> Date: Tue Apr 30 10:41:20 2019
> >> New Revision: 346958
> >> URL: https://svnweb.freebsd.org/changeset/base/346958 
> >> 
> >>
> >> Log:
> >>Reduce the number of mutexes after r346645 in the LinuxKPI.
> >>Make function macro wrappers for locking and unlocking to ease 
> >> readability.
> >>No functional change.
> >>Discussed with:kib@, tychon@ and zeising@
> > 
> > I was not part of any discussion regarding this.  If this is related to 
> > https://reviews.freebsd.org/D20097  I 
> > explicitly asked you on gitter to 
> > hold of for a bit, while we try to figure out why we are seeing 
> > regressions in graphics with the latest dmar changes.
> > 
> > Can you please revert this since it colludes the dmar graphics issue, 
> > and it makes the suggested patch not apply cleanly, which makes it 
> > harder to get people to help test.
> > Thank you!
> > Regards
> 
> In response to your request I've collected fixes for all the known 
> LinuxKPI+DMA issues at:
> https://reviews.freebsd.org/D20097 
> 
> It is based on top of the latest -current.
> 
> Hopefully this will solve the problem. Do you have any idea of when we might 
> see resolution of this issue? I'd like to see it fixed by Friday either with 
> fixes or a revert. Do you think that's a reasonable time frame? If not, what 
> do you think a reasonable time frame will be? I know we have a number of 
> unknowns to factor in, so my queries are  based on our best guesses.

Friday seems reasonable.

The issues that have been exposed are that several callers of the Linux API are 
not compliant with the documented API.  For example according to the 
documentation, dma_map_sg() may coalesce entries and our current implementation 
does that.  This broke some graphics drivers. To support these drivers, going 
back to the non-coalesced version is the only path forward as the callee bugs 
redefine this API de facto; this is included in D20097.

Also included in D20097 is a fix to ensure sg_dma_len() is equal to sg->length 
— again to address assumptions in drivers.

Finally, apparently some drivers load the same DMA address multiple times 
without any prior unload.  Those drivers need to work too; D20097 contains a 
fix.

Thanks hps@ for helping out!

Tycho
___
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: r346961 - head/tools/boot

2019-04-30 Thread Ed Maste
Author: emaste
Date: Tue Apr 30 15:28:52 2019
New Revision: 346961
URL: https://svnweb.freebsd.org/changeset/base/346961

Log:
  revert QEMU q35 platform use from r346748
  
  It seems to be incompatible with the OVMF.fd (of unknown provenance)
  in use by the Cirrus-CI config.  We will soon have a known OVMF build
  via a port/package (see review D19869) and we can switch back to q35
  once packages are available.
  
  Discussed with:   bcran

Modified:
  head/tools/boot/ci-qemu-test.sh

Modified: head/tools/boot/ci-qemu-test.sh
==
--- head/tools/boot/ci-qemu-test.sh Tue Apr 30 14:44:39 2019
(r346960)
+++ head/tools/boot/ci-qemu-test.sh Tue Apr 30 15:28:52 2019
(r346961)
@@ -97,7 +97,7 @@ trap tempdir_cleanup EXIT SIGINT SIGHUP SIGTERM SIGQUI
 # And, boot in QEMU.
 : ${BOOTLOG:=${TMPDIR:-/tmp}/ci-qemu-test-boot.log}
 timeout 300 \
-qemu-system-x86_64 -M q35 -m 256M -nodefaults \
+qemu-system-x86_64 -m 256M -nodefaults \
-drive if=pflash,format=raw,readonly,file=${OVMF} \
 -serial stdio -vga none -nographic -monitor none \
 -snapshot -hda fat:${ROOTDIR} 2>&1 | tee ${BOOTLOG}
___
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: r346958 - head/sys/compat/linuxkpi/common/src

2019-04-30 Thread Warner Losh
On Tue, Apr 30, 2019 at 9:17 AM Hans Petter Selasky  wrote:

> On 4/30/19 3:10 PM, Niclas Zeising wrote:
> > On 2019-04-30 12:41, Hans Petter Selasky wrote:
> >> Author: hselasky
> >> Date: Tue Apr 30 10:41:20 2019
> >> New Revision: 346958
> >> URL: https://svnweb.freebsd.org/changeset/base/346958
> >>
> >> Log:
> >>Reduce the number of mutexes after r346645 in the LinuxKPI.
> >>Make function macro wrappers for locking and unlocking to ease
> >> readability.
> >>No functional change.
> >>Discussed with:kib@, tychon@ and zeising@
> >
> > I was not part of any discussion regarding this.  If this is related to
> > https://reviews.freebsd.org/D20097 I explicitly asked you on gitter to
> > hold of for a bit, while we try to figure out why we are seeing
> > regressions in graphics with the latest dmar changes.
> >
> > Can you please revert this since it colludes the dmar graphics issue,
> > and it makes the suggested patch not apply cleanly, which makes it
> > harder to get people to help test.
> > Thank you!
> > Regards
>
> In response to your request I've collected fixes for all the known
> LinuxKPI+DMA issues at:
> https://reviews.freebsd.org/D20097
>
> It is based on top of the latest -current.
>

Hopefully this will solve the problem. Do you have any idea of when we
might see resolution of this issue? I'd like to see it fixed by Friday
either with fixes or a revert. Do you think that's a reasonable time frame?
If not, what do you think a reasonable time frame will be? I know we have a
number of unknowns to factor in, so my queries are  based on our best
guesses.

Warner
___
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: r346958 - head/sys/compat/linuxkpi/common/src

2019-04-30 Thread Hans Petter Selasky

On 4/30/19 3:10 PM, Niclas Zeising wrote:

On 2019-04-30 12:41, Hans Petter Selasky wrote:

Author: hselasky
Date: Tue Apr 30 10:41:20 2019
New Revision: 346958
URL: https://svnweb.freebsd.org/changeset/base/346958

Log:
   Reduce the number of mutexes after r346645 in the LinuxKPI.
   Make function macro wrappers for locking and unlocking to ease 
readability.

   No functional change.
   Discussed with:    kib@, tychon@ and zeising@


I was not part of any discussion regarding this.  If this is related to 
https://reviews.freebsd.org/D20097 I explicitly asked you on gitter to 
hold of for a bit, while we try to figure out why we are seeing 
regressions in graphics with the latest dmar changes.


Can you please revert this since it colludes the dmar graphics issue, 
and it makes the suggested patch not apply cleanly, which makes it 
harder to get people to help test.

Thank you!
Regards


In response to your request I've collected fixes for all the known 
LinuxKPI+DMA issues at:

https://reviews.freebsd.org/D20097

It is based on top of the latest -current.

--HPS
___
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: r346932 - head/sys/ufs/ufs

2019-04-30 Thread Warner Losh
On Tue, Apr 30, 2019 at 8:27 AM Mark Johnston  wrote:

> On Tue, Apr 30, 2019 at 06:08:49AM +, Alexey Dokuchaev wrote:
> > On Mon, Apr 29, 2019 at 10:05:26PM +, Mark Johnston wrote:
> > > New Revision: 346932
> > > URL: https://svnweb.freebsd.org/changeset/base/346932
> > >
> > > Log:
> > >   Optimize lseek(SEEK_DATA) on UFS.
> > >
> > >   This version fixes the problems identified in r345244.
> > >
> > >   Reviewed by:  kib
> > > @@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$");
> > >  #include 
> > >  #include 
> > >
> > > +static ufs_lbn_t lbn_count(struct ufsmount *, int);
> > > +static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct
> buf **);
> >
> > Is the prototype for static readindir() really needed here?
>
> Yes, when using a K definition.
>
> > > +static int
> > > +readindir(vp, lbn, daddr, bpp)
> > > +   struct vnode *vp;
> > > +   ufs_lbn_t lbn;
> > > +   ufs2_daddr_t daddr;
> > > +   struct buf **bpp;
> >
> > Don't we prefer ASNI declarations over K these days?
>
> Yes, I was just staying consistent with the rest of the file.


For new code, we do prefer ANSI prototypes and function definitions. But
for ufs and friends, we're still using K for a variety of reasons.

Warner
___
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: r346960 - head/usr.sbin/rtadvd

2019-04-30 Thread Mark Johnston
Author: markj
Date: Tue Apr 30 14:44:39 2019
New Revision: 346960
URL: https://svnweb.freebsd.org/changeset/base/346960

Log:
  Retry upon NET_RT_IFLIST sysctl failure.
  
  Port the logic used by getifaddrs(3) to handle the case where
  NET_RT_IFLIST returns ENOMEM, which can occur if the list size changes
  between the buffer allocation and sysctl read.
  
  PR:   195191
  Submitted by: Guy Yur  (original version)
  MFC after:1 week

Modified:
  head/usr.sbin/rtadvd/if.c

Modified: head/usr.sbin/rtadvd/if.c
==
--- head/usr.sbin/rtadvd/if.c   Tue Apr 30 14:29:09 2019(r346959)
+++ head/usr.sbin/rtadvd/if.c   Tue Apr 30 14:44:39 2019(r346960)
@@ -408,6 +408,8 @@ update_ifinfo_nd_flags(struct ifinfo *ifi)
return (0);
 }
 
+#define MAX_SYSCTL_TRY 5
+
 struct ifinfo *
 update_ifinfo(struct ifilist_head_t *ifi_head, int ifindex)
 {
@@ -419,26 +421,43 @@ update_ifinfo(struct ifilist_head_t *ifi_head, int ifi
size_t len;
char *lim;
int mib[] = { CTL_NET, PF_ROUTE, 0, AF_INET6, NET_RT_IFLIST, 0 };
-   int error;
+   int error, ntry;
 
syslog(LOG_DEBUG, "<%s> enter", __func__);
 
-   if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), NULL, , NULL, 0) <
-   0) {
-   syslog(LOG_ERR,
-   "<%s> sysctl: NET_RT_IFLIST size get failed", __func__);
-   exit(1);
-   }
-   if ((msg = malloc(len)) == NULL) {
-   syslog(LOG_ERR, "<%s> malloc failed", __func__);
-   exit(1);
-   }
-   if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), msg, , NULL, 0) <
-   0) {
-   syslog(LOG_ERR,
-   "<%s> sysctl: NET_RT_IFLIST get failed", __func__);
-   exit(1);
-   }
+   ntry = 0;
+   do {
+   /*
+* We'll try to get addresses several times in case that
+* the number of addresses is unexpectedly increased during
+* the two sysctl calls.  This should rarely happen.
+* Portability note: since FreeBSD does not add margin of
+* memory at the first sysctl, the possibility of failure on
+* the second sysctl call is a bit higher.
+*/
+
+   if (sysctl(mib, nitems(mib), NULL, , NULL, 0) < 0) {
+   syslog(LOG_ERR,
+   "<%s> sysctl: NET_RT_IFLIST size get failed",
+   __func__);
+   exit(1);
+   }
+   if ((msg = malloc(len)) == NULL) {
+   syslog(LOG_ERR, "<%s> malloc failed", __func__);
+   exit(1);
+   }
+   if (sysctl(mib, nitems(mib), msg, , NULL, 0) < 0) {
+   if (errno != ENOMEM || ++ntry >= MAX_SYSCTL_TRY) {
+   free(msg);
+   syslog(LOG_ERR,
+   "<%s> sysctl: NET_RT_IFLIST get failed",
+   __func__);
+   exit(1);
+   }
+   free(msg);
+   msg = NULL;
+   }
+   } while (msg == NULL);
 
lim = msg + len;
for (ifm = (struct if_msghdr *)msg;
___
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: r346959 - in head/release: . tools

2019-04-30 Thread Glen Barber
Author: gjb
Date: Tue Apr 30 14:29:09 2019
New Revision: 346959
URL: https://svnweb.freebsd.org/changeset/base/346959

Log:
  Reduce the default image size for virtual machine disk images from
  30GB to 3GB.  The raw images can be resized using truncate(1), and
  other formats can be resized with tools included with other tools
  included with other hypervisors.
  
  Enable the growfs(8) rc(8) at firstboot if the disk was resized
  prior to booting the virtual machine for the first time.
  
  Discussed with:   several
  PR:   232313 (requested in other context)
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile.vm
  head/release/tools/gce.conf
  head/release/tools/vmimage.subr

Modified: head/release/Makefile.vm
==
--- head/release/Makefile.vmTue Apr 30 10:41:20 2019(r346958)
+++ head/release/Makefile.vmTue Apr 30 14:29:09 2019(r346959)
@@ -7,7 +7,7 @@
 
 VMTARGETS= vm-image
 VMFORMATS?=vhd vmdk qcow2 raw
-VMSIZE?=   30G
+VMSIZE?=   3072M
 SWAPSIZE?= 1G
 VMBASE?=   vm
 

Modified: head/release/tools/gce.conf
==
--- head/release/tools/gce.conf Tue Apr 30 10:41:20 2019(r346958)
+++ head/release/tools/gce.conf Tue Apr 30 14:29:09 2019(r346959)
@@ -3,9 +3,6 @@
 # $FreeBSD$
 #
 
-# Reduce VMSIZE to be below the free quota limit.
-export VMSIZE=27G
-
 # Set to a list of packages to install.
 export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \
google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \

Modified: head/release/tools/vmimage.subr
==
--- head/release/tools/vmimage.subr Tue Apr 30 10:41:20 2019
(r346958)
+++ head/release/tools/vmimage.subr Tue Apr 30 14:29:09 2019
(r346959)
@@ -182,6 +182,9 @@ vm_extra_enable_services() {
if [ -z "${VMCONFIG}" -o -c "${VMCONFIG}" ]; then
echo 'ifconfig_DEFAULT="DHCP inet6 accept_rtadv"' >> \
${DESTDIR}/etc/rc.conf
+   # Expand the filesystem to fill the disk.
+   echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf
+   touch ${DESTDIR}/firstboot
fi
 
return 0
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r346932 - head/sys/ufs/ufs

2019-04-30 Thread Mark Johnston
On Tue, Apr 30, 2019 at 06:08:49AM +, Alexey Dokuchaev wrote:
> On Mon, Apr 29, 2019 at 10:05:26PM +, Mark Johnston wrote:
> > New Revision: 346932
> > URL: https://svnweb.freebsd.org/changeset/base/346932
> > 
> > Log:
> >   Optimize lseek(SEEK_DATA) on UFS.
> >   
> >   This version fixes the problems identified in r345244.
> >   
> >   Reviewed by:  kib
> > @@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$");
> >  #include 
> >  #include 
> >  
> > +static ufs_lbn_t lbn_count(struct ufsmount *, int);
> > +static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct buf 
> > **);
> 
> Is the prototype for static readindir() really needed here?

Yes, when using a K definition.

> > +static int
> > +readindir(vp, lbn, daddr, bpp)
> > +   struct vnode *vp;
> > +   ufs_lbn_t lbn;
> > +   ufs2_daddr_t daddr;
> > +   struct buf **bpp;
> 
> Don't we prefer ASNI declarations over K these days?

Yes, I was just staying consistent with the rest of the file.

> > +static ufs_lbn_t
> > +lbn_count(ump, level)
> > +   struct ufsmount *ump;
> > +   int level;
> 
> Ditto.
> 
> > +int
> > +ufs_bmap_seekdata(vp, offp)
> > +   struct vnode *vp;
> > +   off_t *offp;
> 
> ./danfe
___
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: r346958 - head/sys/compat/linuxkpi/common/src

2019-04-30 Thread Niclas Zeising

On 2019-04-30 12:41, Hans Petter Selasky wrote:

Author: hselasky
Date: Tue Apr 30 10:41:20 2019
New Revision: 346958
URL: https://svnweb.freebsd.org/changeset/base/346958

Log:
   Reduce the number of mutexes after r346645 in the LinuxKPI.
   Make function macro wrappers for locking and unlocking to ease readability.
   
   No functional change.
   
   Discussed with:		kib@, tychon@ and zeising@


I was not part of any discussion regarding this.  If this is related to 
https://reviews.freebsd.org/D20097 I explicitly asked you on gitter to 
hold of for a bit, while we try to figure out why we are seeing 
regressions in graphics with the latest dmar changes.


Can you please revert this since it colludes the dmar graphics issue, 
and it makes the suggested patch not apply cleanly, which makes it 
harder to get people to help test.

Thank you!
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"


svn commit: r346958 - head/sys/compat/linuxkpi/common/src

2019-04-30 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Apr 30 10:41:20 2019
New Revision: 346958
URL: https://svnweb.freebsd.org/changeset/base/346958

Log:
  Reduce the number of mutexes after r346645 in the LinuxKPI.
  Make function macro wrappers for locking and unlocking to ease readability.
  
  No functional change.
  
  Discussed with:   kib@, tychon@ and zeising@
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/src/linux_pci.c

Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c
==
--- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:38:22 
2019(r346957)
+++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 10:41:20 
2019(r346958)
@@ -78,11 +78,12 @@ static device_method_t pci_methods[] = {
 
 struct linux_dma_priv {
uint64_tdma_mask;
-   struct mtx  dma_lock;
+   struct mtx  lock;
bus_dma_tag_t   dmat;
-   struct mtx  ptree_lock;
struct pctrie   ptree;
 };
+#defineDMA_PRIV_LOCK(priv) mtx_lock(&(priv)->lock)
+#defineDMA_PRIV_UNLOCK(priv) mtx_unlock(&(priv)->lock)
 
 static int
 linux_pdev_dma_init(struct pci_dev *pdev)
@@ -92,9 +93,8 @@ linux_pdev_dma_init(struct pci_dev *pdev)
priv = malloc(sizeof(*priv), M_DEVBUF, M_WAITOK | M_ZERO);
pdev->dev.dma_priv = priv;
 
-   mtx_init(>dma_lock, "linux_dma", NULL, MTX_DEF);
+   mtx_init(>lock, "lkpi-priv-dma", NULL, MTX_DEF);
 
-   mtx_init(>ptree_lock, "linux_dma_ptree", NULL, MTX_DEF);
pctrie_init(>ptree);
 
return (0);
@@ -108,8 +108,7 @@ linux_pdev_dma_uninit(struct pci_dev *pdev)
priv = pdev->dev.dma_priv;
if (priv->dmat)
bus_dma_tag_destroy(priv->dmat);
-   mtx_destroy(>dma_lock);
-   mtx_destroy(>ptree_lock);
+   mtx_destroy(>lock);
free(priv, M_DEVBUF);
pdev->dev.dma_priv = NULL;
return (0);
@@ -500,37 +499,34 @@ linux_dma_map_phys(struct device *dev, vm_paddr_t phys
 
obj = uma_zalloc(linux_dma_obj_zone, 0);
 
+   DMA_PRIV_LOCK(priv);
if (bus_dmamap_create(priv->dmat, 0, >dmamap) != 0) {
+   DMA_PRIV_UNLOCK(priv);
uma_zfree(linux_dma_obj_zone, obj);
return (0);
}
 
nseg = -1;
-   mtx_lock(>dma_lock);
if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, phys, len,
BUS_DMA_NOWAIT, , ) != 0) {
bus_dmamap_destroy(priv->dmat, obj->dmamap);
-   mtx_unlock(>dma_lock);
+   DMA_PRIV_UNLOCK(priv);
uma_zfree(linux_dma_obj_zone, obj);
return (0);
}
-   mtx_unlock(>dma_lock);
 
KASSERT(++nseg == 1, ("More than one segment (nseg=%d)", nseg));
obj->dma_addr = seg.ds_addr;
 
-   mtx_lock(>ptree_lock);
error = LINUX_DMA_PCTRIE_INSERT(>ptree, obj);
-   mtx_unlock(>ptree_lock);
if (error != 0) {
-   mtx_lock(>dma_lock);
bus_dmamap_unload(priv->dmat, obj->dmamap);
bus_dmamap_destroy(priv->dmat, obj->dmamap);
-   mtx_unlock(>dma_lock);
+   DMA_PRIV_UNLOCK(priv);
uma_zfree(linux_dma_obj_zone, obj);
return (0);
}
-
+   DMA_PRIV_UNLOCK(priv);
return (obj->dma_addr);
 }
 
@@ -542,19 +538,16 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_add
 
priv = dev->dma_priv;
 
-   mtx_lock(>ptree_lock);
+   DMA_PRIV_LOCK(priv);
obj = LINUX_DMA_PCTRIE_LOOKUP(>ptree, dma_addr);
if (obj == NULL) {
-   mtx_unlock(>ptree_lock);
+   DMA_PRIV_UNLOCK(priv);
return;
}
LINUX_DMA_PCTRIE_REMOVE(>ptree, dma_addr);
-   mtx_unlock(>ptree_lock);
-
-   mtx_lock(>dma_lock);
bus_dmamap_unload(priv->dmat, obj->dmamap);
bus_dmamap_destroy(priv->dmat, obj->dmamap);
-   mtx_unlock(>dma_lock);
+   DMA_PRIV_UNLOCK(priv);
 
uma_zfree(linux_dma_obj_zone, obj);
 }
@@ -575,7 +568,9 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat
 
obj = uma_zalloc(linux_dma_obj_zone, 0);
 
+   DMA_PRIV_LOCK(priv);
if (bus_dmamap_create(priv->dmat, 0, >dmamap) != 0) {
+   DMA_PRIV_UNLOCK(priv);
uma_zfree(linux_dma_obj_zone, obj);
return (0);
}
@@ -583,6 +578,7 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat
sg = sgl;
dma_sg = sg;
dma_nents = 0;
+
while (nents > 0) {
seg_phys = sg_phys(sg);
seg_len = sg->length;
@@ -595,17 +591,15 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat
}
 
nseg = -1;
-   mtx_lock(>dma_lock);
if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap,
seg_phys, 

svn commit: r346957 - in head/sys/compat/linuxkpi/common: include/linux src

2019-04-30 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Apr 30 09:38:22 2019
New Revision: 346957
URL: https://svnweb.freebsd.org/changeset/base/346957

Log:
  Make the dma_pool structure private to the LinuxKPI similar to Linux.
  
  No functional change.
  
  Discussed with:   kib @
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/dmapool.h
  head/sys/compat/linuxkpi/common/src/linux_pci.c

Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h
==
--- head/sys/compat/linuxkpi/common/include/linux/dmapool.h Tue Apr 30 
09:26:11 2019(r346956)
+++ head/sys/compat/linuxkpi/common/include/linux/dmapool.h Tue Apr 30 
09:38:22 2019(r346957)
@@ -37,6 +37,7 @@
 #include 
 #include 
 
+struct dma_pool;
 struct dma_pool *linux_dma_pool_create(char *name, struct device *dev,
 size_t size, size_t align, size_t boundary);
 void linux_dma_pool_destroy(struct dma_pool *pool);
@@ -44,16 +45,6 @@ void *linux_dma_pool_alloc(struct dma_pool *pool, gfp_
 dma_addr_t *handle);
 void linux_dma_pool_free(struct dma_pool *pool, void *vaddr,
 dma_addr_t dma_addr);
-
-struct dma_pool {
-   struct device  *pool_device;
-   uma_zone_t  pool_zone;
-   struct mtx  pool_dma_lock;
-   bus_dma_tag_t   pool_dmat;
-   size_t  pool_entry_size;
-   struct mtx  pool_ptree_lock;
-   struct pctrie   pool_ptree;
-};
 
 static inline struct dma_pool *
 dma_pool_create(char *name, struct device *dev, size_t size,

Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c
==
--- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:26:11 
2019(r346956)
+++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:38:22 
2019(r346957)
@@ -658,6 +658,16 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct sc
uma_zfree(linux_dma_obj_zone, obj);
 }
 
+struct dma_pool {
+   struct device  *pool_device;
+   uma_zone_t  pool_zone;
+   struct mtx  pool_dma_lock;
+   bus_dma_tag_t   pool_dmat;
+   size_t  pool_entry_size;
+   struct mtx  pool_ptree_lock;
+   struct pctrie   pool_ptree;
+};
+
 static inline int
 dma_pool_obj_ctor(void *mem, int size, void *arg, int flags)
 {
___
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: r346956 - in head/sys/compat/linuxkpi/common: include/linux src

2019-04-30 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Apr 30 09:26:11 2019
New Revision: 346956
URL: https://svnweb.freebsd.org/changeset/base/346956

Log:
  Store a pointer to the device instead of the PCI device in the DMA pool
  implementation in the LinuxKPI. This avoids use of container_of().
  
  No functional change.
  
  Discussed with:   kib @
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/dmapool.h
  head/sys/compat/linuxkpi/common/src/linux_pci.c

Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h
==
--- head/sys/compat/linuxkpi/common/include/linux/dmapool.h Tue Apr 30 
09:10:45 2019(r346955)
+++ head/sys/compat/linuxkpi/common/include/linux/dmapool.h Tue Apr 30 
09:26:11 2019(r346956)
@@ -46,7 +46,7 @@ void linux_dma_pool_free(struct dma_pool *pool, void *
 dma_addr_t dma_addr);
 
 struct dma_pool {
-   struct pci_dev  *pool_pdev;
+   struct device  *pool_device;
uma_zone_t  pool_zone;
struct mtx  pool_dma_lock;
bus_dma_tag_t   pool_dmat;

Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c
==
--- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:10:45 
2019(r346955)
+++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:26:11 
2019(r346956)
@@ -701,7 +701,7 @@ dma_pool_obj_import(void *arg, void **store, int count
struct linux_dma_obj *obj;
int error, i;
 
-   priv = pool->pool_pdev->dev.dma_priv;
+   priv = pool->pool_device->dma_priv;
for (i = 0; i < count; i++) {
obj = uma_zalloc(linux_dma_obj_zone, flags);
if (obj == NULL)
@@ -728,7 +728,7 @@ dma_pool_obj_release(void *arg, void **store, int coun
struct linux_dma_obj *obj;
int i;
 
-   priv = pool->pool_pdev->dev.dma_priv;
+   priv = pool->pool_device->dma_priv;
for (i = 0; i < count; i++) {
obj = store[i];
bus_dmamem_free(pool->pool_dmat, obj->vaddr, obj->dmamap);
@@ -746,7 +746,7 @@ linux_dma_pool_create(char *name, struct device *dev, 
priv = dev->dma_priv;
 
pool = kzalloc(sizeof(*pool), GFP_KERNEL);
-   pool->pool_pdev = to_pci_dev(dev);
+   pool->pool_device = dev;
pool->pool_entry_size = size;
 
if (bus_dma_tag_create(bus_get_dma_tag(dev->bsddev),
___
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: r346955 - stable/12/sys/fs/ext2fs

2019-04-30 Thread Fedor Uporov
Author: fsu
Date: Tue Apr 30 09:10:45 2019
New Revision: 346955
URL: https://svnweb.freebsd.org/changeset/base/346955

Log:
  MFC r346267, 346269:
  ext2fs: Initial version of DTrace support.
  
  Reviewed by:pfg, gnn
  
  Differential Revision:https://reviews.freebsd.org/D19848

Modified:
  stable/12/sys/fs/ext2fs/ext2_alloc.c
  stable/12/sys/fs/ext2fs/ext2_csum.c
  stable/12/sys/fs/ext2fs/ext2_extattr.c
  stable/12/sys/fs/ext2fs/ext2_extents.c
  stable/12/sys/fs/ext2fs/ext2_extents.h
  stable/12/sys/fs/ext2fs/ext2_extern.h
  stable/12/sys/fs/ext2fs/ext2_hash.c
  stable/12/sys/fs/ext2fs/ext2_htree.c
  stable/12/sys/fs/ext2fs/ext2_inode.c
  stable/12/sys/fs/ext2fs/ext2_inode_cnv.c
  stable/12/sys/fs/ext2fs/ext2_lookup.c
  stable/12/sys/fs/ext2fs/ext2_subr.c
  stable/12/sys/fs/ext2fs/ext2_vfsops.c
  stable/12/sys/fs/ext2fs/ext2_vnops.c
  stable/12/sys/fs/ext2fs/fs.h

Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c
==
--- stable/12/sys/fs/ext2fs/ext2_alloc.cTue Apr 30 08:17:11 2019
(r346954)
+++ stable/12/sys/fs/ext2fs/ext2_alloc.cTue Apr 30 09:10:45 2019
(r346955)
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -55,6 +56,23 @@
 #include 
 #include 
 
+SDT_PROVIDER_DEFINE(ext2fs);
+/*
+ * ext2fs trace probe:
+ * arg0: verbosity. Higher numbers give more verbose messages
+ * arg1: Textual message
+ */
+SDT_PROBE_DEFINE2(ext2fs, , alloc, trace, "int", "char*");
+SDT_PROBE_DEFINE3(ext2fs, , alloc, ext2_reallocblks_realloc,
+"ino_t", "e2fs_lbn_t", "e2fs_lbn_t");
+SDT_PROBE_DEFINE1(ext2fs, , alloc, ext2_reallocblks_bap, "uint32_t");
+SDT_PROBE_DEFINE1(ext2fs, , alloc, ext2_reallocblks_blkno, "e2fs_daddr_t");
+SDT_PROBE_DEFINE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, "char*", 
"int");
+SDT_PROBE_DEFINE3(ext2fs, , alloc, ext2_nodealloccg_bmap_corrupted,
+"int", "daddr_t", "char*");
+SDT_PROBE_DEFINE2(ext2fs, , alloc, ext2_blkfree_bad_block, "ino_t", 
"e4fs_daddr_t");
+SDT_PROBE_DEFINE2(ext2fs, , alloc, ext2_vfree_doublefree, "char*", "ino_t");
+
 static daddr_t ext2_alloccg(struct inode *, int, daddr_t, int);
 static daddr_t ext2_clusteralloc(struct inode *, int, daddr_t, int);
 static u_long  ext2_dirpref(struct inode *);
@@ -128,8 +146,7 @@ ext2_alloc(struct inode *ip, daddr_t lbn, e4fs_daddr_t
}
 nospace:
EXT2_UNLOCK(ump);
-   ext2_fserr(fs, cred->cr_uid, "filesystem full");
-   uprintf("\n%s: write failed, filesystem is full\n", fs->e2fs_fsmnt);
+   SDT_PROBE2(ext2fs, , alloc, trace, 1, "cannot allocate data block");
return (ENOSPC);
 }
 
@@ -147,8 +164,10 @@ ext2_alloc_meta(struct inode *ip)
EXT2_LOCK(ip->i_ump);
blk = ext2_hashalloc(ip, ino_to_cg(fs, ip->i_number), 0, fs->e2fs_bsize,
ext2_alloccg);
-   if (0 == blk)
+   if (0 == blk) {
EXT2_UNLOCK(ip->i_ump);
+   SDT_PROBE2(ext2fs, , alloc, trace, 1, "cannot allocate meta 
block");
+   }
 
return (blk);
 }
@@ -289,10 +308,8 @@ ext2_reallocblks(struct vop_reallocblks_args *ap)
 * block pointers in the inode and indirect blocks associated
 * with the file.
 */
-#ifdef DEBUG
-   printf("realloc: ino %ju, lbns %jd-%jd\n\told:",
-   (uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn);
-#endif /* DEBUG */
+   SDT_PROBE3(ext2fs, , alloc, ext2_reallocblks_realloc,
+   ip->i_number, start_lbn, end_lbn);
blkno = newblk;
for (bap = [soff], i = 0; i < len; i++, blkno += fs->e2fs_fpb) {
if (i == ssize) {
@@ -303,9 +320,7 @@ ext2_reallocblks(struct vop_reallocblks_args *ap)
if (buflist->bs_children[i]->b_blkno != fsbtodb(fs, *bap))
panic("ext2_reallocblks: alloc mismatch");
 #endif
-#ifdef DEBUG
-   printf(" %d,", *bap);
-#endif /* DEBUG */
+   SDT_PROBE1(ext2fs, , alloc, ext2_reallocblks_bap, *bap);
*bap++ = blkno;
}
/*
@@ -341,20 +356,13 @@ ext2_reallocblks(struct vop_reallocblks_args *ap)
/*
 * Last, free the old blocks and assign the new blocks to the buffers.
 */
-#ifdef DEBUG
-   printf("\n\tnew:");
-#endif /* DEBUG */
for (blkno = newblk, i = 0; i < len; i++, blkno += fs->e2fs_fpb) {
ext2_blkfree(ip, dbtofsb(fs, buflist->bs_children[i]->b_blkno),
fs->e2fs_bsize);
buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno);
-#ifdef DEBUG
-   printf(" %d,", blkno);
-#endif /* DEBUG */
+   SDT_PROBE1(ext2fs, , alloc, ext2_reallocblks_blkno, blkno);
}
-#ifdef DEBUG
-   printf("\n");
-#endif /* DEBUG */
+
return (0);
 
 fail:
@@ -481,8 +489,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred 
 
 noinodes:
EXT2_UNLOCK(ump);
-   ext2_fserr(fs, cred->cr_uid, 

svn commit: r346954 - stable/11/sys/dev/cxgbe

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 08:17:11 2019
New Revision: 346954
URL: https://svnweb.freebsd.org/changeset/base/346954

Log:
  MFC r343269, r346567
  
  r343269:
  cxgbe(4): Allow negative values in hw.cxgbe.fw_install and take them to
  mean that the driver should taste the firmware in the KLD and use that
  firmware's version for all its fw_install checks.
  
  The driver gets firmware version information from compiled-in values by
  default and this change allows custom (or older/newer) firmware modules
  to be used with the stock driver.
  
  There is no change in default behavior.
  
  Sponsored by: Chelsio Communications
  
  r346567:
  cxgbe(4): Make sure bundled_fw is always initialized before use.
  
  This fixes a bug that prevented the driver from auto-flashing the
  firmware when it didn't see one on the card.  This feature was
  introduced in r321390 and this bug was introduced in r343269.
  
  Reported by:  gallatin@
  Sponsored by: Chelsio Communications

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

Modified: stable/11/sys/dev/cxgbe/t4_main.c
==
--- stable/11/sys/dev/cxgbe/t4_main.c   Tue Apr 30 08:09:32 2019
(r346953)
+++ stable/11/sys/dev/cxgbe/t4_main.c   Tue Apr 30 08:17:11 2019
(r346954)
@@ -477,9 +477,10 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, autoneg, CTLFLAG_RDTUN
 
 /*
  * Firmware auto-install by driver during attach (0, 1, 2 = prohibited, 
allowed,
- * encouraged respectively).
+ * encouraged respectively).  '-n' is the same as 'n' except the firmware
+ * version used in the checks is read from the firmware bundled with the 
driver.
  */
-static unsigned int t4_fw_install = 1;
+static int t4_fw_install = 1;
 SYSCTL_INT(_hw_cxgbe, OID_AUTO, fw_install, CTLFLAG_RDTUN, _fw_install, 0,
 "Firmware auto-install (0 = prohibited, 1 = allowed, 2 = encouraged)");
 
@@ -3448,10 +3449,31 @@ install_kld_firmware(struct adapter *sc, struct fw_h *
 {
const struct firmware *cfg, *fw;
const uint32_t c = be32toh(card_fw->fw_ver);
-   const uint32_t d = be32toh(drv_fw->fw_ver);
-   uint32_t k;
-   int rc;
+   uint32_t d, k;
+   int rc, fw_install;
+   struct fw_h bundled_fw;
+   bool load_attempted;
 
+   cfg = fw = NULL;
+   load_attempted = false;
+   fw_install = t4_fw_install < 0 ? -t4_fw_install : t4_fw_install;
+
+   memcpy(_fw, drv_fw, sizeof(bundled_fw));
+   if (t4_fw_install < 0) {
+   rc = load_fw_module(sc, , );
+   if (rc != 0 || fw == NULL) {
+   device_printf(sc->dev,
+   "failed to load firmware module: %d. cfg %p, fw %p;"
+   " will use compiled-in firmware version for"
+   "hw.cxgbe.fw_install checks.\n",
+   rc, cfg, fw);
+   } else {
+   memcpy(_fw, fw->data, sizeof(bundled_fw));
+   }
+   load_attempted = true;
+   }
+   d = be32toh(bundled_fw.fw_ver);
+
if (reason != NULL)
goto install;
 
@@ -3462,10 +3484,11 @@ install_kld_firmware(struct adapter *sc, struct fw_h *
goto install;
}
 
-   return (0);
+   rc = 0;
+   goto done;
}
 
-   if (!fw_compatible(card_fw, drv_fw)) {
+   if (!fw_compatible(card_fw, _fw)) {
reason = "incompatible or unusable";
goto install;
}
@@ -3475,52 +3498,72 @@ install_kld_firmware(struct adapter *sc, struct fw_h *
goto install;
}
 
-   if (t4_fw_install == 2 && d != c) {
+   if (fw_install == 2 && d != c) {
reason = "different than the version bundled with this driver";
goto install;
}
 
-   return (0);
+   /* No reason to do anything to the firmware already on the card. */
+   rc = 0;
+   goto done;
 
 install:
+   rc = 0;
if ((*already)++)
-   return (0);
+   goto done;
 
-   if (t4_fw_install == 0) {
+   if (fw_install == 0) {
device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, "
"but the driver is prohibited from installing a firmware "
"on the card.\n",
G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c),
G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason);
 
-   return (0);
+   goto done;
}
 
-   device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, "
-   "installing firmware %u.%u.%u.%u on card.\n",
-   G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c),
-   G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason,
-   G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d),

svn commit: r346952 - stable/11/sys/dev/cxgbe

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 08:08:06 2019
New Revision: 346952
URL: https://svnweb.freebsd.org/changeset/base/346952

Log:
  MFC r343264:
  
  cxgbe(4): Use a truncated firmware header for version checks.  All the
  version numbers are towards the begining of the header.
  
  Sponsored by: Chelsio Communications

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

Modified: stable/11/sys/dev/cxgbe/t4_main.c
==
--- stable/11/sys/dev/cxgbe/t4_main.c   Tue Apr 30 08:01:59 2019
(r346951)
+++ stable/11/sys/dev/cxgbe/t4_main.c   Tue Apr 30 08:08:06 2019
(r346952)
@@ -3281,17 +3281,38 @@ restart:
 V_FW_HDR_FW_VER_BUILD(chip##FW_VERSION_BUILD))
 #define FW_INTFVER(chip, intf) (chip##FW_HDR_INTFVER_##intf)
 
+/* Just enough of fw_hdr to cover all version info. */
+struct fw_h {
+   __u8ver;
+   __u8chip;
+   __be16  len512;
+   __be32  fw_ver;
+   __be32  tp_microcode_ver;
+   __u8intfver_nic;
+   __u8intfver_vnic;
+   __u8intfver_ofld;
+   __u8intfver_ri;
+   __u8intfver_iscsipdu;
+   __u8intfver_iscsi;
+   __u8intfver_fcoepdu;
+   __u8intfver_fcoe;
+};
+/* Spot check a couple of fields. */
+CTASSERT(offsetof(struct fw_h, fw_ver) == offsetof(struct fw_hdr, fw_ver));
+CTASSERT(offsetof(struct fw_h, intfver_nic) == offsetof(struct fw_hdr, 
intfver_nic));
+CTASSERT(offsetof(struct fw_h, intfver_fcoe) == offsetof(struct fw_hdr, 
intfver_fcoe));
+
 struct fw_info {
uint8_t chip;
char *kld_name;
char *fw_mod_name;
-   struct fw_hdr fw_hdr;   /* XXX: waste of space, need a sparse struct */
+   struct fw_h fw_h;
 } fw_info[] = {
{
.chip = CHELSIO_T4,
.kld_name = "t4fw_cfg",
.fw_mod_name = "t4fw",
-   .fw_hdr = {
+   .fw_h = {
.chip = FW_HDR_CHIP_T4,
.fw_ver = htobe32(FW_VERSION(T4)),
.intfver_nic = FW_INTFVER(T4, NIC),
@@ -3307,7 +3328,7 @@ struct fw_info {
.chip = CHELSIO_T5,
.kld_name = "t5fw_cfg",
.fw_mod_name = "t5fw",
-   .fw_hdr = {
+   .fw_h = {
.chip = FW_HDR_CHIP_T5,
.fw_ver = htobe32(FW_VERSION(T5)),
.intfver_nic = FW_INTFVER(T5, NIC),
@@ -3323,7 +3344,7 @@ struct fw_info {
.chip = CHELSIO_T6,
.kld_name = "t6fw_cfg",
.fw_mod_name = "t6fw",
-   .fw_hdr = {
+   .fw_h = {
.chip = FW_HDR_CHIP_T6,
.fw_ver = htobe32(FW_VERSION(T6)),
.intfver_nic = FW_INTFVER(T6, NIC),
@@ -3355,7 +3376,7 @@ find_fw_info(int chip)
  * with?
  */
 static int
-fw_compatible(const struct fw_hdr *hdr1, const struct fw_hdr *hdr2)
+fw_compatible(const struct fw_h *hdr1, const struct fw_h *hdr2)
 {
 
/* short circuit if it's the exact same firmware version */
@@ -3422,8 +3443,8 @@ unload_fw_module(struct adapter *sc, const struct firm
  * +ve errno means a firmware install was attempted but failed.
  */
 static int
-install_kld_firmware(struct adapter *sc, struct fw_hdr *card_fw,
-const struct fw_hdr *drv_fw, const char *reason, int *already)
+install_kld_firmware(struct adapter *sc, struct fw_h *card_fw,
+const struct fw_h *drv_fw, const char *reason, int *already)
 {
const struct firmware *cfg, *fw;
const uint32_t c = be32toh(card_fw->fw_ver);
@@ -3528,7 +3549,7 @@ contact_firmware(struct adapter *sc)
enum dev_state state;
struct fw_info *fw_info;
struct fw_hdr *card_fw; /* fw on the card */
-   const struct fw_hdr *drv_fw;/* fw bundled with the driver */
+   const struct fw_h *drv_fw;
 
fw_info = find_fw_info(chip_id(sc));
if (fw_info == NULL) {
@@ -3537,7 +3558,7 @@ contact_firmware(struct adapter *sc)
chip_id(sc));
return (EINVAL);
}
-   drv_fw = _info->fw_hdr;
+   drv_fw = _info->fw_h;
 
/* Read the header of the firmware on the card */
card_fw = malloc(sizeof(*card_fw), M_CXGBE, M_ZERO | M_WAITOK);
@@ -3550,7 +3571,8 @@ restart:
goto done;
}
 
-   rc = install_kld_firmware(sc, card_fw, drv_fw, NULL, );
+   rc = install_kld_firmware(sc, (struct fw_h *)card_fw, drv_fw, NULL,
+   );
if (rc == ERESTART)
goto restart;
if (rc != 0)
@@ -3563,7 +3585,7 @@ restart:
"failed to connect to the firmware: %d, %d.  "
"PCIE_FW 0x%08x\n", rc, state, t4_read_reg(sc, A_PCIE_FW));
 #if 0
-   if (install_kld_firmware(sc, card_fw, drv_fw,
+   if (install_kld_firmware(sc, 

svn commit: r346951 - stable/11/sys/dev/cxgbe

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 08:01:59 2019
New Revision: 346951
URL: https://svnweb.freebsd.org/changeset/base/346951

Log:
  MFC r343233:
  
  cxgbe(4): Clear the reply-pending status of a hashfilter when the reply
  indicates an error.  Also, do not remove it twice from the hf list in
  this case.
  
  Submitted by: Krishnamraju Eraparaju @ Chelsio
  Sponsored by: Chelsio Communicatons

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

Modified: stable/11/sys/dev/cxgbe/t4_filter.c
==
--- stable/11/sys/dev/cxgbe/t4_filter.c Tue Apr 30 07:53:15 2019
(r346950)
+++ stable/11/sys/dev/cxgbe/t4_filter.c Tue Apr 30 08:01:59 2019
(r346951)
@@ -1229,6 +1229,7 @@ t4_hashfilter_ao_rpl(struct sge_iq *iq, const struct r
/* provide errno instead of tid to ioctl */
f->tid = act_open_rpl_status_to_errno(status);
f->valid = 0;
+   f->pending = 0;
if (act_open_has_tid(status))
release_tid(sc, GET_TID(cpl), >sge.ctrlq[0]);
free_filter_resources(f);
@@ -1587,7 +1588,6 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t
f->locked = 0;
t->idx = f->tid;
} else {
-   remove_hf(sc, f);
rc = f->tid;
free(f, M_CXGBE);
}
___
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: r346950 - stable/11/sys/dev/cxgbe/iw_cxgbe

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 07:53:15 2019
New Revision: 346950
URL: https://svnweb.freebsd.org/changeset/base/346950

Log:
  MFC r343569, r345307
  
  r343569:
  cxgbe/iw_cxgbe: Fix an address calculation in the memory registration code 
that
  was added in r342266.
  
  Submitted by: Krishnamraju Eraparaju @ Chelsio
  Sponsored by: Chelsio Communications
  
  r345307:
  iw_cxgbe: Remove unused smac_idx from the ep structure.
  
  Submitted by: Krishnamraju Eraparaju @ Chelsio

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

Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
==
--- stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Tue Apr 30 07:45:07 2019
(r346949)
+++ stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Tue Apr 30 07:53:15 2019
(r346950)
@@ -857,7 +857,6 @@ struct c4iw_ep {
unsigned int mpa_pkt_len;
u32 ird;
u32 ord;
-   u32 smac_idx;
u32 tx_chan;
u32 mtu;
u16 mss;

Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c
==
--- stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c  Tue Apr 30 07:45:07 2019
(r346949)
+++ stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c  Tue Apr 30 07:53:15 2019
(r346950)
@@ -205,7 +205,7 @@ _c4iw_write_mem_dma(struct c4iw_rdev *rdev, u32 addr, 
if (ret)
goto out;
addr += dmalen >> 5;
-   data = (u64 *)data + dmalen;
+   data = (u8 *)data + dmalen;
daddr = daddr + dmalen;
}
if (remain)
___
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: r346949 - stable/11/sys/dev/cxgbe

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 07:45:07 2019
New Revision: 346949
URL: https://svnweb.freebsd.org/changeset/base/346949

Log:
  MFC r342954:
  
  cxgbe(4): Move some INTx specific code to a more appropriate place.

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

Modified: stable/11/sys/dev/cxgbe/t4_sge.c
==
--- stable/11/sys/dev/cxgbe/t4_sge.cTue Apr 30 07:40:01 2019
(r346948)
+++ stable/11/sys/dev/cxgbe/t4_sge.cTue Apr 30 07:45:07 2019
(r346949)
@@ -1325,6 +1325,9 @@ t4_intr_all(void *arg)
 
MPASS(sc->intr_count == 1);
 
+   if (sc->intr_type == INTR_INTX)
+   t4_write_reg(sc, MYPF_REG(A_PCIE_PF_CLI), 0);
+
t4_intr_err(arg);
t4_intr_evt(fwq);
 }
@@ -1338,7 +1341,6 @@ t4_intr_err(void *arg)
 {
struct adapter *sc = arg;
 
-   t4_write_reg(sc, MYPF_REG(A_PCIE_PF_CLI), 0);
t4_slow_intr_handler(sc);
 }
 
___
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: r346948 - stable/11/sys/dev/cxgbe/common

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 07:40:01 2019
New Revision: 346948
URL: https://svnweb.freebsd.org/changeset/base/346948

Log:
  MFC r342758:
  
  cxgbe(4): Clear FW_OK if the firmware reports an error.
  
  Sponsored by: Chelsio Communications

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

Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c
==
--- stable/11/sys/dev/cxgbe/common/t4_hw.c  Tue Apr 30 07:37:03 2019
(r346947)
+++ stable/11/sys/dev/cxgbe/common/t4_hw.c  Tue Apr 30 07:40:01 2019
(r346948)
@@ -209,9 +209,11 @@ static void t4_report_fw_error(struct adapter *adap)
u32 pcie_fw;
 
pcie_fw = t4_read_reg(adap, A_PCIE_FW);
-   if (pcie_fw & F_PCIE_FW_ERR)
+   if (pcie_fw & F_PCIE_FW_ERR) {
CH_ERR(adap, "Firmware reports adapter error: %s\n",
reason[G_PCIE_FW_EVAL(pcie_fw)]);
+   adap->flags &= ~FW_OK;
+   }
 }
 
 /*
___
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: r346947 - stable/11/sys/dev/cxgbe/tom

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 07:37:03 2019
New Revision: 346947
URL: https://svnweb.freebsd.org/changeset/base/346947

Log:
  MFC r342356:
  
  Remove unused macros from t4_tom.h.

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

Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.h
==
--- stable/11/sys/dev/cxgbe/tom/t4_tom.hTue Apr 30 07:34:34 2019
(r346946)
+++ stable/11/sys/dev/cxgbe/tom/t4_tom.hTue Apr 30 07:37:03 2019
(r346947)
@@ -218,10 +218,6 @@ struct flowc_tx_params {
unsigned int mss;
 };
 
-#defineDDP_RETRY_WAIT  5   /* seconds to wait before re-enabling 
DDP */
-#defineDDP_LOW_SCORE   1
-#defineDDP_HIGH_SCORE  3
-
 /*
  * Compressed state for embryonic connections for a listener.  Barely fits in
  * 64B, try not to grow it further.
___
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: r346946 - stable/11/sys/dev/cxgbe

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 07:34:34 2019
New Revision: 346946
URL: https://svnweb.freebsd.org/changeset/base/346946

Log:
  MFC r342234:
  
  cxgbe(4): Do not issue mbox commands after t4_fw_bye.
  
  Sponsored by: Chelsio Communications

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

Modified: stable/11/sys/dev/cxgbe/t4_clip.c
==
--- stable/11/sys/dev/cxgbe/t4_clip.c   Tue Apr 30 07:32:02 2019
(r346945)
+++ stable/11/sys/dev/cxgbe/t4_clip.c   Tue Apr 30 07:34:34 2019
(r346946)
@@ -324,7 +324,9 @@ t4_destroy_clip_table(struct adapter *sc)
("%s: CLIP entry %p still in use (%d)", __func__,
ce, ce->refcount));
TAILQ_REMOVE(>clip_table, ce, link);
+#if 0
delete_lip(sc, >lip);
+#endif
free(ce, M_CXGBE);
}
mtx_unlock(>clip_table_lock);
___
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: r346945 - stable/11/sys/dev/cxgbe

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 07:32:02 2019
New Revision: 346945
URL: https://svnweb.freebsd.org/changeset/base/346945

Log:
  MFC r341654:
  
  cxgbe(4): Get Linux cxgb4vf working in bhyve VMs with VFs passed
  through.
  
  cxgb4vf doesn't own the buffer size list but still expects the first two
  entries to be 4K and some power of 2 respectively.  The BSD cxgbe
  doesn't care where its preferred buffer sizes are as long as they're in
  the list somewhere, so just move its entries towards the end as a
  workaround.
  
  Sponsored by: Chelsio Communications

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

Modified: stable/11/sys/dev/cxgbe/t4_sge.c
==
--- stable/11/sys/dev/cxgbe/t4_sge.cTue Apr 30 07:12:30 2019
(r346944)
+++ stable/11/sys/dev/cxgbe/t4_sge.cTue Apr 30 07:32:02 2019
(r346945)
@@ -665,8 +665,10 @@ t4_tweak_chip_settings(struct adapter *sc)
 
KASSERT(nitems(sge_flbuf_sizes) <= SGE_FLBUF_SIZES,
("%s: hw buffer size table too big", __func__));
+   t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE0, 4096);
+   t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE1, 65536);
for (i = 0; i < min(nitems(sge_flbuf_sizes), SGE_FLBUF_SIZES); i++) {
-   t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE0 + (4 * i),
+   t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE15 - (4 * i),
sge_flbuf_sizes[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: r346944 - stable/11/sys/dev/mrsas

2019-04-30 Thread Kashyap D Desai
Author: kadesai
Date: Tue Apr 30 07:12:30 2019
New Revision: 346944
URL: https://svnweb.freebsd.org/changeset/base/346944

Log:
  MFC r345056, r345058, r345059
  
  r345056
  
  fw_outstanding"(outstanding IOs at firmware level) counter gets screwed up 
when R1 fastpath
  writes are running. Some of the cases which are not handled properly in 
driver are:
  
  1. With R1 fastpath supported, single write from CAM layer can consume 2 MPT 
frames
  at driver/firmware level for fastpath qualification(if fw_outstanding < 
controller Queue Depth).
  Due to this driver has to throttle IOs coming from CAM layer as well as 
second fastpath
  write(of R1 write) against Adapter Queue Depth.
  If "fw_outstanding" reaches to adapter queue depth, driver should return IOs 
from CAM layer with
  device busy status.While allocating second MPT frame(corresponding to R1 FP 
write) also, driver
  should ensure fw_outstanding should not exceed adapter QD.
  
  2. For R1 fastpath writes completion, driver decrements "fw_oustanding" 
counter without
  really returning MPT frame to free pool. It may cause IOs(with heavy IOs 
running, consuming whole
  adapter Queue Depth) consuming MPT frames reserved for DCMDs(management 
commands) and
  DCMDs(internal and sent by application) not getting MPT frame will start 
failing.
  
  Below is one test case to hit the issue described above-
  1. Run heavy IOs (outstanding IOs should hit adapter Queue Depth).
  2. Run management tool (Broadcom's storcli tool) querying adapter in loop 
(run command- "storcli64 /c0 show" in loop).
  3. Management tool's requests would start failing due to non-availability of 
free MPT frames as all frames would be consumed by IOs.
  
  Fix: Increment/decrement of "fw_outstanding" counter should be in sync with 
MPT frame get/return.
  
  r345058
  
  Allocated MFI frames should be same as MPT frames reserved for DCMDs
  
  r345059
  
  Update driver version to 07.709.04.00-fbsd

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

Modified: stable/11/sys/dev/mrsas/mrsas.c
==
--- stable/11/sys/dev/mrsas/mrsas.c Tue Apr 30 07:10:11 2019
(r346943)
+++ stable/11/sys/dev/mrsas/mrsas.c Tue Apr 30 07:12:30 2019
(r346944)
@@ -1712,6 +1712,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M
mrsas_map_mpt_cmd_status(cmd_mpt, 
cmd_mpt->ccb_ptr, status,
extStatus, data_length, sense);
mrsas_cmd_done(sc, cmd_mpt);
+   mrsas_atomic_dec(>fw_outstanding);
} else {
/*
 * If the peer  Raid  1/10 fast path failed,
@@ -1735,12 +1736,13 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M
r1_cmd->callout_owner  = false;
}
mrsas_release_mpt_cmd(r1_cmd);
+   mrsas_atomic_dec(>fw_outstanding);
mrsas_map_mpt_cmd_status(cmd_mpt, 
cmd_mpt->ccb_ptr, status,
extStatus, data_length, sense);
mrsas_cmd_done(sc, cmd_mpt);
+   mrsas_atomic_dec(>fw_outstanding);
}
}
-   mrsas_atomic_dec(>fw_outstanding);
break;
case MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST:   /* MFI command 
*/
cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx];
@@ -2526,6 +2528,9 @@ mrsas_init_fw(struct mrsas_softc *sc)
else
sc->fast_path_io = 0;
}
+   
+   device_printf(sc->mrsas_dev, "max_fw_cmds: %u  max_scsi_cmds: %u\n",
+   sc->max_fw_cmds, sc->max_scsi_cmds);
return (0);
 }
 
@@ -2553,8 +2558,7 @@ mrsas_init_adapter(struct mrsas_softc *sc)
 
/* Decrement the max supported by 1, to correlate with FW */
sc->max_fw_cmds = sc->max_fw_cmds - 1;
-   sc->max_scsi_cmds = sc->max_fw_cmds -
-   (MRSAS_FUSION_INT_CMDS + MRSAS_MAX_IOCTL_CMDS);
+   sc->max_scsi_cmds = sc->max_fw_cmds - MRSAS_MAX_MFI_CMDS;
 
/* Determine allocation size of command frames */
sc->reply_q_depth = ((sc->max_fw_cmds + 1 + 15) / 16 * 16) * 2;

Modified: stable/11/sys/dev/mrsas/mrsas.h
==
--- stable/11/sys/dev/mrsas/mrsas.h Tue Apr 30 07:10:11 2019
(r346943)
+++ stable/11/sys/dev/mrsas/mrsas.h Tue Apr 30 07:12:30 2019
(r346944)
@@ -119,7 

svn commit: r346943 - stable/12/sys/dev/mrsas

2019-04-30 Thread Kashyap D Desai
Author: kadesai
Date: Tue Apr 30 07:10:11 2019
New Revision: 346943
URL: https://svnweb.freebsd.org/changeset/base/346943

Log:
  MFC r345056, r345058, r345059
  
  r345056
  
  fw_outstanding"(outstanding IOs at firmware level) counter gets screwed up 
when R1 fastpath
  writes are running. Some of the cases which are not handled properly in 
driver are:
  
  1. With R1 fastpath supported, single write from CAM layer can consume 2 MPT 
frames
  at driver/firmware level for fastpath qualification(if fw_outstanding < 
controller Queue Depth).
  Due to this driver has to throttle IOs coming from CAM layer as well as 
second fastpath
  write(of R1 write) against Adapter Queue Depth.
  If "fw_outstanding" reaches to adapter queue depth, driver should return IOs 
from CAM layer with
  device busy status.While allocating second MPT frame(corresponding to R1 FP 
write) also, driver
  should ensure fw_outstanding should not exceed adapter QD.
  
  2. For R1 fastpath writes completion, driver decrements "fw_oustanding" 
counter without
  really returning MPT frame to free pool. It may cause IOs(with heavy IOs 
running, consuming whole
  adapter Queue Depth) consuming MPT frames reserved for DCMDs(management 
commands) and
  DCMDs(internal and sent by application) not getting MPT frame will start 
failing.
  
  Below is one test case to hit the issue described above-
  1. Run heavy IOs (outstanding IOs should hit adapter Queue Depth).
  2. Run management tool (Broadcom's storcli tool) querying adapter in loop 
(run command- "storcli64 /c0 show" in loop).
  3. Management tool's requests would start failing due to non-availability of 
free MPT frames as all frames would be consumed by IOs.
  
  Fix: Increment/decrement of "fw_outstanding" counter should be in sync with 
MPT frame get/return.
  
  r345058
  
  Allocated MFI frames should be same as MPT frames reserved for DCMDs
  
  r345059
  
  Update driver version to 07.709.04.00-fbsd

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

Modified: stable/12/sys/dev/mrsas/mrsas.c
==
--- stable/12/sys/dev/mrsas/mrsas.c Tue Apr 30 06:04:29 2019
(r346942)
+++ stable/12/sys/dev/mrsas/mrsas.c Tue Apr 30 07:10:11 2019
(r346943)
@@ -1712,6 +1712,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M
mrsas_map_mpt_cmd_status(cmd_mpt, 
cmd_mpt->ccb_ptr, status,
extStatus, data_length, sense);
mrsas_cmd_done(sc, cmd_mpt);
+   mrsas_atomic_dec(>fw_outstanding);
} else {
/*
 * If the peer  Raid  1/10 fast path failed,
@@ -1735,12 +1736,13 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M
r1_cmd->callout_owner  = false;
}
mrsas_release_mpt_cmd(r1_cmd);
+   mrsas_atomic_dec(>fw_outstanding);
mrsas_map_mpt_cmd_status(cmd_mpt, 
cmd_mpt->ccb_ptr, status,
extStatus, data_length, sense);
mrsas_cmd_done(sc, cmd_mpt);
+   mrsas_atomic_dec(>fw_outstanding);
}
}
-   mrsas_atomic_dec(>fw_outstanding);
break;
case MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST:   /* MFI command 
*/
cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx];
@@ -2526,6 +2528,9 @@ mrsas_init_fw(struct mrsas_softc *sc)
else
sc->fast_path_io = 0;
}
+   
+   device_printf(sc->mrsas_dev, "max_fw_cmds: %u  max_scsi_cmds: %u\n",
+   sc->max_fw_cmds, sc->max_scsi_cmds);
return (0);
 }
 
@@ -2553,8 +2558,7 @@ mrsas_init_adapter(struct mrsas_softc *sc)
 
/* Decrement the max supported by 1, to correlate with FW */
sc->max_fw_cmds = sc->max_fw_cmds - 1;
-   sc->max_scsi_cmds = sc->max_fw_cmds -
-   (MRSAS_FUSION_INT_CMDS + MRSAS_MAX_IOCTL_CMDS);
+   sc->max_scsi_cmds = sc->max_fw_cmds - MRSAS_MAX_MFI_CMDS;
 
/* Determine allocation size of command frames */
sc->reply_q_depth = ((sc->max_fw_cmds + 1 + 15) / 16 * 16) * 2;

Modified: stable/12/sys/dev/mrsas/mrsas.h
==
--- stable/12/sys/dev/mrsas/mrsas.h Tue Apr 30 06:04:29 2019
(r346942)
+++ stable/12/sys/dev/mrsas/mrsas.h Tue Apr 30 07:10:11 2019
(r346943)
@@ -119,7 

Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en

2019-04-30 Thread Andrey V. Elsukov
On 30.04.2019 00:14, John Baldwin wrote:
>> Yes, we were able to reproduce this issue in house. If you don't mind, I 
>> prefer to wait for John's update - where he eliminates the EAGAIN 
>> handling in the network drivers.
> 
> I have rebased the branch for this, but for now it will just panic sooner
> I believe by tripping an assertion.  Can you grab the diff (or just the 
> branch)
> from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce under a
> kernel with INVARIANTS?  I think we will have to explicitly clear the 'rcvif'
> pointer somewhere, but I want to see what the stack trace looks like so I can
> think about the "right" place to clear it.

Hi,

please note, that rcvif is used by firewall to track inbound interface
and clearing it can be unexpected in some cases, and can break firewall
rules.

-- 
WBR, Andrey V. Elsukov
___
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: r346932 - head/sys/ufs/ufs

2019-04-30 Thread Alexey Dokuchaev
On Mon, Apr 29, 2019 at 10:05:26PM +, Mark Johnston wrote:
> New Revision: 346932
> URL: https://svnweb.freebsd.org/changeset/base/346932
> 
> Log:
>   Optimize lseek(SEEK_DATA) on UFS.
>   
>   This version fixes the problems identified in r345244.
>   
>   Reviewed by:kib
> @@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  
> +static ufs_lbn_t lbn_count(struct ufsmount *, int);
> +static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct buf **);

Is the prototype for static readindir() really needed here?

> +static int
> +readindir(vp, lbn, daddr, bpp)
> + struct vnode *vp;
> + ufs_lbn_t lbn;
> + ufs2_daddr_t daddr;
> + struct buf **bpp;

Don't we prefer ASNI declarations over K these days?

> +static ufs_lbn_t
> +lbn_count(ump, level)
> + struct ufsmount *ump;
> + int level;

Ditto.

> +int
> +ufs_bmap_seekdata(vp, offp)
> + struct vnode *vp;
> + off_t *offp;

./danfe
___
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: r346942 - in stable/11/sys/dev/cxgbe: . common

2019-04-30 Thread Navdeep Parhar
Author: np
Date: Tue Apr 30 06:04:29 2019
New Revision: 346942
URL: https://svnweb.freebsd.org/changeset/base/346942

Log:
  MFC r341620:
  
  cxgbe(4): Fall back to a basic configuration in case of any error during
  card initialization.  This is an expanded version of r333682.
  
  Break up prep_firmware into simpler routines while here.  Load the
  firmware/config KLD only if needed.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/11/sys/dev/cxgbe/adapter.h
  stable/11/sys/dev/cxgbe/common/common.h
  stable/11/sys/dev/cxgbe/common/t4_hw.c
  stable/11/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/cxgbe/adapter.h
==
--- stable/11/sys/dev/cxgbe/adapter.h   Tue Apr 30 03:45:46 2019
(r346941)
+++ stable/11/sys/dev/cxgbe/adapter.h   Tue Apr 30 06:04:29 2019
(r346942)
@@ -172,6 +172,7 @@ enum {
DF_DUMP_MBOX= (1 << 0), /* Log all mbox cmd/rpl. */
DF_LOAD_FW_ANYTIME  = (1 << 1), /* Allow LOAD_FW after init */
DF_DISABLE_TCB_CACHE= (1 << 2), /* Disable TCB cache (T6+) */
+   DF_DISABLE_CFG_RETRY= (1 << 3), /* Disable fallback config */
 };
 
 #define IS_DOOMED(vi)  ((vi)->flags & DOOMED)

Modified: stable/11/sys/dev/cxgbe/common/common.h
==
--- stable/11/sys/dev/cxgbe/common/common.h Tue Apr 30 03:45:46 2019
(r346941)
+++ stable/11/sys/dev/cxgbe/common/common.h Tue Apr 30 06:04:29 2019
(r346942)
@@ -603,6 +603,7 @@ int t4_flash_erase_sectors(struct adapter *adapter, in
 int t4_flash_cfg_addr(struct adapter *adapter);
 int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int 
size);
 int t4_get_fw_version(struct adapter *adapter, u32 *vers);
+int t4_get_fw_hdr(struct adapter *adapter, struct fw_hdr *hdr);
 int t4_get_bs_version(struct adapter *adapter, u32 *vers);
 int t4_get_tp_version(struct adapter *adapter, u32 *vers);
 int t4_get_exprom_version(struct adapter *adapter, u32 *vers);
@@ -734,11 +735,9 @@ int t4_fw_hello(struct adapter *adap, unsigned int mbo
 int t4_fw_bye(struct adapter *adap, unsigned int mbox);
 int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset);
 int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force);
-int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset);
+int t4_fw_restart(struct adapter *adap, unsigned int mbox);
 int t4_fw_upgrade(struct adapter *adap, unsigned int mbox,
  const u8 *fw_data, unsigned int size, int force);
-int t4_fw_forceinstall(struct adapter *adap, const u8 *fw_data,
-unsigned int size);
 int t4_fw_initialize(struct adapter *adap, unsigned int mbox);
 int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf,
unsigned int vf, unsigned int nparams, const u32 *params,

Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c
==
--- stable/11/sys/dev/cxgbe/common/t4_hw.c  Tue Apr 30 03:45:46 2019
(r346941)
+++ stable/11/sys/dev/cxgbe/common/t4_hw.c  Tue Apr 30 06:04:29 2019
(r346942)
@@ -3319,6 +3319,19 @@ int t4_get_fw_version(struct adapter *adapter, u32 *ve
 }
 
 /**
+ * t4_get_fw_hdr - read the firmware header
+ * @adapter: the adapter
+ * @hdr: where to place the version
+ *
+ * Reads the FW header from flash into caller provided buffer.
+ */
+int t4_get_fw_hdr(struct adapter *adapter, struct fw_hdr *hdr)
+{
+   return t4_read_flash(adapter, FLASH_FW_START,
+   sizeof (*hdr) / sizeof (uint32_t), (uint32_t *)hdr, 1);
+}
+
+/**
  * t4_get_bs_version - read the firmware bootstrap version
  * @adapter: the adapter
  * @vers: where to place the version
@@ -6898,7 +6911,7 @@ int t4_fw_halt(struct adapter *adap, unsigned int mbox
 * If a legitimate mailbox is provided, issue a RESET command
 * with a HALT indication.
 */
-   if (mbox <= M_PCIE_FW_MASTER) {
+   if (adap->flags & FW_OK && mbox <= M_PCIE_FW_MASTER) {
struct fw_reset_cmd c;
 
memset(, 0, sizeof(c));
@@ -6937,64 +6950,24 @@ int t4_fw_halt(struct adapter *adap, unsigned int mbox
 /**
  * t4_fw_restart - restart the firmware by taking the uP out of RESET
  * @adap: the adapter
- * @reset: if we want to do a RESET to restart things
  *
  * Restart firmware previously halted by t4_fw_halt().  On successful
  * return the previous PF Master remains as the new PF Master and there
  * is no need to issue a new HELLO command, etc.
- *
- * We do this in two ways:
- *
- *  1. If we're dealing with newer firmware we'll simply want to take
- * the chip's microprocessor out of RESET.  This will cause the
- * firmware to start up from its